Nix: tidy up derivation

This commit is contained in:
Mihai Fufezan 2024-06-17 13:03:59 +03:00
parent b15be9c77d
commit 9cb3bf1cac
Signed by: fufexan
SSH key fingerprint: SHA256:SdnKmEpJrDu1+2UO1QpB/Eg4HKcdDi6n+xSRqFNJVpg

View file

@ -11,6 +11,7 @@
expat, expat,
fribidi, fribidi,
git, git,
hwdata,
hyprcursor, hyprcursor,
hyprlang, hyprlang,
hyprutils, hyprutils,
@ -18,26 +19,28 @@
jq, jq,
libGL, libGL,
libdatrie, libdatrie,
libdisplay-info,
libdrm, libdrm,
libexecinfo, libexecinfo,
libinput, libinput,
libliftoff,
libselinux, libselinux,
libsepol, libsepol,
libthai, libthai,
libuuid, libuuid,
libxkbcommon, libxkbcommon,
mesa, mesa,
meson,
pango, pango,
pciutils, pciutils,
pcre2, pcre2,
python3, python3,
seatd,
systemd, systemd,
tomlplusplus, tomlplusplus,
udis86,
wayland, wayland,
wayland-protocols, wayland-protocols,
wayland-scanner, wayland-scanner,
wlroots,
xorg, xorg,
xwayland, xwayland,
debug ? false, debug ? false,
@ -76,23 +79,21 @@ assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been remov
sed -i "s#@PREFIX@/##g" hyprland.pc.in sed -i "s#@PREFIX@/##g" hyprland.pc.in
''; '';
COMMITS = commit;
DATE = date; DATE = date;
DIRTY = lib.optionalString (commit == "") "dirty";
HASH = commit; HASH = commit;
DIRTY = if commit == "" then "dirty" else "";
nativeBuildInputs = lib.concatLists [ nativeBuildInputs = [
[ hyprwayland-scanner
hyprwayland-scanner jq
jq makeWrapper
makeWrapper cmake
cmake meson # for wlroots
ninja ninja
pkg-config pkg-config
python3 python3 # for udis86
wayland-scanner wayland-scanner
]
# introduce this later so that cmake takes precedence
wlroots.nativeBuildInputs
]; ];
outputs = [ outputs = [
@ -102,14 +103,13 @@ assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been remov
]; ];
buildInputs = lib.concatLists [ buildInputs = lib.concatLists [
wlroots.buildInputs
udis86.buildInputs
[ [
cairo cairo
expat expat
fribidi fribidi
git git
hyprcursor.dev hwdata
hyprcursor
hyprlang hyprlang
hyprutils hyprutils
libGL libGL
@ -128,12 +128,18 @@ assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been remov
tomlplusplus tomlplusplus
wayland wayland
wayland-protocols wayland-protocols
# for wlroots
seatd
libdisplay-info
libliftoff
] ]
(lib.optionals stdenv.hostPlatform.isMusl [libexecinfo]) (lib.optionals stdenv.hostPlatform.isMusl [libexecinfo])
(lib.optionals enableXWayland [ (lib.optionals enableXWayland [
xorg.libxcb xorg.libxcb
xorg.libXdmcp xorg.libXdmcp
xorg.xcbutil xorg.xcbutil
xorg.xcbutilerrors
xorg.xcbutilrenderutil
xorg.xcbutilwm xorg.xcbutilwm
xwayland xwayland
]) ])
@ -145,6 +151,9 @@ assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been remov
then "Debug" then "Debug"
else "RelWithDebInfo"; else "RelWithDebInfo";
# we want as much debug info as possible
dontStrip = true;
cmakeFlags = [ cmakeFlags = [
(lib.cmakeBool "NO_XWAYLAND" (!enableXWayland)) (lib.cmakeBool "NO_XWAYLAND" (!enableXWayland))
(lib.cmakeBool "LEGACY_RENDERER" legacyRenderer) (lib.cmakeBool "LEGACY_RENDERER" legacyRenderer)
@ -164,11 +173,11 @@ assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been remov
passthru.providedSessions = ["hyprland"]; passthru.providedSessions = ["hyprland"];
meta = with lib; { meta = {
homepage = "https://github.com/hyprwm/Hyprland"; homepage = "https://github.com/hyprwm/Hyprland";
description = "A dynamic tiling Wayland compositor that doesn't sacrifice on its looks"; description = "Dynamic tiling Wayland compositor that doesn't sacrifice on its looks";
license = licenses.bsd3; license = lib.licenses.bsd3;
platforms = wlroots.meta.platforms; platforms = lib.platforms.linux;
mainProgram = "Hyprland"; mainProgram = "Hyprland";
}; };
} }