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,
|
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,
|
2023-03-22 16:21:17 +01:00
|
|
|
hidpiXWayland ? false,
|
2022-07-27 13:57:27 +02:00
|
|
|
legacyRenderer ? false,
|
2022-09-01 19:35:50 +02:00
|
|
|
nvidiaPatches ? 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,
|
2022-08-29 15:51:39 +02:00
|
|
|
}: let
|
|
|
|
assertXWayland = lib.assertMsg (hidpiXWayland -> enableXWayland) ''
|
|
|
|
Hyprland: cannot have hidpiXWayland when enableXWayland is false.
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
assert assertXWayland;
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "hyprland" + lib.optionalString debug "-debug";
|
|
|
|
inherit version;
|
2022-08-12 22:12:24 +02:00
|
|
|
|
2022-08-29 15:51:39 +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
|
|
|
|
2022-08-29 15:51:39 +02:00
|
|
|
nativeBuildInputs = [
|
2023-01-06 15:31:57 +01:00
|
|
|
jq
|
2022-08-29 15:51:39 +02:00
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
2023-05-16 22:39:14 +02:00
|
|
|
makeWrapper
|
2023-07-29 15:31:01 +02:00
|
|
|
wayland-scanner
|
2022-08-29 15:51:39 +02:00
|
|
|
];
|
2022-05-08 18:27:40 +02:00
|
|
|
|
2022-08-29 15:51:39 +02:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"man"
|
2023-04-26 23:59:16 +02:00
|
|
|
"dev"
|
2022-08-29 15:51:39 +02:00
|
|
|
];
|
2022-08-21 17:58:03 +02:00
|
|
|
|
2022-08-29 15:51:39 +02:00
|
|
|
buildInputs =
|
|
|
|
[
|
|
|
|
git
|
2022-12-19 13:13:07 +01:00
|
|
|
cairo
|
2023-01-07 19:25:20 +01:00
|
|
|
hyprland-protocols
|
2022-08-29 15:51:39 +02:00
|
|
|
libdrm
|
|
|
|
libinput
|
|
|
|
libxkbcommon
|
|
|
|
mesa
|
2023-03-20 17:22:34 +01:00
|
|
|
pango
|
2023-02-27 13:32:38 +01:00
|
|
|
udis86
|
2022-08-29 15:51:39 +02:00
|
|
|
wayland
|
|
|
|
wayland-protocols
|
2022-11-11 13:35:28 +01:00
|
|
|
pciutils
|
2022-09-01 19:35:50 +02:00
|
|
|
(wlroots.override {inherit enableXWayland hidpiXWayland nvidiaPatches;})
|
2022-08-29 15:51:39 +02:00
|
|
|
]
|
2023-01-05 20:17:55 +01:00
|
|
|
++ lib.optionals enableXWayland [libxcb xcbutilwm xwayland]
|
|
|
|
++ lib.optionals withSystemd [systemd];
|
2022-05-17 13:11:24 +02:00
|
|
|
|
2022-08-29 15:51:39 +02:00
|
|
|
mesonBuildType =
|
|
|
|
if debug
|
|
|
|
then "debug"
|
|
|
|
else "release";
|
2022-05-08 18:27:40 +02:00
|
|
|
|
2022-08-29 15:51:39 +02:00
|
|
|
mesonFlags = builtins.concatLists [
|
2023-03-27 06:10:42 +02:00
|
|
|
["-Dauto_features=disabled"]
|
|
|
|
(lib.optional enableXWayland "-Dxwayland=enabled")
|
|
|
|
(lib.optional legacyRenderer "-Dlegacy_renderer=enabled")
|
2023-01-05 20:17:55 +01:00
|
|
|
(lib.optional withSystemd "-Dsystemd=enabled")
|
2022-08-29 15:51:39 +02:00
|
|
|
];
|
2022-05-08 20:18:13 +02:00
|
|
|
|
2022-08-29 15:51:39 +02:00
|
|
|
patches = [
|
|
|
|
# make meson use the provided wlroots instead of the git submodule
|
2023-07-19 18:02:30 +02:00
|
|
|
./patches/meson-build.patch
|
2023-06-26 23:51:04 +02:00
|
|
|
# fixes portals search path to be picked up from $XDG_DESKTOP_PORTAL_DIR
|
2023-07-19 18:02:30 +02:00
|
|
|
./patches/portals.patch
|
2022-08-29 15:51:39 +02:00
|
|
|
];
|
2022-05-08 18:27:40 +02:00
|
|
|
|
2022-08-29 15:51:39 +02:00
|
|
|
postPatch = ''
|
2023-01-05 20:17:55 +01:00
|
|
|
# Fix hardcoded paths to /usr installation
|
2022-08-29 15:51:39 +02:00
|
|
|
sed -i "s#/usr#$out#" src/render/OpenGL.cpp
|
2023-03-04 16:34:15 +01:00
|
|
|
substituteInPlace meson.build \
|
|
|
|
--replace "@GIT_COMMIT_HASH@" '${commit}' \
|
2023-04-05 14:06:30 +02:00
|
|
|
--replace "@GIT_DIRTY@" '${
|
|
|
|
if commit == ""
|
|
|
|
then "dirty"
|
|
|
|
else ""
|
|
|
|
}'
|
2022-08-29 15:51:39 +02:00
|
|
|
'';
|
2022-07-08 16:46:42 +02:00
|
|
|
|
2023-05-16 19:50:18 +02:00
|
|
|
postInstall = ''
|
|
|
|
ln -s ${wlroots}/include/wlr $dev/include/hyprland/wlroots
|
2023-05-16 22:39:14 +02:00
|
|
|
${lib.optionalString wrapRuntimeDeps ''
|
|
|
|
wrapProgram $out/bin/Hyprland \
|
|
|
|
--suffix PATH : ${lib.makeBinPath [ binutils pciutils ]}
|
|
|
|
''}
|
2023-05-16 19:50:18 +02:00
|
|
|
'';
|
|
|
|
|
2022-08-29 15:51:39 +02:00
|
|
|
passthru.providedSessions = ["hyprland"];
|
2022-05-16 12:33:00 +02:00
|
|
|
|
2022-08-29 15:51:39 +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";
|
|
|
|
};
|
|
|
|
}
|