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