Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation: improve FreeBSD instructions for Manual Build #200

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

jbeich
Copy link
Contributor

@jbeich jbeich commented Apr 25, 2023

No description provided.

@vaxerski
Copy link
Member

huh why is cmake linux only?

@jbeich
Copy link
Contributor Author

jbeich commented May 1, 2023

huh why is cmake linux only?

I've dropped 2ec125b in favor of hyprwm/Hyprland#2209

@fufexan
Copy link
Member

fufexan commented Aug 11, 2023

@jbeich has anything changed since 4 months ago?

@jbeich
Copy link
Contributor Author

jbeich commented Aug 11, 2023

Not much:

  • Both CMake and Meson (from this PR) instructions still work
  • FreeBSD 13.3/14.0 haven't been released yet, so building with GCC is still easier

105b552 added meson subprojects update --reset but it's broken outside of Nix:

$ git clone https://github.com/hyprwm/Hyprland
$ cd Hyprland
$ meson subprojects update --reset
Updating udis86...
  -> Cannot update subproject with no wrap file
Updating tracy...
  -> Cannot update subproject with no wrap file
Updating hyprland-protocols...
  -> Cannot update subproject with no wrap file
Initialized empty Git repository in /tmp/Hyprland/subprojects/wlroots/.git/
remote: Enumerating objects: 480, done.
remote: Counting objects: 100% (480/480), done.
remote: Compressing objects: 100% (466/466), done.
remote: Total 480 (delta 27), reused 160 (delta 5), pack-reused 0
Receiving objects: 100% (480/480), 773.01 KiB | 300.00 KiB/s, done.
Resolving deltas: 100% (27/27), done.
From https://gitlab.freedesktop.org/wlroots/wlroots
 * branch            c74f89d4f84bfed0284d3908aee5d207698c70c5 -> FETCH_HEAD
HEAD is now at c74f89d Avoid using memcpy() to copy structs
Applying diff file "wlroots-meson-build.patch"
Updating wlroots...
  -> c74f89d (grafted, HEAD) Avoid using memcpy() to copy structs [Simon Ser]

$ meson setup build
$ meson compile -C build
[...]
../subprojects/wlroots/include/wlr/render/egl.h:19:10: fatal error: 'wlr/config.h' file not found
#include <wlr/config.h>
         ^~~~~~~~~~~~~~

$ find . -name config.h
./build/subprojects/wlroots/include/wlroots/config.h
./build/subprojects/wlroots/include/config.h
$ find . -name wlr
./subprojects/wlroots/include/wlr
./subprojects/wlroots/include/wlr/wlr
$ readlink ./subprojects/wlroots/include/wlr/wlr
/tmp/Hyprland/subprojects/wlroots/include/wlr

$ cat subprojects/packagefiles/wlroots-meson-build.patch
[...]
-install_subdir('wlr',
+install_subdir('wlroots',
[...]

@fufexan
Copy link
Member

fufexan commented Aug 12, 2023

but it's broken outside of Nix

Can I fix it somehow or is it better to just not use meson subprojects?

@jbeich
Copy link
Contributor Author

jbeich commented Nov 10, 2023

Better remove wlroots.wrap. It's not consistent with other subprojects (e.g., hyprland-protocols, udis86) or CMake support.

Downstream I use git submodule instead of meson subprojects and system wlroots (a la Nix), so don't need synthetic soversion bump.

@fufexan
Copy link
Member

fufexan commented Nov 10, 2023

Alright, I'll remove it soon (unless I forget).

@fufexan
Copy link
Member

fufexan commented Jan 31, 2024

Is there anything left to do in this PR or is it ready? @jbeich

@jbeich
Copy link
Contributor Author

jbeich commented Jan 31, 2024

Tested both Meson and CMake instructions - still good.

@jbeich
Copy link
Contributor Author

jbeich commented Jan 31, 2024

Wait, --skip-subprojects may be wrong for the plugin API.

@fufexan
Copy link
Member

fufexan commented Jan 31, 2024

Is there anything that can be done on the meson side, so we don't have to include all the commands here? The wlroots.wrap file used to patch the subproject so it properly installed headers, but now I don't know of a better approach.

- ninja doesn't support `--tags` unlike meson
- `--skip-subprojects` is more clear than `--tags runtime,man`
Trying to build in a random directory like HOME may fail or build
something else. So, provide the context for a user who skipped
reading CMake section.
System tomlplusplus is built against libc++ which conflicts with
libstdc++ used by GCC. While tomlplusplus can be bundled it's only
easy to do via Meson (--force-fallback-for).

/usr/local/bin/ld: hyprpm/CMakeFiles/hyprpm.dir/src/core/DataState.cpp.o: in function `DataState::addNewPluginRepo(SPluginRepository const&)':
DataState.cpp:(.text+0x16b4): undefined reference to `toml::v3::table::get_lower_bound(std::basic_string_view<char, std::char_traits<char> >)'
/usr/local/bin/ld: DataState.cpp:(.text+0x1793): undefined reference to `toml::v3::table::insert_with_hint(toml::v3::impl::table_iterator<true>, toml::v3::key&&, std::unique_ptr<toml::v3::node, std::default_delete<toml::v3::node> >&&)'
/usr/local/bin/ld: DataState.cpp:(.text+0x2c59): undefined reference to `toml::v3::impl::print_to_stream(std::ostream&, toml::v3::table const&)'
/usr/local/bin/ld: hyprpm/CMakeFiles/hyprpm.dir/src/core/DataState.cpp.o: in function `DataState::pluginRepoExists(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
DataState.cpp:(.text+0x3739): undefined reference to `toml::v3::ex::parse_file(std::basic_string_view<char, std::char_traits<char> >)'
/usr/local/bin/ld: DataState.cpp:(.text+0x3783): undefined reference to `toml::v3::table::get(std::basic_string_view<char, std::char_traits<char> >)'
/usr/local/bin/ld: DataState.cpp:(.text+0x37ab): undefined reference to `toml::v3::table::get(std::basic_string_view<char, std::char_traits<char> >)'
[...]
FreeBSD uuid(3) has slightly different API than Linux and doesn't support
random UUIDs unlike NetBSD. Instead use external implementation.

hyprwm/Hyprland@7778f01194d8
@jbeich
Copy link
Contributor Author

jbeich commented Sep 21, 2024

I've dropped Meson workaround and rebased after aquamarine switch.

ninja -C build
ninja -C build install --tags runtime,man
meson compile -C build
meson install -C build --skip-subprojects
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this not mean udis86 will not be found?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

udis86 is not part of Hyprland plugin API unlike wlroots was before aquamarine. --skip-subprojects is still necessary to avoid installing hyprland-protocols (plugins use preprocessed headers instead). Hyprland itself doesn't support building against system-wide copy of udis86 (Alpine patches this), and the bundled version uses CMake to build the submodule.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine by me. However, I've made progress towards allowing Hyprland to build with a system-wide copy of udis86 (provided it's canihavesomecoffee's fork, which includes a .pc file). See this PR for more info about it, maybe leave your thoughts as well hyprwm/Hyprland#7885.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants