2022-05-17 13:11:24 +02:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
pkg-config,
|
2023-05-16 22:39:14 +02:00
|
|
|
makeWrapper,
|
2022-06-16 12:42:31 +02:00
|
|
|
meson,
|
2022-05-17 13:11:24 +02:00
|
|
|
ninja,
|
2023-05-16 22:39:14 +02:00
|
|
|
binutils,
|
2022-12-19 13:13:07 +01:00
|
|
|
cairo,
|
2022-07-29 12:21:19 +02:00
|
|
|
git,
|
2022-12-05 18:05:15 +01:00
|
|
|
hyprland-protocols,
|
2023-01-06 15:31:57 +01:00
|
|
|
jq,
|
2023-11-17 13:24:43 +01:00
|
|
|
libGL,
|
2022-05-17 13:11:24 +02:00
|
|
|
libdrm,
|
|
|
|
libinput,
|
|
|
|
libxcb,
|
|
|
|
libxkbcommon,
|
|
|
|
mesa,
|
2023-03-20 17:22:34 +01:00
|
|
|
pango,
|
2022-11-11 13:35:28 +01:00
|
|
|
pciutils,
|
2023-01-05 20:17:55 +01:00
|
|
|
systemd,
|
2023-02-27 13:32:38 +01:00
|
|
|
udis86,
|
2022-05-17 13:11:24 +02:00
|
|
|
wayland,
|
|
|
|
wayland-protocols,
|
|
|
|
wayland-scanner,
|
|
|
|
wlroots,
|
|
|
|
xcbutilwm,
|
|
|
|
xwayland,
|
2022-07-27 13:57:27 +02:00
|
|
|
debug ? false,
|
2022-05-17 13:11:24 +02:00
|
|
|
enableXWayland ? true,
|
2022-07-27 13:57:27 +02:00
|
|
|
legacyRenderer ? false,
|
2023-07-27 11:11:13 +02:00
|
|
|
withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
|
2023-05-16 22:39:14 +02:00
|
|
|
wrapRuntimeDeps ? true,
|
2022-05-17 13:11:24 +02:00
|
|
|
version ? "git",
|
2023-03-04 16:34:15 +01:00
|
|
|
commit,
|
2023-08-01 23:49:30 +02:00
|
|
|
# deprecated flags
|
2023-11-26 03:58:57 +01:00
|
|
|
enableNvidiaPatches ? false,
|
2023-08-01 23:49:30 +02:00
|
|
|
nvidiaPatches ? false,
|
|
|
|
hidpiXWayland ? false,
|
2023-08-01 22:58:01 +02:00
|
|
|
}:
|
2023-11-26 03:58:57 +01:00
|
|
|
assert lib.assertMsg (!nvidiaPatches) "The option `nvidiaPatches` has been removed.";
|
|
|
|
assert lib.assertMsg (!enableNvidiaPatches) "The option `enableNvidiaPatches` has been removed.";
|
2023-08-01 23:49:30 +02:00
|
|
|
assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been removed. Please refer https://wiki.hyprland.org/Configuring/XWayland";
|
2023-09-07 10:20:08 +02:00
|
|
|
stdenv.mkDerivation {
|
2023-11-26 03:58:57 +01:00
|
|
|
pname = "hyprland${lib.optionalString debug "-debug"}";
|
2023-08-01 23:49:30 +02:00
|
|
|
inherit version;
|
2022-08-12 22:12:24 +02:00
|
|
|
|
2023-08-01 23:49:30 +02:00
|
|
|
src = lib.cleanSourceWith {
|
|
|
|
filter = name: type: let
|
|
|
|
baseName = baseNameOf (toString name);
|
|
|
|
in
|
|
|
|
! (lib.hasSuffix ".nix" baseName);
|
|
|
|
src = lib.cleanSource ../.;
|
|
|
|
};
|
2022-05-08 18:27:40 +02:00
|
|
|
|
2023-08-01 23:49:30 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
jq
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
makeWrapper
|
|
|
|
wayland-scanner
|
|
|
|
];
|
2022-05-08 18:27:40 +02:00
|
|
|
|
2023-08-01 23:49:30 +02:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"man"
|
|
|
|
"dev"
|
|
|
|
];
|
2022-08-21 17:58:03 +02:00
|
|
|
|
2023-08-01 23:49:30 +02:00
|
|
|
buildInputs =
|
|
|
|
[
|
|
|
|
git
|
|
|
|
cairo
|
|
|
|
hyprland-protocols
|
2023-11-17 13:24:43 +01:00
|
|
|
libGL
|
2023-08-01 23:49:30 +02:00
|
|
|
libdrm
|
|
|
|
libinput
|
|
|
|
libxkbcommon
|
|
|
|
mesa
|
|
|
|
pango
|
|
|
|
udis86
|
|
|
|
wayland
|
|
|
|
wayland-protocols
|
|
|
|
pciutils
|
2023-11-26 03:58:57 +01:00
|
|
|
wlroots
|
2023-08-01 23:49:30 +02:00
|
|
|
]
|
|
|
|
++ lib.optionals enableXWayland [libxcb xcbutilwm xwayland]
|
|
|
|
++ lib.optionals withSystemd [systemd];
|
2022-05-17 13:11:24 +02:00
|
|
|
|
2023-08-01 23:49:30 +02:00
|
|
|
mesonBuildType =
|
|
|
|
if debug
|
|
|
|
then "debug"
|
|
|
|
else "release";
|
2022-05-08 18:27:40 +02:00
|
|
|
|
2023-10-30 19:27:38 +01:00
|
|
|
mesonAutoFeatures = "disabled";
|
|
|
|
|
2023-08-01 23:49:30 +02:00
|
|
|
mesonFlags = builtins.concatLists [
|
|
|
|
(lib.optional enableXWayland "-Dxwayland=enabled")
|
|
|
|
(lib.optional legacyRenderer "-Dlegacy_renderer=enabled")
|
|
|
|
(lib.optional withSystemd "-Dsystemd=enabled")
|
|
|
|
];
|
2022-05-08 20:18:13 +02:00
|
|
|
|
2023-08-01 23:49:30 +02:00
|
|
|
patches = [
|
|
|
|
# make meson use the provided wlroots instead of the git submodule
|
|
|
|
./patches/meson-build.patch
|
|
|
|
];
|
2022-05-08 18:27:40 +02:00
|
|
|
|
2023-08-01 23:49:30 +02:00
|
|
|
postPatch = ''
|
|
|
|
# Fix hardcoded paths to /usr installation
|
|
|
|
sed -i "s#/usr#$out#" src/render/OpenGL.cpp
|
2023-10-10 21:21:57 +02:00
|
|
|
|
|
|
|
# Generate version.h
|
|
|
|
cp src/version.h.in src/version.h
|
|
|
|
substituteInPlace src/version.h \
|
|
|
|
--replace "@HASH@" '${commit}' \
|
|
|
|
--replace "@BRANCH@" "" \
|
|
|
|
--replace "@MESSAGE@" "" \
|
|
|
|
--replace "@TAG@" "" \
|
|
|
|
--replace "@DIRTY@" '${
|
2023-08-01 23:49:30 +02:00
|
|
|
if commit == ""
|
|
|
|
then "dirty"
|
|
|
|
else ""
|
|
|
|
}'
|
|
|
|
'';
|
2022-07-08 16:46:42 +02:00
|
|
|
|
2023-08-01 23:49:30 +02:00
|
|
|
postInstall = ''
|
|
|
|
ln -s ${wlroots}/include/wlr $dev/include/hyprland/wlroots
|
|
|
|
${lib.optionalString wrapRuntimeDeps ''
|
|
|
|
wrapProgram $out/bin/Hyprland \
|
|
|
|
--suffix PATH : ${lib.makeBinPath [binutils pciutils]}
|
|
|
|
''}
|
|
|
|
'';
|
2023-05-16 19:50:18 +02:00
|
|
|
|
2023-08-01 23:49:30 +02:00
|
|
|
passthru.providedSessions = ["hyprland"];
|
2022-05-16 12:33:00 +02:00
|
|
|
|
2023-08-01 23:49:30 +02:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/vaxerski/Hyprland";
|
|
|
|
description = "A dynamic tiling Wayland compositor that doesn't sacrifice on its looks";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
mainProgram = "Hyprland";
|
|
|
|
};
|
|
|
|
}
|