aboutsummaryrefslogtreecommitdiffhomepage
path: root/nix
diff options
context:
space:
mode:
authorAndrĂ© Silva <[email protected]>2023-11-30 11:40:14 +0000
committerGitHub <[email protected]>2023-11-30 11:40:14 +0000
commit29970228c5f71f417b0a3e1b4851d9430ed095dd (patch)
treecccb3a446d69ca4c46979c19b369b9a4c87be5ab /nix
parent12ec549a183abd59779a294c2f5bca0e95e528c0 (diff)
downloadHyprland-29970228c5f71f417b0a3e1b4851d9430ed095dd.tar.gz
Hyprland-29970228c5f71f417b0a3e1b4851d9430ed095dd.zip
nix: override libdrm to use newer version (#4003)
Diffstat (limited to 'nix')
-rw-r--r--nix/default.nix13
-rw-r--r--nix/wlroots.nix15
2 files changed, 26 insertions, 2 deletions
diff --git a/nix/default.nix b/nix/default.nix
index 42808a5f..7ddeae94 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -1,5 +1,6 @@
{
lib,
+ fetchurl,
stdenv,
pkg-config,
makeWrapper,
@@ -38,6 +39,16 @@
nvidiaPatches ? false,
hidpiXWayland ? false,
}:
+let
+ # NOTE: remove after https://github.com/NixOS/nixpkgs/pull/271096 reaches nixos-unstable
+ libdrm_2_4_118 = libdrm.overrideAttrs(attrs: rec {
+ version = "2.4.118";
+ src = fetchurl {
+ url = "https://dri.freedesktop.org/${attrs.pname}/${attrs.pname}-${version}.tar.xz";
+ hash = "sha256-p3e9hfK1/JxX+IbIIFgwBXgxfK/bx30Kdp1+mpVnq4g=";
+ };
+ });
+in
assert lib.assertMsg (!nvidiaPatches) "The option `nvidiaPatches` has been removed.";
assert lib.assertMsg (!enableNvidiaPatches) "The option `enableNvidiaPatches` has been removed.";
assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been removed. Please refer https://wiki.hyprland.org/Configuring/XWayland";
@@ -74,7 +85,7 @@ assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been remov
cairo
hyprland-protocols
libGL
- libdrm
+ libdrm_2_4_118
libinput
libxkbcommon
mesa
diff --git a/nix/wlroots.nix b/nix/wlroots.nix
index f48ba35c..0b9186e9 100644
--- a/nix/wlroots.nix
+++ b/nix/wlroots.nix
@@ -1,18 +1,31 @@
{
+ fetchurl,
version,
src,
wlroots,
hwdata,
libdisplay-info,
libliftoff,
+ libdrm,
enableXWayland ? true,
}:
+let
+ # NOTE: remove after https://github.com/NixOS/nixpkgs/pull/271096 reaches nixos-unstable
+ libdrm_2_4_118 = libdrm.overrideAttrs(old: rec {
+ version = "2.4.118";
+ src = fetchurl {
+ url = "https://dri.freedesktop.org/${old.pname}/${old.pname}-${version}.tar.xz";
+ hash = "sha256-p3e9hfK1/JxX+IbIIFgwBXgxfK/bx30Kdp1+mpVnq4g=";
+ };
+ });
+in
wlroots.overrideAttrs (old: {
inherit version src enableXWayland;
pname = "${old.pname}-hyprland";
- buildInputs = old.buildInputs ++ [hwdata libliftoff libdisplay-info];
+ # HACK: libdrm_2_4_118 is placed at the head of list to take precedence over libdrm in `old.buildInputs`
+ buildInputs = [libdrm_2_4_118] ++ old.buildInputs ++ [hwdata libliftoff libdisplay-info];
NIX_CFLAGS_COMPILE = toString [
"-Wno-error=maybe-uninitialized"