rosenthal: Add xdg-desktop-portal-hyprland

* rosenthal/packages/wm.scm (xdg-desktop-portal-hyprland): New variable.

Signed-off-by: Hilton Chain <hako@ultrarare.space>
pull/2/head
Ryan Schanzenbacher 1 year ago committed by Hilton Chain
parent 8d4e983bd3
commit bd96a46416
No known key found for this signature in database
GPG Key ID: ACC66D09CA528292
  1. 80
      rosenthal/packages/wm.scm

@ -6,21 +6,28 @@
#:use-module ((guix licenses) #:prefix license:) #:use-module ((guix licenses) #:prefix license:)
#:use-module (guix build-system gnu) #:use-module (guix build-system gnu)
#:use-module (guix build-system meson) #:use-module (guix build-system meson)
#:use-module (guix build-system qt)
#:use-module (guix download) #:use-module (guix download)
#:use-module (guix gexp) #:use-module (guix gexp)
#:use-module (guix git-download) #:use-module (guix git-download)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix utils) #:use-module (guix utils)
#:use-module (gnu packages autotools) #:use-module (gnu packages autotools)
#:use-module (gnu packages bash)
#:use-module (gnu packages cmake)
#:use-module (gnu packages freedesktop)
#:use-module (gnu packages gcc) #:use-module (gnu packages gcc)
#:use-module (gnu packages gl)
#:use-module (gnu packages gnome) #:use-module (gnu packages gnome)
#:use-module (gnu packages gtk) #:use-module (gnu packages gtk)
#:use-module (gnu packages guile) #:use-module (gnu packages guile)
#:use-module (gnu packages image) #:use-module (gnu packages image)
#:use-module (gnu packages linux)
#:use-module (gnu packages man) #:use-module (gnu packages man)
#:use-module (gnu packages pciutils) #:use-module (gnu packages pciutils)
#:use-module (gnu packages pkg-config) #:use-module (gnu packages pkg-config)
#:use-module (gnu packages python) #:use-module (gnu packages python)
#:use-module (gnu packages qt)
#:use-module (gnu packages web) #:use-module (gnu packages web)
#:use-module (gnu packages wm) #:use-module (gnu packages wm)
#:use-module (gnu packages xdisorg) #:use-module (gnu packages xdisorg)
@ -250,3 +257,76 @@ customization, and more.")
(synopsis "Hyprland version of Grimshot") (synopsis "Hyprland version of Grimshot")
(description "A Hyprland version of Grimshot.") (description "A Hyprland version of Grimshot.")
(license license:expat))) (license license:expat)))
(define-public xdg-desktop-portal-hyprland
(package
(name "xdg-desktop-portal-hyprland")
(version "0.5.0")
(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
"1dmgc0w4wjj9hwqg17wg529v8sbxr6czp9s319d5407jm780x40b"))))
(build-system meson-build-system)
(arguments
(list #:imported-modules
(append %meson-build-system-modules
%qt-build-system-modules)
#:modules
'((guix build utils)
(guix build meson-build-system)
((guix build qt-build-system) #:prefix qt:))
#:tests? #f ;No tests
#: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|slurp)\\>" _ cmd)
(search-input-file inputs (string-append "/bin/" cmd)))
(("\"(hyprland-share-picker)\"" _ cmd)
(string-append "\"" #$output "/bin/" cmd "\"")))))
;; After building the portal, we need to build the share selector
;; using qt
(add-after 'install 'chdir
(lambda _
(chdir "../source/hyprland-share-picker/")))
(add-after 'chdir 'qt-build
(lambda* (#:key (make-flags '()) (parallel-build? #t)
#:allow-other-keys)
((assoc-ref qt:%standard-phases 'build)
#:make-flags make-flags
#:parallel-build? parallel-build?)))
(add-after 'qt-build 'install-hyprland-share-picker
(lambda _
(install-file "build/hyprland-share-picker"
(string-append #$output "/bin"))))
(add-after 'install-hyprland-share-picker 'qt-wrap
(assoc-ref qt:%standard-phases 'qt-wrap)))))
(native-inputs (list cmake-minimal pkg-config))
(inputs
(list bash-minimal
basu
grim
hyprland-protocols
libinih
mesa
pipewire
qtbase-5
slurp
`(,util-linux "lib")
wayland
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:expat)))

Loading…
Cancel
Save