Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hyprland: 0.43.0 -> 0.44.0, hyprpicker: 0.3.0 -> 0.4.1 #346906

Merged
merged 7 commits into from
Oct 9, 2024
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
64 changes: 28 additions & 36 deletions pkgs/applications/window-managers/hyprwm/hyprpicker/default.nix
Original file line number Diff line number Diff line change
@@ -1,75 +1,67 @@
{ lib
, stdenv
, fetchFromGitHub
, pkg-config
, cmake
, ninja
, cairo
, fribidi
, libGL
, libdatrie
, libjpeg
, libselinux
, libsepol
, libthai
, libxkbcommon
, pango
, pcre
, util-linux
, wayland
, wayland-protocols
, wayland-scanner
, libXdmcp
, debug ? false
{
lib,
stdenv,
fetchFromGitHub,
nix-update-script,
pkg-config,
cmake,
cairo,
hyprutils,
hyprwayland-scanner,
libGL,
libjpeg,
libxkbcommon,
pango,
wayland,
wayland-protocols,
wayland-scanner,
libXdmcp,
debug ? false,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "hyprpicker" + lib.optionalString debug "-debug";
version = "0.3.0";
version = "0.4.1";

src = fetchFromGitHub {
owner = "hyprwm";
repo = "hyprpicker";
rev = "v${finalAttrs.version}";
hash = "sha256-BYQF1zM6bJ44ag9FJ0aTSkhOTY9U7uRdp3SmRCs5fJM=";
hash = "sha256-gu26MSYbTlRLMUpZ9PeYXtqqhzPDQXxEDkjiJgwzIIc=";
};

cmakeBuildType = if debug then "Debug" else "Release";

nativeBuildInputs = [
cmake
ninja
hyprwayland-scanner
pkg-config
];

buildInputs = [
cairo
fribidi
hyprutils
libGL
libdatrie
libjpeg
libselinux
libsepol
libthai
libxkbcommon
pango
pcre
wayland
wayland-protocols
wayland-scanner
libXdmcp
util-linux
];

postInstall = ''
mkdir -p $out/share/licenses
install -Dm644 $src/LICENSE -t $out/share/licenses/hyprpicker
'';

meta = with lib; {
passthru.updateScript = nix-update-script { };

meta = {
description = "Wlroots-compatible Wayland color picker that does not suck";
homepage = "https://github.com/hyprwm/hyprpicker";
license = licenses.bsd3;
maintainers = with maintainers; [ fufexan ];
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ fufexan ];
platforms = wayland.meta.platforms;
mainProgram = "hyprpicker";
};
Expand Down
99 changes: 66 additions & 33 deletions pkgs/by-name/hy/hyprland/package.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
lib,
stdenv,
stdenvAdapters,
fetchFromGitHub,
pkg-config,
makeWrapper,
cmake,
meson,
ninja,
aquamarine,
binutils,
Expand All @@ -15,7 +17,6 @@
hyprlang,
hyprutils,
hyprwayland-scanner,
jq,
libGL,
libdrm,
libexecinfo,
Expand Down Expand Up @@ -45,30 +46,52 @@
enableNvidiaPatches ? false,
}:
let
info = builtins.fromJSON (builtins.readFile ./info.json);
inherit (builtins)
foldl'
;
inherit (lib.asserts) assertMsg;
inherit (lib.attrsets) mapAttrsToList;
inherit (lib.lists)
concatLists
optionals
;
inherit (lib.strings)
makeBinPath
optionalString
mesonBool
mesonEnable
;
inherit (lib.trivial)
importJSON
;

info = importJSON ./info.json;

# possibility to add more adapters in the future, such as keepDebugInfo,
# which would be controlled by the `debug` flag
adapters = [
stdenvAdapters.useMoldLinker
];

customStdenv = foldl' (acc: adapter: adapter acc) stdenv adapters;
in
assert lib.assertMsg (!nvidiaPatches) "The option `nvidiaPatches` has been removed.";
assert lib.assertMsg (!enableNvidiaPatches) "The option `enableNvidiaPatches` has been removed.";
assert lib.assertMsg (!hidpiXWayland)
assert assertMsg (!nvidiaPatches) "The option `nvidiaPatches` has been removed.";
assert assertMsg (!enableNvidiaPatches) "The option `enableNvidiaPatches` has been removed.";
assert assertMsg (!hidpiXWayland)
"The option `hidpiXWayland` has been removed. Please refer https://wiki.hyprland.org/Configuring/XWayland";

stdenv.mkDerivation (finalAttrs: {
pname = "hyprland" + lib.optionalString debug "-debug";
version = "0.43.0";
customStdenv.mkDerivation (finalAttrs: {
pname = "hyprland" + optionalString debug "-debug";
version = "0.44.0";

src = fetchFromGitHub {
owner = "hyprwm";
repo = "hyprland";
fetchSubmodules = true;
rev = "refs/tags/v${finalAttrs.version}";
hash = "sha256-+wE97utoDfhQP6AMdZHUmBeL8grbce/Jv2i5M+6AbaE=";
hash = "sha256-XgDhPx+tKs+2lyWM/ZqIHnMArd/c0LGmwAwu0EG1uJM=";
};

patches = [
# forces GCC to use -std=c++26 on CMake < 3.30
"${finalAttrs.src}/nix/stdcxx.patch"
];

postPatch = ''
# Fix hardcoded paths to /usr installation
sed -i "s#/usr#$out#" src/render/OpenGL.cpp
Expand All @@ -93,13 +116,14 @@ stdenv.mkDerivation (finalAttrs: {

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

outputs = [
Expand All @@ -108,7 +132,7 @@ stdenv.mkDerivation (finalAttrs: {
"dev"
];

buildInputs =
buildInputs = concatLists [
[
aquamarine
cairo
Expand All @@ -129,32 +153,40 @@ stdenv.mkDerivation (finalAttrs: {
wayland-protocols
xorg.libXcursor
]
++ lib.optionals stdenv.hostPlatform.isBSD [ epoll-shim ]
++ lib.optionals stdenv.hostPlatform.isMusl [ libexecinfo ]
++ lib.optionals enableXWayland [
(optionals customStdenv.hostPlatform.isBSD [ epoll-shim ])
(optionals customStdenv.hostPlatform.isMusl [ libexecinfo ])
(optionals enableXWayland [
xorg.libxcb
xorg.libXdmcp
xorg.xcbutilerrors
xorg.xcbutilwm
xwayland
]
++ lib.optionals withSystemd [ systemd ];
])
(optionals withSystemd [ systemd ])
];

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

dontStrip = debug;

cmakeFlags = [
(lib.cmakeBool "NO_XWAYLAND" (!enableXWayland))
(lib.cmakeBool "LEGACY_RENDERER" legacyRenderer)
(lib.cmakeBool "NO_SYSTEMD" (!withSystemd))
mesonFlags = concatLists [
(mapAttrsToList mesonEnable {
"xwayland" = enableXWayland;
"legacy_renderer" = legacyRenderer;
"systemd" = withSystemd;
})
(mapAttrsToList mesonBool {
# PCH provides no benefits when building with Nix
"b_pch" = false;
"tracy_enable" = false;
})
];

postInstall = ''
${lib.optionalString wrapRuntimeDeps ''
${optionalString wrapRuntimeDeps ''
wrapProgram $out/bin/Hyprland \
--suffix PATH : ${
lib.makeBinPath [
makeBinPath [
binutils
pciutils
pkgconf
Expand All @@ -163,9 +195,10 @@ stdenv.mkDerivation (finalAttrs: {
''}
'';

passthru.providedSessions = [ "hyprland" ];

passthru.updateScript = ./update.sh;
passthru = {
providedSessions = [ "hyprland" ];
updateScript = ./update.sh;
};

meta = {
homepage = "https://github.com/hyprwm/Hyprland";
Expand Down