guixchannel/zilti/packages/hyprland.scm

198 lines
6.8 KiB
Scheme

(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 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 cmake)
#:use-module (gnu packages compression)
#: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 pciutils)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages qt)
#:use-module (gnu packages version-control)
#:use-module (gnu packages xdisorg)
#:use-module (gnu packages web)
#:use-module (gnu packages xml)
#: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
(package
(inherit rosenthal:hyprland)
(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)))
(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))
(sha256
(base32
"022z62y5irmgnm6m0wfgkg8iw3gs5f2p8155h49lgzzc46nka0kf"))))))
(define cairo-for-hyprland
(package
(inherit cairo)
(name "cairo")
(version "1.18.0")
(source (origin
(method url-fetch)
(uri (string-append "https://cairographics.org/releases/cairo-"
version ".tar.xz"))
(sha256
(base32
"0r0by563s75xyzz0d0j1nmjqmdrk2x9agk7r57p3v8vqp4v0ffi4"))))
(build-system meson-build-system)
(arguments
(list #:tests? #f
#:glib-or-gtk? #t
#:configure-flags
#~(list "-Dspectre=disabled")))
(outputs '("out"))))
(define hwdata-for-hyprland
(package
(inherit hwdata)
(arguments
(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
(method url-fetch)
(uri (string-append
"https://gitlab.freedesktop.org/wayland/wayland-protocols"
"/-/releases/" version "/downloads/"
"wayland-protocols-" version ".tar.xz"))
(sha256
(base32
"1sxgvis0abkymc02nhx2svm60myiq3shvy759sphpxl5rp52g6y5"))))))
(define wlroots-for-hyprland
(let ((base wlroots)
(revision "255")
(commit "50eae512d9cecbf0b3b1898bb1f0b40fa05fe19b"))
(package
(inherit base)
(name "wlroots")
(version (git-version "0.17.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)
(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
(method url-fetch)
(uri (string-append
"https://dri.freedesktop.org/libdrm/libdrm-"
version ".tar.xz"))
(sha256
(base32
"0yijzgg6rdsa68bz03sw0lcfa2nclv9m3as1cja50wkcyxim7x9v"))))))
(define-public hyprpaper
(package
(name "hyprpaper")
(version "0.5.0")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/hyprwm/hyprpaper.git")
(commit (string-append "v" version))))
(sha256
(base32
"18z6yf3jxfpagyqa73j8imp9450xm4wp2f8rjjvlqbpd425yvhdm"))))
(build-system cmake-build-system)
(native-inputs
(list gcc-13
rosenthal:hyprland-protocols
wayland-protocols-for-hyprland
pkg-config))
(inputs
(list cairo-for-hyprland
file
libglvnd
libjpeg-turbo
libwebp
rosenthal:hyprlang
mesa
pango
wayland
wlroots-for-hyprland))
(home-page "https://github.com/hyprwm/hyprpaper")
(synopsis "Hyprpaper is a blazing fast wayland wallpaper utility with IPC controls")
(description "Hyprpaper is a blazing fast wallpaper utility for Hyprland with the ability to dynamically change wallpapers through sockets. It will work on all wlroots-based compositors, though.")
(license license:bsd-3)))