From b0159a73f47e654ac62fe0dc3c93974acfc600ed Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Fri, 9 Feb 2024 09:53:57 +0200 Subject: [PATCH] Meson & Nix: build with hyprlang --- flake.lock | 23 ++++++++++++++++++++++- flake.nix | 7 ++++++- nix/default.nix | 2 ++ nix/overlays.nix | 1 + nix/patches/meson-build.patch | 5 +++-- src/meson.build | 1 + 6 files changed, 35 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 8af1695b..bde05590 100644 --- a/flake.lock +++ b/flake.lock @@ -24,6 +24,26 @@ } }, "hyprlang": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1707453316, + "narHash": "sha256-5rE0VX2c95Dtnn420OCmI4rRtW2SEC1+J6AQKg1IoUc=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "ab007915f7ede0e47fb922496f21e3210d165df2", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprlang_2": { "inputs": { "nixpkgs": [ "xdph", @@ -63,6 +83,7 @@ "root": { "inputs": { "hyprland-protocols": "hyprland-protocols", + "hyprlang": "hyprlang", "nixpkgs": "nixpkgs", "systems": "systems", "wlroots": "wlroots", @@ -108,7 +129,7 @@ "hyprland-protocols": [ "hyprland-protocols" ], - "hyprlang": "hyprlang", + "hyprlang": "hyprlang_2", "nixpkgs": [ "nixpkgs" ], diff --git a/flake.nix b/flake.nix index 32509954..05ec30c7 100644 --- a/flake.nix +++ b/flake.nix @@ -22,6 +22,11 @@ inputs.systems.follows = "systems"; }; + hyprlang = { + url = "github:hyprwm/hyprlang"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + xdph = { url = "github:hyprwm/xdg-desktop-portal-hyprland"; inputs.nixpkgs.follows = "nixpkgs"; @@ -86,7 +91,7 @@ name = "hyprland-shell"; nativeBuildInputs = with pkgsFor.${system}; [cmake python3]; buildInputs = [self.packages.${system}.wlroots-hyprland]; - hardeningDisable = [ "fortify" ]; + hardeningDisable = ["fortify"]; inputsFrom = [ self.packages.${system}.wlroots-hyprland self.packages.${system}.hyprland diff --git a/nix/default.nix b/nix/default.nix index 751457ca..6062a215 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -9,6 +9,7 @@ cairo, git, hyprland-protocols, + hyprlang, jq, libGL, libdrm, @@ -75,6 +76,7 @@ assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been remov cairo git hyprland-protocols + hyprlang libdrm libGL libinput diff --git a/nix/overlays.nix b/nix/overlays.nix index afdde162..3eedd84c 100644 --- a/nix/overlays.nix +++ b/nix/overlays.nix @@ -22,6 +22,7 @@ in { hyprland-packages = lib.composeManyExtensions [ # Dependencies inputs.hyprland-protocols.overlays.default + inputs.hyprlang.overlays.default self.overlays.wlroots-hyprland self.overlays.udis86 # Hyprland packages themselves diff --git a/nix/patches/meson-build.patch b/nix/patches/meson-build.patch index 844eacae..5911657e 100644 --- a/nix/patches/meson-build.patch +++ b/nix/patches/meson-build.patch @@ -34,16 +34,17 @@ index 1d2c7f9f..c5ef4e67 100644 headers = globber.stdout().strip().split('\n') foreach file : headers diff --git a/src/meson.build b/src/meson.build -index 0af864b9..38723b8c 100644 +index 45701f5f..3505cefe 100644 --- a/src/meson.build +++ b/src/meson.build -@@ -9,16 +9,16 @@ executable('Hyprland', src, +@@ -9,17 +9,17 @@ executable('Hyprland', src, server_protos, dependency('wayland-server'), dependency('wayland-client'), - wlroots.get_variable('wlroots'), + dependency('wlroots'), dependency('cairo'), + dependency('hyprlang', version: '>= 0.2.1'), dependency('libdrm'), dependency('egl'), dependency('xkbcommon'), diff --git a/src/meson.build b/src/meson.build index 0af864b9..2977a69d 100644 --- a/src/meson.build +++ b/src/meson.build @@ -11,6 +11,7 @@ executable('Hyprland', src, dependency('wayland-client'), wlroots.get_variable('wlroots'), dependency('cairo'), + dependency('hyprlang', version: '>= 0.2.1'), dependency('libdrm'), dependency('egl'), dependency('xkbcommon'),