2022-10-21 18:38:19 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2023-03-24 00:07:29 +00:00
|
|
|
, pkg-config
|
2023-08-22 20:05:09 +00:00
|
|
|
, makeWrapper
|
2023-03-24 00:07:29 +00:00
|
|
|
, meson
|
2024-05-15 15:35:15 +00:00
|
|
|
, cmake
|
2023-03-24 00:07:29 +00:00
|
|
|
, ninja
|
2023-08-22 20:05:09 +00:00
|
|
|
, binutils
|
2023-03-24 00:07:29 +00:00
|
|
|
, cairo
|
|
|
|
, git
|
2024-04-21 15:54:59 +00:00
|
|
|
, hyprcursor
|
2023-03-24 00:07:29 +00:00
|
|
|
, hyprland-protocols
|
2024-04-21 15:54:59 +00:00
|
|
|
, hyprlang
|
2023-03-24 00:07:29 +00:00
|
|
|
, jq
|
2023-11-16 04:20:00 +00:00
|
|
|
, libGL
|
2022-10-21 18:38:19 +00:00
|
|
|
, libdrm
|
2023-10-09 19:29:22 +00:00
|
|
|
, libexecinfo
|
2022-10-21 18:38:19 +00:00
|
|
|
, libinput
|
|
|
|
, libxcb
|
|
|
|
, libxkbcommon
|
|
|
|
, mesa
|
2023-04-12 12:48:02 +00:00
|
|
|
, pango
|
2023-03-24 00:07:29 +00:00
|
|
|
, pciutils
|
2024-05-15 15:35:15 +00:00
|
|
|
, python3
|
2023-03-24 00:07:29 +00:00
|
|
|
, systemd
|
2024-01-13 08:15:51 +00:00
|
|
|
, tomlplusplus
|
2022-10-21 18:38:19 +00:00
|
|
|
, wayland
|
|
|
|
, wayland-protocols
|
|
|
|
, wayland-scanner
|
|
|
|
, xcbutilwm
|
2023-03-24 00:07:29 +00:00
|
|
|
, xwayland
|
2024-05-15 15:35:15 +00:00
|
|
|
, hwdata
|
|
|
|
, seatd
|
|
|
|
, libdisplay-info
|
|
|
|
, libliftoff
|
|
|
|
, xorg
|
2023-03-24 00:07:29 +00:00
|
|
|
, debug ? false
|
|
|
|
, enableXWayland ? true
|
|
|
|
, legacyRenderer ? false
|
2024-04-21 15:54:59 +00:00
|
|
|
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
|
2023-08-22 20:05:09 +00:00
|
|
|
, wrapRuntimeDeps ? true
|
|
|
|
# deprecated flags
|
|
|
|
, nvidiaPatches ? false
|
|
|
|
, hidpiXWayland ? false
|
2024-01-02 11:29:13 +00:00
|
|
|
, enableNvidiaPatches ? false
|
2022-10-21 18:38:19 +00:00
|
|
|
}:
|
2024-01-02 11:29:13 +00:00
|
|
|
assert lib.assertMsg (!nvidiaPatches) "The option `nvidiaPatches` has been removed.";
|
|
|
|
assert lib.assertMsg (!enableNvidiaPatches) "The option `enableNvidiaPatches` has been removed.";
|
2023-08-22 20:05:09 +00:00
|
|
|
assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been removed. Please refer https://wiki.hyprland.org/Configuring/XWayland";
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2023-03-24 00:07:29 +00:00
|
|
|
pname = "hyprland" + lib.optionalString debug "-debug";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.39.1";
|
2022-10-21 18:38:19 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hyprwm";
|
2023-05-24 13:37:59 +00:00
|
|
|
repo = finalAttrs.pname;
|
2024-05-15 15:35:15 +00:00
|
|
|
fetchSubmodules = true;
|
2023-10-09 19:29:22 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-7L5rqQRYH2iyyP5g3IdXJSlATfgnKhuYMf65E48MVKw=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Fix hardcoded paths to /usr installation
|
|
|
|
sed -i "s#/usr#$out#" src/render/OpenGL.cpp
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
# Generate version.h
|
|
|
|
cp src/version.h.in src/version.h
|
|
|
|
substituteInPlace src/version.h \
|
2024-05-15 15:35:15 +00:00
|
|
|
--replace-fail "@HASH@" '${finalAttrs.src.rev}' \
|
|
|
|
--replace-fail "@BRANCH@" "" \
|
|
|
|
--replace-fail "@MESSAGE@" "" \
|
|
|
|
--replace-fail "@DATE@" "2024-04-16" \
|
|
|
|
--replace-fail "@TAG@" "" \
|
|
|
|
--replace-fail "@DIRTY@" ""
|
2023-03-24 00:07:29 +00:00
|
|
|
'';
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
depsBuildBuild = [
|
|
|
|
# to find wayland-scanner when cross-compiling
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
nativeBuildInputs = [
|
2024-05-15 15:35:15 +00:00
|
|
|
hwdata
|
2023-03-24 00:07:29 +00:00
|
|
|
jq
|
2023-08-22 20:05:09 +00:00
|
|
|
makeWrapper
|
2023-03-24 00:07:29 +00:00
|
|
|
meson
|
|
|
|
ninja
|
2022-10-21 18:38:19 +00:00
|
|
|
pkg-config
|
2023-04-12 12:48:02 +00:00
|
|
|
wayland-scanner
|
2024-05-15 15:35:15 +00:00
|
|
|
cmake # for subproject udis86
|
|
|
|
python3
|
2022-10-21 18:38:19 +00:00
|
|
|
];
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"man"
|
2023-05-24 13:37:59 +00:00
|
|
|
"dev"
|
2022-10-21 18:38:19 +00:00
|
|
|
];
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
buildInputs = [
|
|
|
|
cairo
|
|
|
|
git
|
|
|
|
hyprcursor
|
|
|
|
hyprland-protocols
|
|
|
|
hyprlang
|
|
|
|
libGL
|
|
|
|
libdrm
|
|
|
|
libinput
|
|
|
|
libxkbcommon
|
|
|
|
mesa
|
|
|
|
wayland
|
|
|
|
wayland-protocols
|
|
|
|
pango
|
|
|
|
pciutils
|
|
|
|
tomlplusplus
|
|
|
|
# for subproject wlroots-hyprland
|
|
|
|
seatd
|
|
|
|
libliftoff
|
|
|
|
libdisplay-info
|
|
|
|
xorg.xcbutilerrors
|
|
|
|
xorg.xcbutilrenderutil
|
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.hostPlatform.isMusl [ libexecinfo ]
|
|
|
|
++ lib.optionals enableXWayland [ libxcb xcbutilwm xwayland ]
|
|
|
|
++ lib.optionals withSystemd [ systemd ];
|
2022-10-21 18:38:19 +00:00
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
mesonBuildType =
|
|
|
|
if debug
|
|
|
|
then "debug"
|
|
|
|
else "release";
|
2022-10-21 18:38:19 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
mesonAutoFeatures = "enabled";
|
2024-02-29 20:09:43 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
mesonFlags = [
|
|
|
|
(lib.mesonEnable "xwayland" enableXWayland)
|
|
|
|
(lib.mesonEnable "legacy_renderer" legacyRenderer)
|
|
|
|
(lib.mesonEnable "systemd" withSystemd)
|
2023-03-24 00:07:29 +00:00
|
|
|
];
|
2022-10-21 18:38:19 +00:00
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
postInstall = ''
|
|
|
|
${lib.optionalString wrapRuntimeDeps ''
|
|
|
|
wrapProgram $out/bin/Hyprland \
|
2024-02-29 20:09:43 +00:00
|
|
|
--suffix PATH : ${lib.makeBinPath [binutils pciutils stdenv.cc]}
|
2023-08-22 20:05:09 +00:00
|
|
|
''}
|
|
|
|
'';
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
passthru.providedSessions = [ "hyprland" ];
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-04-21 15:54:59 +00:00
|
|
|
homepage = "https://github.com/hyprwm/Hyprland";
|
2022-10-21 18:38:19 +00:00
|
|
|
description = "A dynamic tiling Wayland compositor that doesn't sacrifice on its looks";
|
|
|
|
license = licenses.bsd3;
|
2023-03-24 00:07:29 +00:00
|
|
|
maintainers = with maintainers; [ wozeparrot fufexan ];
|
2022-10-21 18:38:19 +00:00
|
|
|
mainProgram = "Hyprland";
|
2024-05-15 15:35:15 +00:00
|
|
|
platforms = lib.platforms.linux;
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
2023-05-24 13:37:59 +00:00
|
|
|
})
|