Nix & meson: add hyprland-toplevel-export protocol

This commit is contained in:
Mihai Fufezan 2022-12-05 14:32:26 +02:00
parent dc23ed8a4e
commit a878b9c1a3
No known key found for this signature in database
GPG Key ID: 5899325F2F120900
4 changed files with 38 additions and 2 deletions

View File

@ -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"
]

View File

@ -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;};

View File

@ -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"];

View File

@ -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 = []