Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 35 additions & 27 deletions pkgs/applications/window-managers/hyprwm/hyprland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,29 @@
, ninja
, binutils
, cairo
, epoll-shim
, git
, hyprcursor
, hyprland-protocols
, hyprlang
, hyprwayland-scanner
, jq
, libGL
, libdrm
, libexecinfo
, libinput
, libxcb
, libuuid
, libxkbcommon
, mesa
, pango
, pciutils
, pkgconf
, python3
, systemd
, tomlplusplus
, wayland
, wayland-protocols
, wayland-scanner
, xcbutilwm
, xwayland
, hwdata
, seatd
Expand All @@ -51,45 +53,44 @@ assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been remov

stdenv.mkDerivation (finalAttrs: {
pname = "hyprland" + lib.optionalString debug "-debug";
version = "0.39.1";
version = "0.40.0-unstable-2024-05-12";

src = fetchFromGitHub {
owner = "hyprwm";
repo = finalAttrs.pname;
fetchSubmodules = true;
rev = "v${finalAttrs.version}";
hash = "sha256-7L5rqQRYH2iyyP5g3IdXJSlATfgnKhuYMf65E48MVKw=";
rev = "2ccd45a84475fab46c6fecd2fe226d3173104743";
hash = "sha256-nBCQuRl4sS/G/OUS+txeelFShBEgSk2OrN6kBYMHuOg=";
};

postPatch = ''
# Fix hardcoded paths to /usr installation
sed -i "s#/usr#$out#" src/render/OpenGL.cpp

# Generate version.h
cp src/version.h.in src/version.h
substituteInPlace src/version.h \
--replace-fail "@HASH@" '${finalAttrs.src.rev}' \
--replace-fail "@BRANCH@" "" \
--replace-fail "@MESSAGE@" "" \
--replace-fail "@DATE@" "2024-04-16" \
--replace-fail "@TAG@" "" \
--replace-fail "@DIRTY@" ""
# Remove extra @PREFIX@ to fix pkg-config paths
sed -i "s#@PREFIX@/##g" hyprland.pc.in
'';

# used by version.sh
DATE = "2024-05-12";
HASH = finalAttrs.src.rev;

depsBuildBuild = [
# to find wayland-scanner when cross-compiling
pkg-config
];

nativeBuildInputs = [
hwdata
hyprwayland-scanner
jq
makeWrapper
meson
cmake
meson # for wlroots
ninja
pkg-config
wayland-scanner
cmake # for subproject udis86
python3
python3 # for udis86
];

outputs = [
Expand All @@ -107,6 +108,7 @@ stdenv.mkDerivation (finalAttrs: {
libGL
libdrm
libinput
libuuid
libxkbcommon
mesa
wayland
Expand All @@ -121,27 +123,33 @@ stdenv.mkDerivation (finalAttrs: {
xorg.xcbutilerrors
xorg.xcbutilrenderutil
]
++ lib.optionals stdenv.hostPlatform.isBSD [ epoll-shim ]
++ lib.optionals stdenv.hostPlatform.isMusl [ libexecinfo ]
++ lib.optionals enableXWayland [ libxcb xcbutilwm xwayland ]
++ lib.optionals enableXWayland [
xorg.libxcb
xorg.libXdmcp
xorg.xcbutil
xorg.xcbutilwm
xwayland
]
++ lib.optionals withSystemd [ systemd ];

mesonBuildType =
cmakeBuildType =
if debug
then "debug"
else "release";
then "Debug"
else "RelWithDebInfo";

mesonAutoFeatures = "enabled";

mesonFlags = [
(lib.mesonEnable "xwayland" enableXWayland)
(lib.mesonEnable "legacy_renderer" legacyRenderer)
(lib.mesonEnable "systemd" withSystemd)
cmakeFlags = [
(lib.cmakeBool "NO_XWAYLAND" (!enableXWayland))
(lib.cmakeBool "LEGACY_RENDERER" legacyRenderer)
(lib.cmakeBool "NO_SYSTEMD" (!withSystemd))
];

postInstall = ''
${lib.optionalString wrapRuntimeDeps ''
wrapProgram $out/bin/Hyprland \
--suffix PATH : ${lib.makeBinPath [binutils pciutils stdenv.cc]}
--suffix PATH : ${lib.makeBinPath [binutils pciutils pkgconf]}
''}
'';

Expand Down
39 changes: 39 additions & 0 deletions pkgs/by-name/hy/hyprwayland-scanner/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, pkg-config
, pugixml
,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "hyprwayland-scanner";
version = "0.3.7";

src = fetchFromGitHub {
owner = "hyprwm";
repo = "hyprwayland-scanner";
rev = "v${finalAttrs.version}";
hash = "sha256-BPc9FdIzQAmP1JnYGfr+3O30Yp1BywUvKUz57ZOZ39A=";
};

nativeBuildInputs = [
cmake
pkg-config
];

buildInputs = [
pugixml
];

doCheck = true;

meta = with lib; {
homepage = "https://github.com/hyprwm/hyprwayland-scanner";
description = "A Hyprland version of wayland-scanner in and for C++";
license = licenses.bsd3;
maintainers = with maintainers; [ fufexan ];
mainProgram = "hyprwayland-scanner";
platforms = platforms.linux;
};
})