mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 16:05:58 +01:00
Nix: remove HiDPI patches
- remove `hidpiXWayland` option - rename `nvidiaPatches` -> `enableNvidiaPatches` for consistency
This commit is contained in:
parent
0314a727eb
commit
c1bcbdb3dd
4 changed files with 120 additions and 164 deletions
|
@ -65,9 +65,7 @@
|
||||||
hyprland
|
hyprland
|
||||||
hyprland-unwrapped
|
hyprland-unwrapped
|
||||||
hyprland-debug
|
hyprland-debug
|
||||||
hyprland-hidpi
|
|
||||||
hyprland-nvidia
|
hyprland-nvidia
|
||||||
hyprland-no-hidpi
|
|
||||||
# hyprland-extras
|
# hyprland-extras
|
||||||
xdg-desktop-portal-hyprland
|
xdg-desktop-portal-hyprland
|
||||||
hyprland-share-picker
|
hyprland-share-picker
|
||||||
|
|
194
nix/default.nix
194
nix/default.nix
|
@ -26,114 +26,106 @@
|
||||||
xcbutilwm,
|
xcbutilwm,
|
||||||
xwayland,
|
xwayland,
|
||||||
debug ? false,
|
debug ? false,
|
||||||
|
enableNvidiaPatches ? false,
|
||||||
enableXWayland ? true,
|
enableXWayland ? true,
|
||||||
hidpiXWayland ? false,
|
|
||||||
legacyRenderer ? false,
|
legacyRenderer ? false,
|
||||||
nvidiaPatches ? false,
|
|
||||||
withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
|
withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
|
||||||
wrapRuntimeDeps ? true,
|
wrapRuntimeDeps ? true,
|
||||||
version ? "git",
|
version ? "git",
|
||||||
commit,
|
commit,
|
||||||
}: let
|
}:
|
||||||
assertXWayland = lib.assertMsg (hidpiXWayland -> enableXWayland) ''
|
stdenv.mkDerivation {
|
||||||
Hyprland: cannot have hidpiXWayland when enableXWayland is false.
|
pname = "hyprland${lib.optionalString enableNvidiaPatches "-nvidia"}${lib.optionalString debug "-debug"}";
|
||||||
|
inherit version;
|
||||||
|
|
||||||
|
src = lib.cleanSourceWith {
|
||||||
|
filter = name: type: let
|
||||||
|
baseName = baseNameOf (toString name);
|
||||||
|
in
|
||||||
|
! (lib.hasSuffix ".nix" baseName);
|
||||||
|
src = lib.cleanSource ../.;
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
jq
|
||||||
|
meson
|
||||||
|
ninja
|
||||||
|
pkg-config
|
||||||
|
makeWrapper
|
||||||
|
wayland-scanner
|
||||||
|
];
|
||||||
|
|
||||||
|
outputs = [
|
||||||
|
"out"
|
||||||
|
"man"
|
||||||
|
"dev"
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs =
|
||||||
|
[
|
||||||
|
git
|
||||||
|
cairo
|
||||||
|
hyprland-protocols
|
||||||
|
libdrm
|
||||||
|
libinput
|
||||||
|
libxkbcommon
|
||||||
|
mesa
|
||||||
|
pango
|
||||||
|
udis86
|
||||||
|
wayland
|
||||||
|
wayland-protocols
|
||||||
|
pciutils
|
||||||
|
(wlroots.override {inherit enableNvidiaPatches;})
|
||||||
|
]
|
||||||
|
++ lib.optionals enableXWayland [libxcb xcbutilwm xwayland]
|
||||||
|
++ lib.optionals withSystemd [systemd];
|
||||||
|
|
||||||
|
mesonBuildType =
|
||||||
|
if debug
|
||||||
|
then "debug"
|
||||||
|
else "release";
|
||||||
|
|
||||||
|
mesonFlags = builtins.concatLists [
|
||||||
|
["-Dauto_features=disabled"]
|
||||||
|
(lib.optional enableXWayland "-Dxwayland=enabled")
|
||||||
|
(lib.optional legacyRenderer "-Dlegacy_renderer=enabled")
|
||||||
|
(lib.optional withSystemd "-Dsystemd=enabled")
|
||||||
|
];
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
# make meson use the provided wlroots instead of the git submodule
|
||||||
|
./patches/meson-build.patch
|
||||||
|
# fixes portals search path to be picked up from $XDG_DESKTOP_PORTAL_DIR
|
||||||
|
./patches/portals.patch
|
||||||
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
# Fix hardcoded paths to /usr installation
|
||||||
|
sed -i "s#/usr#$out#" src/render/OpenGL.cpp
|
||||||
|
substituteInPlace meson.build \
|
||||||
|
--replace "@GIT_COMMIT_HASH@" '${commit}' \
|
||||||
|
--replace "@GIT_DIRTY@" '${
|
||||||
|
if commit == ""
|
||||||
|
then "dirty"
|
||||||
|
else ""
|
||||||
|
}'
|
||||||
'';
|
'';
|
||||||
in
|
|
||||||
assert assertXWayland;
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
pname = "hyprland" + lib.optionalString debug "-debug";
|
|
||||||
inherit version;
|
|
||||||
|
|
||||||
src = lib.cleanSourceWith {
|
postInstall = ''
|
||||||
filter = name: type: let
|
ln -s ${wlroots}/include/wlr $dev/include/hyprland/wlroots
|
||||||
baseName = baseNameOf (toString name);
|
${lib.optionalString wrapRuntimeDeps ''
|
||||||
in
|
wrapProgram $out/bin/Hyprland \
|
||||||
! (
|
--suffix PATH : ${lib.makeBinPath [binutils pciutils]}
|
||||||
lib.hasSuffix ".nix" baseName
|
''}
|
||||||
);
|
'';
|
||||||
src = lib.cleanSource ../.;
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
passthru.providedSessions = ["hyprland"];
|
||||||
jq
|
|
||||||
meson
|
|
||||||
ninja
|
|
||||||
pkg-config
|
|
||||||
makeWrapper
|
|
||||||
wayland-scanner
|
|
||||||
];
|
|
||||||
|
|
||||||
outputs = [
|
meta = with lib; {
|
||||||
"out"
|
homepage = "https://github.com/vaxerski/Hyprland";
|
||||||
"man"
|
description = "A dynamic tiling Wayland compositor that doesn't sacrifice on its looks";
|
||||||
"dev"
|
license = licenses.bsd3;
|
||||||
];
|
platforms = platforms.linux;
|
||||||
|
mainProgram = "Hyprland";
|
||||||
buildInputs =
|
};
|
||||||
[
|
}
|
||||||
git
|
|
||||||
cairo
|
|
||||||
hyprland-protocols
|
|
||||||
libdrm
|
|
||||||
libinput
|
|
||||||
libxkbcommon
|
|
||||||
mesa
|
|
||||||
pango
|
|
||||||
udis86
|
|
||||||
wayland
|
|
||||||
wayland-protocols
|
|
||||||
pciutils
|
|
||||||
(wlroots.override {inherit enableXWayland hidpiXWayland nvidiaPatches;})
|
|
||||||
]
|
|
||||||
++ lib.optionals enableXWayland [libxcb xcbutilwm xwayland]
|
|
||||||
++ lib.optionals withSystemd [systemd];
|
|
||||||
|
|
||||||
mesonBuildType =
|
|
||||||
if debug
|
|
||||||
then "debug"
|
|
||||||
else "release";
|
|
||||||
|
|
||||||
mesonFlags = builtins.concatLists [
|
|
||||||
["-Dauto_features=disabled"]
|
|
||||||
(lib.optional enableXWayland "-Dxwayland=enabled")
|
|
||||||
(lib.optional legacyRenderer "-Dlegacy_renderer=enabled")
|
|
||||||
(lib.optional withSystemd "-Dsystemd=enabled")
|
|
||||||
];
|
|
||||||
|
|
||||||
patches = [
|
|
||||||
# make meson use the provided wlroots instead of the git submodule
|
|
||||||
./patches/meson-build.patch
|
|
||||||
# fixes portals search path to be picked up from $XDG_DESKTOP_PORTAL_DIR
|
|
||||||
./patches/portals.patch
|
|
||||||
];
|
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
# Fix hardcoded paths to /usr installation
|
|
||||||
sed -i "s#/usr#$out#" src/render/OpenGL.cpp
|
|
||||||
substituteInPlace meson.build \
|
|
||||||
--replace "@GIT_COMMIT_HASH@" '${commit}' \
|
|
||||||
--replace "@GIT_DIRTY@" '${
|
|
||||||
if commit == ""
|
|
||||||
then "dirty"
|
|
||||||
else ""
|
|
||||||
}'
|
|
||||||
'';
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
ln -s ${wlroots}/include/wlr $dev/include/hyprland/wlroots
|
|
||||||
${lib.optionalString wrapRuntimeDeps ''
|
|
||||||
wrapProgram $out/bin/Hyprland \
|
|
||||||
--suffix PATH : ${lib.makeBinPath [binutils pciutils]}
|
|
||||||
''}
|
|
||||||
'';
|
|
||||||
|
|
||||||
passthru.providedSessions = ["hyprland"];
|
|
||||||
|
|
||||||
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";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
|
@ -35,14 +35,14 @@ in {
|
||||||
commit = self.rev or "";
|
commit = self.rev or "";
|
||||||
inherit (final) udis86 hyprland-protocols;
|
inherit (final) udis86 hyprland-protocols;
|
||||||
};
|
};
|
||||||
|
|
||||||
hyprland-unwrapped = final.hyprland.override {wrapRuntimeDeps = false;};
|
hyprland-unwrapped = final.hyprland.override {wrapRuntimeDeps = false;};
|
||||||
hyprland-debug = final.hyprland.override {debug = true;};
|
hyprland-debug = final.hyprland.override {debug = true;};
|
||||||
hyprland-hidpi = final.hyprland.override {hidpiXWayland = true;};
|
hyprland-nvidia = final.hyprland.override {enableNvidiaPatches = true;};
|
||||||
hyprland-nvidia = final.hyprland.override {nvidiaPatches = true;};
|
hyprland-hidpi =
|
||||||
hyprland-no-hidpi =
|
builtins.trace ''
|
||||||
builtins.trace
|
hyprland-hidpi was removed. Please use the hyprland package.
|
||||||
"hyprland-no-hidpi was removed. Please use the default package."
|
For more information, refer to https://wiki.hyprland.org/Configuring/XWayland.
|
||||||
|
''
|
||||||
final.hyprland;
|
final.hyprland;
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
@ -80,6 +80,7 @@ in {
|
||||||
wlroots-hyprland = final.callPackage ./wlroots.nix {
|
wlroots-hyprland = final.callPackage ./wlroots.nix {
|
||||||
version = "${mkDate (inputs.wlroots.lastModifiedDate or "19700101")}_${inputs.wlroots.shortRev or "dirty"}";
|
version = "${mkDate (inputs.wlroots.lastModifiedDate or "19700101")}_${inputs.wlroots.shortRev or "dirty"}";
|
||||||
src = inputs.wlroots;
|
src = inputs.wlroots;
|
||||||
|
|
||||||
libdisplay-info = prev.libdisplay-info.overrideAttrs (old: {
|
libdisplay-info = prev.libdisplay-info.overrideAttrs (old: {
|
||||||
version = "0.1.1+date=2023-03-02";
|
version = "0.1.1+date=2023-03-02";
|
||||||
src = final.fetchFromGitLab {
|
src = final.fetchFromGitLab {
|
||||||
|
@ -90,6 +91,7 @@ in {
|
||||||
sha256 = "sha256-/q79o13Zvu7x02SBGu0W5yQznQ+p7ltZ9L6cMW5t/o4=";
|
sha256 = "sha256-/q79o13Zvu7x02SBGu0W5yQznQ+p7ltZ9L6cMW5t/o4=";
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
libliftoff = prev.libliftoff.overrideAttrs (old: {
|
libliftoff = prev.libliftoff.overrideAttrs (old: {
|
||||||
version = "0.5.0-dev";
|
version = "0.5.0-dev";
|
||||||
src = final.fetchFromGitLab {
|
src = final.fetchFromGitLab {
|
||||||
|
|
|
@ -1,64 +1,28 @@
|
||||||
{
|
{
|
||||||
|
lib,
|
||||||
version,
|
version,
|
||||||
src,
|
src,
|
||||||
#
|
|
||||||
wlroots,
|
wlroots,
|
||||||
xwayland,
|
|
||||||
fetchpatch,
|
|
||||||
lib,
|
|
||||||
hwdata,
|
hwdata,
|
||||||
libliftoff,
|
|
||||||
libdisplay-info,
|
libdisplay-info,
|
||||||
hidpiXWayland ? true,
|
libliftoff,
|
||||||
enableXWayland ? true,
|
enableXWayland ? true,
|
||||||
nvidiaPatches ? false,
|
enableNvidiaPatches ? false,
|
||||||
}:
|
}:
|
||||||
assert (lib.assertMsg (hidpiXWayland -> enableXWayland) ''
|
wlroots.overrideAttrs (old: {
|
||||||
wlroots-hyprland: cannot have hidpiXWayland when enableXWayland is false.
|
inherit version src enableXWayland;
|
||||||
'');
|
|
||||||
(wlroots.overrideAttrs
|
|
||||||
(old: {
|
|
||||||
inherit version src;
|
|
||||||
pname =
|
|
||||||
old.pname
|
|
||||||
+ "-hyprland"
|
|
||||||
+ (
|
|
||||||
if hidpiXWayland
|
|
||||||
then "-hidpi"
|
|
||||||
else ""
|
|
||||||
)
|
|
||||||
+ (
|
|
||||||
if nvidiaPatches
|
|
||||||
then "-nvidia"
|
|
||||||
else ""
|
|
||||||
);
|
|
||||||
patches =
|
|
||||||
(old.patches or [])
|
|
||||||
++ (lib.optionals (enableXWayland && hidpiXWayland) [
|
|
||||||
# adapted from https://gitlab.freedesktop.org/lilydjwg/wlroots/-/commit/6c5ffcd1fee9e44780a6a8792f74ecfbe24a1ca7
|
|
||||||
./patches/wlroots-hidpi.patch
|
|
||||||
(fetchpatch {
|
|
||||||
url = "https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/18595000f3a21502fd60bf213122859cc348f9af.diff";
|
|
||||||
sha256 = "sha256-jvfkAMh3gzkfuoRhB4E9T5X1Hu62wgUjj4tZkJm0mrI=";
|
|
||||||
revert = true;
|
|
||||||
})
|
|
||||||
])
|
|
||||||
++ (lib.optionals nvidiaPatches [
|
|
||||||
./patches/wlroots-nvidia.patch
|
|
||||||
]);
|
|
||||||
buildInputs = old.buildInputs ++ [hwdata libliftoff libdisplay-info];
|
|
||||||
|
|
||||||
NIX_CFLAGS_COMPILE = toString [
|
pname = "${old.pname}-hyprland${lib.optionalString enableNvidiaPatches "-nvidia"}";
|
||||||
"-Wno-error=maybe-uninitialized"
|
|
||||||
];
|
patches =
|
||||||
}))
|
(old.patches or [])
|
||||||
.override {
|
++ (lib.optionals enableNvidiaPatches [
|
||||||
xwayland = xwayland.overrideAttrs (old: {
|
./patches/wlroots-nvidia.patch
|
||||||
patches =
|
]);
|
||||||
(old.patches or [])
|
|
||||||
++ (lib.optionals hidpiXWayland [
|
buildInputs = old.buildInputs ++ [hwdata libliftoff libdisplay-info];
|
||||||
./patches/xwayland-vsync.patch
|
|
||||||
./patches/xwayland-hidpi.patch
|
NIX_CFLAGS_COMPILE = toString [
|
||||||
]);
|
"-Wno-error=maybe-uninitialized"
|
||||||
});
|
];
|
||||||
}
|
})
|
||||||
|
|
Loading…
Reference in a new issue