This commit is contained in:
Daniel Ziltener 2024-04-16 01:04:37 +02:00
parent e6db930101
commit 35ccb639b8
Signed by: zilti
GPG key ID: B38976E82C9DAE42
3 changed files with 416 additions and 269 deletions

View file

@ -1,67 +1,129 @@
(define-module (zilti packages hyprland)
#:use-module (srfi srfi-1)
#:use-module (ice-9 match)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix gexp)
#: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 build-system qt)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix git-download)
#:use-module (gnu packages)
#:use-module (rosenthal packages freedesktop)
#:use-module ((rosenthal packages wm) #:prefix rosenthal:)
#:use-module (gnu packages admin)
#:use-module (gnu packages autotools)
#:use-module (gnu packages base)
#:use-module (gnu packages bash)
#:use-module (gnu packages bison)
#:use-module (gnu packages build-tools)
#:use-module (gnu packages check)
#:use-module (gnu packages compression)
#:use-module (gnu packages cpio)
#:use-module (gnu packages docbook)
#:use-module (gnu packages elf)
#:use-module (gnu packages file)
#:use-module (gnu packages flex)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages freedesktop)
#:use-module (gnu packages gcc)
#:use-module (gnu packages gettext)
#:use-module (gnu packages ghostscript)
#:use-module (gnu packages gl)
#:use-module (gnu packages glib)
#:use-module (gnu packages gnome)
#:use-module (gnu packages gtk)
#: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)
#:use-module (gnu packages qt)
#:use-module (gnu packages version-control)
#:use-module (gnu packages xdisorg)
#:use-module (gnu packages vulkan)
#:use-module (gnu packages web)
#:use-module (gnu packages xml)
#:use-module (gnu packages wm)
#:use-module (gnu packages xorg)
#:use-module ((zilti packages utilities) #:prefix utils:))
(define-module
(zilti packages hyprland)
#:use-module
(srfi srfi-1)
#:use-module
(ice-9 match)
#:use-module
(guix packages)
#:use-module
(guix download)
#:use-module
(guix gexp)
#:use-module
(guix build utils)
#: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 build-system qt)
#:use-module
((guix licenses)
#:prefix license:)
#:use-module
(guix git-download)
#:use-module
(gnu packages)
#:use-module
(rosenthal packages freedesktop)
#:use-module
((rosenthal packages wm)
#:prefix rosenthal:)
#:use-module
(gnu packages admin)
#:use-module
(gnu packages autotools)
#:use-module
(gnu packages base)
#:use-module
(gnu packages bash)
#:use-module
(gnu packages bison)
#:use-module
(gnu packages build-tools)
#:use-module
(gnu packages check)
#:use-module
(gnu packages compression)
#:use-module
(gnu packages cpio)
#:use-module
(gnu packages docbook)
#:use-module
(gnu packages elf)
#:use-module
(gnu packages file)
#:use-module
(gnu packages flex)
#:use-module
(gnu packages fontutils)
#:use-module
(gnu packages freedesktop)
#:use-module
(gnu packages gcc)
#:use-module
(gnu packages gettext)
#:use-module
(gnu packages ghostscript)
#:use-module
(gnu packages gl)
#:use-module
(gnu packages glib)
#:use-module
(gnu packages gnome)
#:use-module
(gnu packages gtk)
#: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)
#:use-module
(gnu packages qt)
#:use-module
(gnu packages version-control)
#:use-module
(gnu packages xdisorg)
#:use-module
(gnu packages vulkan)
#:use-module
(gnu packages web)
#:use-module
(gnu packages xml)
#:use-module
(gnu packages wm)
#:use-module
(gnu packages xorg)
#:use-module
((zilti packages utilities)
#:prefix utils:))
(define-public tomlplusplus ;; SENT to Guix
(package
(name "tomlplusplus")
(version "3.4.0")
(source (origin
(source
(origin
(method git-fetch)
(uri (git-reference
(uri
(git-reference
(url "https://github.com/marzer/tomlplusplus")
(commit (string-append "v" version))))
(commit
(string-append "v" version))))
(sha256
(base32
"1hvbifzcc97r9jwjzpnq31ynqnj5y93cjz4frmgddnkg8hxmp6w7"))))
@ -79,11 +141,14 @@
(package
(name "libliftoff")
(version "0.4.1")
(source (origin
(source
(origin
(method git-fetch)
(uri (git-reference
(uri
(git-reference
(url "https://gitlab.freedesktop.org/emersion/libliftoff")
(commit (string-append "v" version))))
(commit
(string-append "v" version))))
(sha256
(base32
"1ikjp638d655ycaqkdnzhb12d29kkbb3a46lqhbhsfc8vsqj3z1l"))))
@ -105,9 +170,11 @@ and libliftoff will pick hardware planes for these layers if possible.")
(inherit cairo)
(name "cairo")
(version "1.18.0")
(source (origin
(source
(origin
(method url-fetch)
(uri (string-append "https://cairographics.org/releases/cairo-"
(uri
(string-append "https://cairographics.org/releases/cairo-"
version ".tar.xz"))
(sha256
(base32
@ -118,24 +185,30 @@ and libliftoff will pick hardware planes for these layers if possible.")
#:glib-or-gtk? #t
#:configure-flags
#~(list "-Dspectre=disabled")))
(outputs '("out"))))
(outputs
'("out"))))
(define hwdata-for-hyprland
(package
(inherit hwdata)
(arguments
(substitute-keyword-arguments (package-arguments hwdata)
((#:phases _) #~%standard-phases)))
(outputs '("out"))))
(substitute-keyword-arguments
(package-arguments hwdata)
((#:phases _)
#~%standard-phases)))
(outputs
'("out"))))
(define wayland-protocols-for-hyprland
(package
(inherit wayland-protocols)
(name "wayland-protocols")
(version "1.34")
(source (origin
(source
(origin
(method url-fetch)
(uri (string-append
(uri
(string-append
"https://gitlab.freedesktop.org/wayland/wayland-protocols"
"/-/releases/" version "/downloads/"
"wayland-protocols-" version ".tar.xz"))
@ -143,41 +216,16 @@ and libliftoff will pick hardware planes for these layers if possible.")
(base32
"1sxgvis0abkymc02nhx2svm60myiq3shvy759sphpxl5rp52g6y5"))))))
(define-public wlroots-hyprland
(let ((base wlroots)
(revision "255")
(commit "50eae512d9cecbf0b3b1898bb1f0b40fa05fe19b"))
(package
(inherit base)
(name "wlroots")
(version (git-version "0.19.0" revision commit))
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://gitlab.freedesktop.org/wlroots/wlroots.git")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(base32
"0bwpppb86nfjg2lw62y449f9iz2v8djqb8n6g1cn45vqnwj8hxf1"))))
(propagated-inputs
(modify-inputs (package-propagated-inputs wlroots)
(prepend libdrm-for-hyprland)
(prepend xcb-util-renderutil)
(replace "libinput-minimal" libinput-minimal-1.24.0)
(replace "wayland-protocols" wayland-protocols-for-hyprland)))
(native-inputs
(modify-inputs (package-native-inputs base)
(replace "hwdata" `(,hwdata-for-hyprland "out")))))))
(define libdrm-for-hyprland
(package
(inherit libdrm)
(name "libdrm")
(version "2.4.120")
(source (origin
(source
(origin
(method url-fetch)
(uri (string-append
(uri
(string-append
"https://dri.freedesktop.org/libdrm/libdrm-"
version ".tar.xz"))
(sha256
@ -189,16 +237,20 @@ and libliftoff will pick hardware planes for these layers if possible.")
(inherit rosenthal:hyprcursor)
(name "hyprcursor")
(version "0.1.7")
(source (origin
(source
(origin
(method git-fetch)
(uri (git-reference
(uri
(git-reference
(url "https://github.com/hyprwm/hyprcursor.git")
(commit (string-append "v" version))))
(commit
(string-append "v" version))))
(sha256
(base32
"0s5x3nk2f48xl2z797f8s5jddmhpkg0ndw0jl7mirv9l23xmajag"))))
(inputs
(modify-inputs (package-inputs rosenthal:hyprcursor)
(modify-inputs
(package-inputs rosenthal:hyprcursor)
(append tomlplusplus)))))
(define-public hyprlang
@ -206,11 +258,14 @@ and libliftoff will pick hardware planes for these layers if possible.")
(inherit rosenthal:hyprlang)
(name "hyprlang")
(version "0.5.1")
(source (origin
(source
(origin
(method git-fetch)
(uri (git-reference
(uri
(git-reference
(url "https://github.com/hyprwm/hyprlang")
(commit (string-append "v" version))))
(commit
(string-append "v" version))))
(sha256
(base32
"1vgvbnd6l5iymb66zdcslhs4w20a7i013qmf4jnxx10z1p8rfkg7"))))))
@ -219,11 +274,14 @@ and libliftoff will pick hardware planes for these layers if possible.")
(package
(name "hyprland")
(version "0.39.0")
(source (origin
(source
(origin
(method git-fetch)
(uri (git-reference
(uri
(git-reference
(url "https://github.com/hyprwm/hyprland")
(commit (string-append "v" version))
(commit
(string-append "v" version))
(recursive? #t)))
(sha256
(base32
@ -234,10 +292,10 @@ and libliftoff will pick hardware planes for these layers if possible.")
#:cmake utils:cmake
#:parallel-build? #t
#:out-of-source? #t
#:tests? #f
#:configure-flags #~(list "-DNO_XWAYLAND=1"
"-DNO_SYSTEMD=1")
#:phases #~(modify-phases %standard-phases
(delete 'check)
(replace 'install
(lambda _
(with-directory-excursion
@ -287,13 +345,47 @@ effects, has a very flexible IPC model allowing for a lot of customization, and
more.")
(license license:bsd-3)))
(define-public hyprland-xwayland
(package
(inherit hyprland)
(name "hyprland-xwayland")
(arguments
(substitute-keyword-arguments
(package-arguments hyprland)
((#:configure-flags _)
#~(list "-DNO_SYSTEMD=1"
(string-append "-DCMAKE_IGNORE_PATH="
#$(file-append xorg-server-xwayland "/include"))))
((#:phases oldphases #~%standard-phases)
#~(modify-phases #$oldphases
(add-before 'configure 'fix-CMakeLists.txt
(lambda _
(invoke "sed" "-i" "s/xcb xwayland/xcb/g" "CMakeLists.txt")))))))
(propagated-inputs
(list xorg-server-xwayland))
(native-inputs
(modify-inputs
(package-native-inputs hyprland)))
(inputs
(modify-inputs
(package-inputs hyprland)
(append libxcomposite)
(append libxfixes)
(append xcb-util)
(append xcb-util-errors)
(append xcb-util-image)
(append xcb-util-wm)
(append xorg-server-xwayland)))))
(define-public hyprland-plugin-hyprsplit
(package
(name "hyprland-plugin-hyprsplit")
(version "3b71eaf")
(source (origin
(source
(origin
(method git-fetch)
(uri (git-reference
(uri
(git-reference
(url "https://github.com/shezdy/hyprsplit.git")
(commit version)))
(sha256
@ -329,11 +421,14 @@ more.")
(package
(name "hyprpaper")
(version "0.6.0")
(source (origin
(source
(origin
(method git-fetch)
(uri (git-reference
(uri
(git-reference
(url "https://github.com/hyprwm/hyprpaper.git")
(commit (string-append "v" version))))
(commit
(string-append "v" version))))
(sha256
(base32
"0bcb2jfnw5752h3lyflvl12v9m61yrdmff1ry2y98m42v1l6gb4s"))))
@ -348,9 +443,13 @@ more.")
(invoke "make" "protocols")))
(replace 'install
(lambda _
(let* ((output (assoc-ref %outputs "out"))
(out-bin (string-append output "/bin")))
(use-modules (guix build utils))
(let*
((output
(assoc-ref %outputs "out"))
(out-bin
(string-append output "/bin")))
(use-modules
(guix build utils))
(invoke "ls")
(install-file "./hyprpaper"
out-bin))))
@ -380,11 +479,14 @@ more.")
(package
(name "hypridle")
(version "0.1.1")
(source (origin
(source
(origin
(method git-fetch)
(uri (git-reference
(uri
(git-reference
(url "https://github.com/hyprwm/hypridle.git")
(commit (string-append "v" version))))
(commit
(string-append "v" version))))
(sha256
(base32
"0k0izx34zp65lawl25n8my2m4yfql9zmfljlkz50k4yr8d9qbb31"))))
@ -410,11 +512,14 @@ more.")
(package
(name "hyprlock")
(version "0.3.0")
(source (origin
(source
(origin
(method git-fetch)
(uri (git-reference
(uri
(git-reference
(url "https://github.com/hyprwm/hyprlock.git")
(commit (string-append "v" version))))
(commit
(string-append "v" version))))
(sha256
(base32
"0w2a25hivn8xd8p05vc9xg57rd9siv12dwmr4skpqx4dcmxxbg5d"))))
@ -456,12 +561,16 @@ more.")
(package
(name "xdg-desktop-portal-hyprland")
(version "1.3.1")
(source (origin
(source
(origin
(method git-fetch)
(uri (git-reference
(uri
(git-reference
(url "https://github.com/hyprwm/xdg-desktop-portal-hyprland")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(commit
(string-append "v" version))))
(file-name
(git-file-name name version))
(sha256
(base32
"0fdbzxanmmzrvb9wfzg1pdsnlg7dl6v5k8bl44w10n48s7bbbzn0"))))
@ -472,11 +581,15 @@ more.")
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'fix-path
(lambda* (#:key inputs #:allow-other-keys)
(substitute* (find-files "." "\\.cp?*$")
(("/bin/sh") "sh")
(lambda*
(#:key inputs #:allow-other-keys)
(substitute*
(find-files "." "\\.cp?*$")
(("/bin/sh")
"sh")
(("\\<(sh|grim|hyprctl|slurp)\\>" _ cmd)
(search-input-file inputs (string-append "/bin/" cmd)))
(search-input-file inputs
(string-append "/bin/" cmd)))
(("\\<(hyprland-share-picker)\\>" _ cmd)
(string-append #$output "/bin/" cmd))))))))
(native-inputs

View file

@ -0,0 +1,32 @@
diff -crB zig.orig/CMakeLists.txt zig/CMakeLists.txt
*** zig.orig/CMakeLists.txt 2024-04-16 00:59:10.664981173 +0200
--- zig/CMakeLists.txt 2024-04-16 01:01:00.747848186 +0200
***************
*** 904,909 ****
--- 904,919 ----
set(ZIG_PIE_ARG "")
endif()
+ # Use LIBRARY_PATH
+ string(REPLACE ":" ";" LIBRARY_PATH "$ENV{LIBRARY_PATH}")
+ set(SEARCH_PATHS "")
+
+ foreach(PATH ${LIBRARY_PATH})
+ list(APPEND SEARCH_PATHS "--search-prefix ${PATH}")
+ endforeach()
+
+ list(JOIN SEARCH_PATHS " " SEARCH_PREFIXES)
+
# -Dno-langref is currently hardcoded because building the langref takes too damn long
# To obtain these two forms of documentation, run zig build against stage3 rather than stage2.
set(ZIG_BUILD_ARGS
***************
*** 919,924 ****
--- 929,935 ----
"-Dtarget=${ZIG_TARGET_TRIPLE}"
"-Dcpu=${ZIG_TARGET_MCPU}"
"-Dversion-string=${RESOLVED_ZIG_VERSION}"
+ "${SEARCH_PREFIXES}"
)
add_custom_target(stage3 ALL

View file

@ -38,6 +38,8 @@
(url "https://github.com/ziglang/zig.git")
(commit version)))
(file-name (git-file-name name version))
(patches (search-patches
"zig-0.11-use-LIBRARY_PATH.patch"))
(sha256
(base32 "0qh7c27cd4wcdjj0mbpkarvwypfk1js8hkyxs0z149qv75zkbrca"))))
(arguments