guixchannel/zilti/packages/hyprland.scm

746 lines
22 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 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 cpp)
#: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:))
;;; Dependencies not yet in Guix
(define-public libliftoff
(package
(name "libliftoff")
(version "0.4.1")
(source
(origin
(method git-fetch)
(uri
(git-reference
(url "https://gitlab.freedesktop.org/emersion/libliftoff")
(commit
(string-append "v" version))))
(file-name
(git-file-name name version))
(sha256
(base32
"1ikjp638d655ycaqkdnzhb12d29kkbb3a46lqhbhsfc8vsqj3z1l"))))
(build-system meson-build-system)
(native-inputs
(list utils:cmake
pkg-config))
(inputs
(list libdrm))
(home-page "https://gitlab.freedesktop.org/emersion/libliftoff/")
(synopsis "Lightweight KMS plane library.")
(description "libliftoff eases the use of KMS planes from userspace without standing in your
way. Users create \"virtual planes\" called layers, set KMS properties on them,
and libliftoff will pick hardware planes for these layers if possible.")
(license license:expat)))
(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 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"))))))
;;; Low-level Hyprland stuff
(define-public hyprcursor
(package
(inherit rosenthal:hyprcursor)
(name "hyprcursor")
(version "0.1.7")
(source
(origin
(method git-fetch)
(uri
(git-reference
(url "https://github.com/hyprwm/hyprcursor.git")
(commit
(string-append "v" version))))
(sha256
(base32
"0s5x3nk2f48xl2z797f8s5jddmhpkg0ndw0jl7mirv9l23xmajag"))))
(inputs
(modify-inputs
(package-inputs rosenthal:hyprcursor)
(append tomlplusplus)))))
(define-public hyprlang
(package
(inherit rosenthal:hyprlang)
(name "hyprlang")
(version "0.5.1")
(source
(origin
(method git-fetch)
(uri
(git-reference
(url "https://github.com/hyprwm/hyprlang")
(commit
(string-append "v" version))))
(sha256
(base32
"1vgvbnd6l5iymb66zdcslhs4w20a7i013qmf4jnxx10z1p8rfkg7"))))))
;;; Hypland itself
(define-public hyprland
(package
(name "hyprland")
(version "0.39.1")
(source
(origin
(method git-fetch)
(uri
(git-reference
(url "https://github.com/hyprwm/hyprland")
(commit
(string-append "v" version))
(recursive? #t)))
(sha256
(base32
"1b2l1j7i7fgy66c1nai7z16l0a95ay3xqq7yr2r6h7sq0jlnpgpc"))))
(build-system cmake-build-system )
(arguments
(list #:build-type "release"
#: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
(replace 'install
(lambda _
(with-directory-excursion
"../source"
(invoke "ln" "-s" "../build" "build")
(invoke "make"
(string-append "PREFIX=" #$output)
"install")
(invoke "make"
(string-append "PREFIX=" #$output)
"installheaders")))))))
(native-inputs
(list cpio
meson
ninja
gcc-13
git
python-wrapper
jq
pkg-config))
(propagated-inputs
(list cairo
eudev
gcc-13
hwdata-for-hyprland
hyprcursor
hyprlang
libdisplay-info
libdrm-for-hyprland
libinput-minimal-1.24.0
libliftoff
libseat
libxcb
libxkbcommon
mesa
pango
pciutils
tomlplusplus
wayland
wayland-protocols-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 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")))))))
(native-inputs
(modify-inputs
(package-native-inputs hyprland)))
(propagated-inputs
(modify-inputs
(package-propagated-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)))))
;;; Hyprland plugins
;;;; Official plugins
(define hyprland-official-plugin
(package
(name "hyprland-official-plugin")
(version "e9457e08ca3ff16dc5a815be62baf9e18b539197")
(source
(origin (method git-fetch)
(uri (git-reference
(url "https://github.com/hyprwm/hyprland-plugins")
(commit version)))
(sha256
(base32
"0rnn5mr8yy98nyyy6q7l12jpr5gzs2904ywypy89p52fzxxb5zm9"))))
(build-system meson-build-system)
(propagated-inputs
(list hyprland
hyprlang))
(native-inputs
(list gcc-13
pkg-config
wayland))
(inputs
(list pango
cairo
pixman
mesa
libdrm-for-hyprland
libinput
libxkbcommon
xcb-util
xcb-util-wm))
(home-page "https://github.com/hyprwm/hyprland-plugins")
(synopsis "A template for official hyprland plugins")
(description "A template for official hyprland plugins")
(license license:bsd-3)))
(define-public hyprland-plugin-borders-plus-plus
(package
(inherit hyprland-official-plugin)
(name "hyprland-plugin-borders-plus-plus")
(arguments
(substitute-keyword-arguments
(package-arguments hyprland-official-plugin)
((#:phases oldphases #~%standard-phases)
#~(modify-phases #$oldphases
(add-after 'unpack 'chdir
(lambda _
(invoke "ls" "-la")
(chdir "./borders-plus-plus")))))))))
(define-public hyprland-plugin-csgo-vulkan-fix
(package
(inherit hyprland-official-plugin)
(name "hyprland-plugin-csgo-vulkan-fix")
(arguments
(substitute-keyword-arguments
(package-arguments hyprland-official-plugin)
((#:phases oldphases #~%standard-phases)
#~(modify-phases #$oldphases
(add-after 'unpack 'chdir
(lambda _
(invoke "ls" "-la")
(chdir "./csgo-vulkan-fix")))))))))
(define-public hyprland-plugin-hyprbars
(package
(inherit hyprland-official-plugin)
(name "hyprland-plugin-hyprbars")
(arguments
(substitute-keyword-arguments
(package-arguments hyprland-official-plugin)
((#:phases oldphases #~%standard-phases)
#~(modify-phases #$oldphases
(add-after 'unpack 'chdir
(lambda _
(invoke "ls" "-la")
(chdir "./hyprbars")))))))))
(define-public hyprland-plugin-hyprexpo
(package
(inherit hyprland-official-plugin)
(name "hyprland-plugin-hyprexpo")
(arguments
(substitute-keyword-arguments
(package-arguments hyprland-official-plugin)
((#:phases oldphases #~%standard-phases)
#~(modify-phases #$oldphases
(add-after 'unpack 'chdir
(lambda _
(invoke "ls" "-la")
(chdir "./hyprexpo")))))))))
(define-public hyprland-plugin-hyprtrails
(package
(inherit hyprland-official-plugin)
(name "hyprland-plugin-hyprtrails")
(arguments
(substitute-keyword-arguments
(package-arguments hyprland-official-plugin)
((#:phases oldphases #~%standard-phases)
#~(modify-phases #$oldphases
(add-after 'unpack 'chdir
(lambda _
(invoke "ls" "-la")
(chdir "./hyprtrails")))))))))
(define-public hyprland-plugin-hyprwinwrap
(package
(inherit hyprland-official-plugin)
(name "hyprland-plugin-hyprwinwrap")
(arguments
(substitute-keyword-arguments
(package-arguments hyprland-official-plugin)
((#:phases oldphases #~%standard-phases)
#~(modify-phases #$oldphases
(add-after 'unpack 'chdir
(lambda _
(invoke "ls" "-la")
(chdir "./hyprwinwrap")))))))))
;;;; Third-party plugins
(define-public hyprland-plugin-hyprsplit
(package
(name "hyprland-plugin-hyprsplit")
(version "6b9db62fab91066bb678f14198771b8e8cc12a8f")
(source
(origin (method git-fetch)
(uri
(git-reference
(url "https://github.com/shezdy/hyprsplit.git")
(commit version)))
(sha256
(base32
"1zh5x83nfr5893snnz38kmxvj31m8n8pgjdd0759amm41f4gw3ia"))))
(build-system meson-build-system)
(arguments
(list
#:configure-flags #~(list
"-Dcpp_std=none"
"-Dcpp_args=-std=gnu++2b")
#:phases #~(modify-phases %standard-phases
(delete 'check))))
(propagated-inputs
(list hyprland))
(native-inputs
(list utils:cmake
gcc-13
pkg-config
wayland))
(inputs
(list cairo
hyprlang
libdrm-for-hyprland
libinput
libxkbcommon
xcb-util
xcb-util-wm
mesa
pixman))
(home-page "https://github.com/shezdy/hyprsplit")
(synopsis "hyprland plugin for separate sets of workspaces on each monitor")
(description "A complete rewrite of split-monitor-workspaces that attempts to fix the issues I experienced with it.")
(license license:bsd-3)))
(define-public hyprland-xwayland-plugin-hyprsplit
(package
(inherit hyprland-plugin-hyprsplit)
(name "hyprland-xwayland-plugin-hyprsplit")
(propagated-inputs
(modify-inputs (package-propagated-inputs hyprland-plugin-hyprsplit)
(replace "hyprland" hyprland-xwayland)))))
;;; Hypr Ecosystem
(define-public hyprpaper
(package
(name "hyprpaper")
(version "0.6.0")
(source
(origin
(method git-fetch)
(uri
(git-reference
(url "https://github.com/hyprwm/hyprpaper.git")
(commit
(string-append "v" version))))
(sha256
(base32
"0bcb2jfnw5752h3lyflvl12v9m61yrdmff1ry2y98m42v1l6gb4s"))))
(build-system cmake-build-system)
(arguments
(list
#:phases
#~(modify-phases %standard-phases
(add-before 'configure 'generate-protocols
(lambda _
(setenv "CC" "gcc")
(invoke "make" "protocols")))
(replace 'install
(lambda _
(let*
((output
(assoc-ref %outputs "out"))
(out-bin
(string-append output "/bin")))
(use-modules
(guix build utils))
(invoke "ls")
(install-file "./hyprpaper"
out-bin))))
(delete 'check))))
(native-inputs
(list gcc-13
pkg-config))
(inputs
(list cairo
mesa
rosenthal:hyprland-protocols
wayland-protocols-for-hyprland
file
libglvnd
libjpeg-turbo
libwebp
hyprlang
pango
wayland))
(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)))
(define-public hyprpicker
(package
(name "hyprpicker")
(version "0.2.0")
(source
(origin (method git-fetch)
(uri (git-reference
(url "https://github.com/hyprwm/hyprpicker")
(commit (string-append "v" version))))
(file-name
(git-file-name name version))
(sha256
(base32
"12wkvwdxbv6ni292575vg3j06qdmljw5mydh8i4x2qrfpi5kqavg"))))
(build-system cmake-build-system)
(native-inputs
(list utils:cmake
pkg-config))
(inputs
(list cairo
hyprland
rosenthal:hyprland-protocols
pango
libjpeg-turbo
libxkbcommon
wayland-protocols-for-hyprland
wayland))
(home-page "https://github.com/hyprwm/hyprpicker")
(synopsis "A wlroots-compatible Wayland color picker that does not suck")
(description "A wlroots-compatible Wayland color picker that does not suck.")
(license license:bsd-3)))
(define-public hypridle
(package
(name "hypridle")
(version "0.1.2")
(source
(origin
(method git-fetch)
(uri
(git-reference
(url "https://github.com/hyprwm/hypridle.git")
(commit
(string-append "v" version))))
(sha256
(base32
"10l0yxy1avryjj54gimw2blhl7348dypyhh43b73a8ncjicpjnzc"))))
(build-system cmake-build-system)
(arguments
(list
#:phases #~(modify-phases %standard-phases
(delete 'check))))
(native-inputs
(list gcc-13
pkg-config))
(inputs
(list hyprlang
sdbus-c++
wayland-protocols-for-hyprland
wayland))
(home-page "https://github.com/hyprwm/hypridle")
(synopsis "Hyprland's idle daemon")
(description "Hyprland's idle daemon.")
(license license:bsd-3)))
(define-public hyprlock
(package
(name "hyprlock")
(version "0.3.0")
(source
(origin
(method git-fetch)
(uri
(git-reference
(url "https://github.com/hyprwm/hyprlock.git")
(commit
(string-append "v" version))))
(sha256
(base32
"0w2a25hivn8xd8p05vc9xg57rd9siv12dwmr4skpqx4dcmxxbg5d"))))
(build-system cmake-build-system)
(arguments
(list
#:parallel-build? #t
#:phases #~(modify-phases
%standard-phases
(delete 'check)
;; https://github.com/hyprwm/hyprlock/issues/220
(add-after 'unpack 'patch-cmakelists
(lambda _
(invoke "sed" "-zi" "s/install(CODE.*)/install(FILES \"${CMAKE_SOURCE_DIR}\\/pam\\/hyprlock\" DESTINATION \"${CMAKE_INSTALL_FULL_SYSCONFDIR}\\/pam.d\")/" "CMakeLists.txt")
(invoke "cat" "CMakeLists.txt"))))))
(native-inputs
(list gcc-13
pkg-config))
(propagated-inputs
(list hyprlang
wayland
egl-wayland
eglexternalplatform))
(inputs
(list cairo
pango
linux-pam
libglvnd
pixman
mesa
libdrm-for-hyprland
libxkbcommon
wayland-protocols-for-hyprland))
(home-page "https://github.com/hyprwm/hyprlock")
(synopsis "Hyprland's GPU-accelerated screen locking utility")
(description "Hyprland's simple, yet multi-threaded and GPU-accelerated screen locking utility.")
(license license:bsd-3)))
(define-public xdg-desktop-portal-hyprland
(package
(name "xdg-desktop-portal-hyprland")
(version "1.3.1")
(source
(origin
(method git-fetch)
(uri
(git-reference
(url "https://github.com/hyprwm/xdg-desktop-portal-hyprland")
(commit
(string-append "v" version))))
(file-name
(git-file-name name version))
(sha256
(base32
"0fdbzxanmmzrvb9wfzg1pdsnlg7dl6v5k8bl44w10n48s7bbbzn0"))))
(build-system qt-build-system)
(arguments
(list #:tests? #f ;No tests
#:qtbase qtbase
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'fix-path
(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)))
(("\\<(hyprland-share-picker)\\>" _ cmd)
(string-append #$output "/bin/" cmd))))))))
(native-inputs
(list gcc-13 pkg-config wayland))
(inputs
(list bash-minimal
grim
hyprland
rosenthal:hyprland-protocols
hyprlang
mesa
pipewire
qtwayland
sdbus-c++
slurp
wayland-protocols))
(home-page "https://github.com/hyprwm/xdg-desktop-portal-hyprland")
(synopsis "XDG Desktop Portal backend for Hyprland")
(description
"This package provides @code{xdg-desktop-portal-hyprland}, which extends
@code{xdg-desktop-portal-wlr} for Hyprland with support for
@code{xdg-desktop-portal} screenshot and casting interfaces, while adding a few
extra portals specific to Hyprland, mostly for window sharing.")
(license license:bsd-3)))