diff --git a/flake.lock b/flake.lock index 572c561e..213725aa 100644 --- a/flake.lock +++ b/flake.lock @@ -1,6 +1,22 @@ { "nodes": { "hyprland-protocols": { + "flake": false, + "locked": { + "lastModified": 1670258048, + "narHash": "sha256-Lm2sXnDVZNE+taHqsqVibvPmSdu65VHvXI507KVX4lg=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "0dcff94fc10df2bbb66d3e1b5a1d6cfd3ada5515", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprland-protocols_2": { "flake": false, "locked": { "lastModified": 1670185345, @@ -34,6 +50,7 @@ }, "root": { "inputs": { + "hyprland-protocols": "hyprland-protocols", "nixpkgs": "nixpkgs", "wlroots": "wlroots", "xdph": "xdph" @@ -59,7 +76,7 @@ }, "xdph": { "inputs": { - "hyprland-protocols": "hyprland-protocols", + "hyprland-protocols": "hyprland-protocols_2", "nixpkgs": [ "nixpkgs" ] diff --git a/flake.nix b/flake.nix index bb097d6a..666edf3f 100644 --- a/flake.nix +++ b/flake.nix @@ -12,6 +12,11 @@ url = "github:hyprwm/xdg-desktop-portal-hyprland"; inputs.nixpkgs.follows = "nixpkgs"; }; + + hyprland-protocols = { + url = "github:hyprwm/hyprland-protocols"; + flake = false; + }; }; outputs = inputs @ { @@ -64,6 +69,7 @@ stdenv = prev.gcc12Stdenv; version = "0.18.0beta" + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty"); wlroots = wlroots-hyprland; + inherit (inputs) hyprland-protocols; }; hyprland-debug = hyprland.override {debug = true;}; hyprland-no-hidpi = hyprland.override {hidpiXWayland = false;}; diff --git a/nix/default.nix b/nix/default.nix index cf690857..58d63712 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -7,6 +7,7 @@ meson, ninja, git, + hyprland-protocols, libdrm, libinput, libxcb, @@ -92,6 +93,10 @@ in # Fix hardcoded paths to /usr installation postPatch = '' sed -i "s#/usr#$out#" src/render/OpenGL.cpp + + # for some reason rmdir doesn't work in a dirty tree + rmdir subprojects/hyprland-protocols || true + ln -s ${hyprland-protocols} subprojects/hyprland-protocols ''; passthru.providedSessions = ["hyprland"]; diff --git a/protocols/meson.build b/protocols/meson.build index 127406d9..d75acb3a 100644 --- a/protocols/meson.build +++ b/protocols/meson.build @@ -3,7 +3,14 @@ wayland_protos = dependency('wayland-protocols', fallback: 'wayland-protocols', default_options: ['tests=false'], ) + +hyprland_protos = dependency('hyprland-protocols', + version: '>=0.1', + fallback: 'hyprland-protocols', +) + wl_protocol_dir = wayland_protos.get_variable('pkgdatadir') +hl_protocol_dir = hyprland_protos.get_variable('pkgdatadir') wayland_scanner_dep = dependency('wayland-scanner', native: true) wayland_scanner = find_program( @@ -19,7 +26,8 @@ protocols = [ ['ext-workspace-unstable-v1.xml'], ['pointer-constraints-unstable-v1.xml'], ['tablet-unstable-v2.xml'], - ['idle.xml'] + ['idle.xml'], + [hl_protocol_dir, 'protocols/hyprland-toplevel-export-v1.xml'] ] wl_protos_src = [] wl_protos_headers = []