diff options
author | Mihai Fufezan <[email protected]> | 2023-05-16 20:50:18 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2023-05-16 20:50:18 +0300 |
commit | 78826c6d18ee587a28cf39479f9a015888d2e096 (patch) | |
tree | 2367501d92abc204c772720d9f6ca14dada4902d | |
parent | b5b9af508ab74b1922bc3354d178ebf457db631e (diff) | |
download | Hyprland-78826c6d18ee587a28cf39479f9a015888d2e096.tar.gz Hyprland-78826c6d18ee587a28cf39479f9a015888d2e096.zip |
meson & nix: install wlroots headers (#2287)
-rw-r--r-- | meson.build | 2 | ||||
-rw-r--r-- | nix/default.nix | 4 | ||||
-rwxr-xr-x | nix/update-inputs.sh | 5 | ||||
-rw-r--r-- | subprojects/packagefiles/wlroots-meson-build.patch | 45 | ||||
-rw-r--r-- | subprojects/wlroots.wrap | 7 |
5 files changed, 61 insertions, 2 deletions
diff --git a/meson.build b/meson.build index 224c9248..6a94dee6 100644 --- a/meson.build +++ b/meson.build @@ -96,5 +96,5 @@ import('pkgconfig').generate( url: 'https://github.com/hyprwm/Hyprland', description: 'Hyprland header files', install_dir: pkg_install_dir, - subdirs: ['', 'hyprland/protocols'], + subdirs: ['', 'hyprland/protocols', 'hyprland/wlroots'], ) diff --git a/nix/default.nix b/nix/default.nix index eee9e6c4..5b59e514 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -113,6 +113,10 @@ in }' ''; + postInstall = '' + ln -s ${wlroots}/include/wlr $dev/include/hyprland/wlroots + ''; + passthru.providedSessions = ["hyprland"]; meta = with lib; { diff --git a/nix/update-inputs.sh b/nix/update-inputs.sh index f4b63f9c..6db18606 100755 --- a/nix/update-inputs.sh +++ b/nix/update-inputs.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env -S nix shell nixpkgs#gawk nixpkgs#git nixpkgs#moreutils nixpkgs#jq nixpkgs#ripgrep -c bash +#!/usr/bin/env -S nix shell nixpkgs#gawk nixpkgs#git nixpkgs#gnused nixpkgs#moreutils nixpkgs#jq nixpkgs#ripgrep -c bash set -ex @@ -16,6 +16,9 @@ if [ "$SUB_REV" != "$CRT_REV" ]; then # remove "dirty" mark from lockfile jq <flake.lock 'del(.nodes.wlroots.original.rev)' | sponge flake.lock + + # fix revision in wlroots.wrap + sed -Ei "s/[a-z0-9]{40}/$CRT_REV/g" subprojects/wlroots.wrap else echo "wlroots is up to date!" fi diff --git a/subprojects/packagefiles/wlroots-meson-build.patch b/subprojects/packagefiles/wlroots-meson-build.patch new file mode 100644 index 00000000..5e7565a3 --- /dev/null +++ b/subprojects/packagefiles/wlroots-meson-build.patch @@ -0,0 +1,45 @@ +diff --git a/include/meson.build b/include/meson.build +index e669800..687786b 100644 +--- a/include/meson.build ++++ b/include/meson.build +@@ -1,4 +1,5 @@ +-subdir('wlr') ++run_command('ln', '-s', join_paths(meson.project_source_root(), 'include', 'wlr'), join_paths(meson.project_source_root(), 'include', 'wlroots'), check: true) ++subdir('wlroots') + + exclude_files = ['meson.build', 'config.h.in', 'version.h.in'] + if not features.get('drm-backend') +@@ -24,8 +25,8 @@ if not features.get('session') + exclude_files += 'backend/session.h' + endif + +-install_subdir('wlr', +- install_dir: get_option('includedir'), ++install_subdir('wlroots', ++ install_dir: join_paths(get_option('includedir'), 'hyprland'), + exclude_files: exclude_files, + ) + +diff --git a/include/wlr/meson.build b/include/wlr/meson.build +index f7ca413..0a86d54 100644 +--- a/include/wlr/meson.build ++++ b/include/wlr/meson.build +@@ -22,4 +22,4 @@ ver_h = configure_file( + configuration: version_data, + ) + +-install_headers(conf_h, ver_h, subdir: 'wlr') ++install_headers(conf_h, ver_h, subdir: join_paths('hyprland', 'wlroots')) +diff --git a/meson.build b/meson.build +index 29b103a..0b6e5a4 100644 +--- a/meson.build ++++ b/meson.build +@@ -15,7 +15,7 @@ project( + # necessary for bugfix releases. Increasing soversion is required because + # wlroots never guarantees ABI stability -- only API stability is guaranteed + # between minor releases. +-soversion = 12 ++soversion = 12032 + + little_endian = target_machine.endian() == 'little' + big_endian = target_machine.endian() == 'big' diff --git a/subprojects/wlroots.wrap b/subprojects/wlroots.wrap new file mode 100644 index 00000000..161de78a --- /dev/null +++ b/subprojects/wlroots.wrap @@ -0,0 +1,7 @@ +[wrap-git] +directory = wlroots +url = https://gitlab.freedesktop.org/wlroots/wlroots.git +revision = 6830bfc17fd94709e2cdd4da0af989f102a26e59 +depth = 1 + +diff_files = wlroots-meson-build.patch |