From de26bd336939c8a695ea1a19d91cf8e9ef324d39 Mon Sep 17 00:00:00 2001 From: Daniel Ziltener Date: Wed, 3 Apr 2024 17:08:08 +0200 Subject: [PATCH] . --- zilti/packages/hyprland.scm | 154 +++++++++++++++++++++++++++--------- 1 file changed, 118 insertions(+), 36 deletions(-) diff --git a/zilti/packages/hyprland.scm b/zilti/packages/hyprland.scm index 1115dd2..3967e41 100644 --- a/zilti/packages/hyprland.scm +++ b/zilti/packages/hyprland.scm @@ -7,6 +7,7 @@ #:use-module (guix utils) #:use-module (guix build-system meson) #:use-module (guix build-system cmake) + #:use-module (guix build-system gnu) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix git-download) #:use-module (gnu packages) @@ -39,6 +40,7 @@ #:use-module (gnu packages linux) #:use-module (gnu packages pciutils) #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) #:use-module (gnu packages qt) #:use-module (gnu packages version-control) #:use-module (gnu packages xdisorg) @@ -47,38 +49,52 @@ #:use-module (gnu packages wm) #:use-module (gnu packages xorg)) -(define hyprland-unbundle-wlroots-patch - (origin - (method url-fetch) - (uri (string-append "https://github.com/hyprwm/Hyprland" "/raw/" - "c5e28ebcfe00a510922779b2c568cfa52a317445" - "/nix/patches/meson-build.patch")) - (sha256 - (base32 "00i7c98ignfgkk3x1r1masmlj92xzb8cdb7nyfhivbfkdlfyzgpj")))) - -(define-public hyprland +(define-public tomlplusplus (package - (inherit rosenthal:hyprland) - (name "hyprland") - (version "0.38.0") + (name "tomlplusplus") + (version "3.4.0") (source (origin - (method url-fetch) - (uri (string-append "https://github.com/hyprwm/Hyprland" - "/releases/download/v" version - "/source-v" version ".tar.gz")) - (modules '((guix build utils))) - (snippet - '(begin - ;; Remove bundled sources and hyprpm utility. - (substitute* "meson.build" - ((".*hyprpm/src.*") "")) - (for-each delete-file-recursively - '("hyprpm" - "subprojects")))) - (patches (list hyprland-unbundle-wlroots-patch)) + (method git-fetch) + (uri (git-reference + (url "https://github.com/marzer/tomlplusplus") + (commit (string-append "v" version)))) (sha256 (base32 - "022z62y5irmgnm6m0wfgkg8iw3gs5f2p8155h49lgzzc46nka0kf")))))) + "1hvbifzcc97r9jwjzpnq31ynqnj5y93cjz4frmgddnkg8hxmp6w7")))) + (build-system cmake-build-system) + (native-inputs + (list python)) + (arguments + (list #:tests? #f)) + (home-page "https://marzer.github.io/tomlplusplus/") + (synopsis "Header-only TOML config file parser and serializer for C++17") + (description "Header-only TOML config file parser and serializer for C++17.") + (license license:expat))) + +(define udis86-for-hyprland + (let ((revision "186") + (commit "5336633af70f3917760a6d441ff02d93477b0c86")) + (package + (name "udis86") + (version (git-version "1.7.2" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/canihavesomecoffee/udis86") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0y5z1169wff578jylpafsww4px4y6gickhcs885a9c660d8xs9qy")))) + (build-system gnu-build-system) + (native-inputs (list autoconf automake libtool python-minimal-wrapper)) + (home-page "https://github.com/canihavesomecoffee/udis86") + (synopsis "Disassembler Library for x86 and x86-64") + (description + "Udis86 is a disassembler for the x86 and x86-64 class of instruction +set architectures. It consists of a C library called @code{libudis86} and a +command line tool called @code{udcli} that incorporates the library.") + (license license:bsd-2)))) (define cairo-for-hyprland (package @@ -163,6 +179,72 @@ (base32 "0yijzgg6rdsa68bz03sw0lcfa2nclv9m3as1cja50wkcyxim7x9v")))))) +(define hyprland-unbundle-wlroots-patch + (origin + (method url-fetch) + (uri (string-append "https://github.com/hyprwm/Hyprland" "/raw/" + "c5e28ebcfe00a510922779b2c568cfa52a317445" + "/nix/patches/meson-build.patch")) + (sha256 + (base32 "00i7c98ignfgkk3x1r1masmlj92xzb8cdb7nyfhivbfkdlfyzgpj")))) + +(define-public hyprland + (package + (name "hyprland") + (version "0.38.0") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/hyprwm/Hyprland" + "/releases/download/v" version + "/source-v" version ".tar.gz")) + (modules '((guix build utils))) + (patches (list hyprland-unbundle-wlroots-patch)) + (sha256 + (base32 + "022z62y5irmgnm6m0wfgkg8iw3gs5f2p8155h49lgzzc46nka0kf")))) + (build-system meson-build-system) + (arguments + (list #:build-type "release" + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'fix-path + (lambda* (#:key inputs #:allow-other-keys) + (substitute* (find-files "src" "\\.cpp$") + (("/usr/local(/bin/Hyprland)" _ path) + (string-append #$output path)) + (("/usr") #$output) + (("(execAndGet\\(\")\\<(cat|fc-list|lspci)\\>" + _ pre cmd) + (string-append + pre (search-input-file + inputs (string-append "bin/" cmd)))) + (("\\") (search-input-file inputs "bin/gcc")) + ;; NOTE: Add binutils to inputs will override ld-wrapper. + (("(execAndGet\\(\\(\")\\" _ pre) + (string-append pre #$binutils "/bin/nm")) + (("\\<(addr2line|objcopy)\\>" _ cmd) + (string-append #$binutils "/bin/" cmd)))))))) + (native-inputs (list cmake gcc-13 jq pkg-config)) + (inputs + (list cairo-for-hyprland + gcc-13 + rosenthal:hyprcursor + rosenthal:hyprland-protocols + rosenthal:hyprlang + pango + pciutils + tomlplusplus + udis86-for-hyprland + wlroots-for-hyprland)) + (home-page "https://hyprland.org") + (synopsis "Dynamic tiling Wayland compositor based on wlroots") + (description + "Hyprland is a dynamic tiling Wayland compositor based on @code{wlroots} +that doesn't sacrifice on its looks. It supports multiple layouts, fancy +effects, has a very flexible IPC model allowing for a lot of customization, and +more.") + (license license:bsd-3))) + (define-public hyprpaper (package (name "hyprpaper") @@ -189,13 +271,13 @@ (delete 'check)))) (native-inputs (list gcc-13 + pkg-config)) + (inputs + (list cairo-for-hyprland mesa rosenthal:hyprland-protocols wayland-protocols-for-hyprland wlroots-for-hyprland - pkg-config)) - (inputs - (list cairo-for-hyprland file libglvnd libjpeg-turbo @@ -227,11 +309,11 @@ (delete 'check)))) (native-inputs (list gcc-13 - wayland-protocols-for-hyprland pkg-config)) (inputs (list rosenthal:hyprlang sdbus-c++ + wayland-protocols-for-hyprland wayland)) (home-page "https://github.com/hyprwm/hypridle") (synopsis "Hyprland's idle daemon") @@ -257,17 +339,17 @@ (delete 'check)))) (native-inputs (list gcc-13 - linux-pam - mesa - pkg-config - wayland)) + pkg-config)) (inputs (list cairo-for-hyprland pango + linux-pam + mesa libdrm-for-hyprland libglvnd libxkbcommon wayland-protocols-for-hyprland + wayland rosenthal:hyprlang)) (home-page "https://github.com/hyprwm/hyprlock") (synopsis "Hyprland's GPU-accelerated screen locking utility")