From 6327a238a0a344a92abe751bbd1bbbd456e8da4c Mon Sep 17 00:00:00 2001 From: Daniel Ziltener Date: Fri, 5 Apr 2024 17:32:40 +0200 Subject: [PATCH] . --- zilti/packages/hyprland.scm | 101 +++++++++++++++++++++++++++++++----- 1 file changed, 88 insertions(+), 13 deletions(-) diff --git a/zilti/packages/hyprland.scm b/zilti/packages/hyprland.scm index 0949ebb..09e85b9 100644 --- a/zilti/packages/hyprland.scm +++ b/zilti/packages/hyprland.scm @@ -40,6 +40,7 @@ #:use-module (gnu packages hardware) #:use-module (gnu packages image) #:use-module (gnu packages linux) + #:use-module (gnu packages ninja) #:use-module (gnu packages pciutils) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) @@ -63,9 +64,9 @@ (sha256 (base32 "1hvbifzcc97r9jwjzpnq31ynqnj5y93cjz4frmgddnkg8hxmp6w7")))) - (build-system cmake-build-system) + (build-system meson-build-system) (native-inputs - (list python)) + (list python cmake)) (arguments (list #:tests? #f)) (home-page "https://marzer.github.io/tomlplusplus/") @@ -204,11 +205,11 @@ command line tool called @code{udcli} that incorporates the library.") (sha256 (base32 "022z62y5irmgnm6m0wfgkg8iw3gs5f2p8155h49lgzzc46nka0kf")))) - (build-system meson-build-system) + (build-system gnu-build-system) (arguments - (list #:build-type "release" - #:phases + (list #:phases #~(modify-phases %standard-phases + (delete 'configure) (add-after 'unpack 'fix-path (lambda* (#:key inputs #:allow-other-keys) (substitute* (find-files "src" "\\.cpp$") @@ -226,18 +227,22 @@ command line tool called @code{udcli} that incorporates the library.") (string-append pre #$binutils "/bin/nm")) (("\\<(addr2line|objcopy)\\>" _ cmd) (string-append #$binutils "/bin/" cmd))))) + (replace 'build + (lambda _ + (invoke "sed" "-i" "s/no-warn-unused-cli/no-warn-unused-cli -DNO_SYSTEMD=1/" "Makefile") + (invoke "make" + (string-append "PREFIX=" #$output) + "all"))) (add-after 'build 'install-headers (lambda _ - (with-directory-excursion - "../hyprland-source" - (invoke "ls" "protocols") - (invoke "sed" "-i" "/wlroots/d" "Makefile") - (invoke "make" - (string-append "PREFIX=" #$output) - "installheaders"))))))) - (native-inputs (list cmake gcc-13 jq pkg-config cpio)) + (invoke "make" + (string-append "PREFIX=" #$output) + "installheaders")))))) + (native-inputs (list cmake ninja meson gcc-13 jq pkg-config cpio)) (inputs (list cairo-for-hyprland + python-wrapper + libglvnd gcc-13 rosenthal:hyprcursor rosenthal:hyprland-protocols @@ -256,6 +261,76 @@ effects, has a very flexible IPC model allowing for a lot of customization, and more.") (license license:bsd-3))) +#; +(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))))) + (add-after 'build 'install-headers + (lambda _ + (copy-recursively + "protocols" "../hyprland-source/protocols") + (invoke "ls") + (invoke "find" "." "-name" "hyprland.pc") + (with-directory-excursion + "../hyprland-source" + (invoke "sed" "-i" "/wlroots/d" "Makefile") + (invoke "make" + (string-append "PREFIX=" #$output) + "installheaders"))))))) + (native-inputs (list cmake gcc-13 jq pkg-config cpio)) + (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")