guix-dotfiles/modules/ryan-packages/freedesktop.scm

212 lines
9 KiB
Scheme
Raw Normal View History

2023-05-18 19:51:25 +00:00
(define-module (ryan-packages freedesktop)
#:use-module (guix download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix gexp)
#:use-module (guix build-system meson)
#:use-module (guix build-system qt)
2023-09-09 00:48:33 +00:00
#:use-module (guix build-system cmake)
#:use-module (guix build utils)
#:use-module (guix build glib-or-gtk-build-system)
2023-05-18 19:51:25 +00:00
#:use-module (guix packages)
#:use-module (guix git-download)
#:use-module (guix utils)
#:use-module (gnu packages)
#:use-module (gnu packages gl)
#:use-module (gnu packages linux)
2023-08-08 04:03:07 +00:00
#:use-module (gnu packages image)
#:use-module (gnu packages qt)
#:use-module (gnu packages cmake)
#:use-module (gnu packages pkg-config)
2023-05-18 19:51:25 +00:00
#:use-module (gnu packages freedesktop)
2023-09-25 18:42:43 +00:00
#:use-module (gnu packages bash)
2023-09-09 00:48:33 +00:00
#:use-module (gnu packages xorg)
2023-09-25 18:42:43 +00:00
#:use-module (gnu packages glib)
2023-09-09 00:48:33 +00:00
#:use-module (gnu packages man)
#:use-module (rosenthal packages wm)
2023-05-18 19:51:25 +00:00
#:use-module (gnu packages wm))
(define-public xdg-desktop-portal-wlr-new
(package
(inherit xdg-desktop-portal-wlr)
(version "0.7.0")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/emersion/xdg-desktop-portal-wlr")
(commit (string-append "v" version))))
(sha256
(base32
"1b3hpp3ybjgnnmnwsyb5bsnvz9q5nr3zz0j1alh02g24f68lf00k"))
(patches (search-patches "xdg-desktop-portal-wlr-harcoded-length.patch"))))
(native-inputs (modify-inputs (package-native-inputs xdg-desktop-portal-wlr)
(append wlroots)))))
2023-09-25 18:42:43 +00:00
(define xdg-desktop-portal-hyprland-old-original
(package
(name "xdg-desktop-portal-hyprland")
2023-08-08 03:38:44 +00:00
(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
2023-08-08 03:38:44 +00:00
"1dmgc0w4wjj9hwqg17wg529v8sbxr6czp9s319d5407jm780x40b"))))
(build-system meson-build-system)
(arguments
(list
#:modules
'((guix build utils)
(guix build meson-build-system)
((guix build qt-build-system) #:prefix qt:))
#:imported-modules
(append %meson-build-system-modules
%qt-build-system-modules)
#:tests? #f
#:configure-flags #~(list "-Dsystemd=disabled")
#:phases
;; After building the portal, we need to build the share selector using qt
#~(modify-phases %standard-phases
(add-after 'install 'chdir
(lambda _ (chdir "../source/hyprland-share-picker/")))
(add-after 'chdir 'check-setup
(assoc-ref qt:%standard-phases 'check-setup))
2023-08-08 03:38:44 +00:00
(add-after 'check-setup 'qt-build
(lambda* (#:key inputs outputs #:allow-other-keys)
((assoc-ref qt:%standard-phases 'build)
#:inputs inputs
#:outputs outputs
#:configure-flags '()
2023-08-08 04:03:07 +00:00
#:qtbase #$(this-package-native-input "qtbase-5"))))
(add-after 'qt-build 'qt-install
2023-08-08 03:38:44 +00:00
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((share-picker (string-append (assoc-ref outputs "out")
"/bin")))
(install-file "build/hyprland-share-picker" share-picker)
#t)))
(add-after 'qt-install 'qt-wrap
2023-08-08 04:03:07 +00:00
(assoc-ref qt:%standard-phases 'qt-wrap))
(add-after 'qt-wrap 'dep-wrap
(lambda* (#:key inputs #:allow-other-keys)
(let ((hyprland-share-picker (string-append #$output "/bin/hyprland-share-picker")))
(wrap-program hyprland-share-picker
`("PATH" suffix
,(map (lambda (program)
(dirname (search-input-file
inputs (string-append "/bin/" program))))
'("slurp"))))))))))
(native-inputs (list cmake pkg-config qtbase-5))
(inputs (list elogind hyprland hyprland-protocols slurp pipewire wayland-protocols wayland libinih mesa qtwayland-5 `(,util-linux "lib")))
(home-page "")
(synopsis "test")
(description "test")
(license license:bsd-3)))
2023-09-09 00:48:33 +00:00
(define-public wl-mirror
(package
(name "wl-mirror")
(version "0.13.2")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/Ferdi265/wl-mirror")
(commit (string-append "v" version))
(recursive? #t)))
(file-name (git-file-name name version))
(sha256
(base32
"0vkd73x5r2585s3w1ckvslc2mq9qbzrm5xkwg8gpy9ydaxhn8hmp"))))
(inputs (list wayland egl-wayland mesa))
(native-inputs (list pkg-config scdoc wayland-protocols))
(build-system cmake-build-system)
(arguments (list
#:tests? #f
#:phases
#~(modify-phases %standard-phases
(add-before 'configure 'touch
(lambda _
(invoke "touch" "proto/wayland-protocols/.git")
(invoke "touch" "proto/wlr-protocols/.git"))))))
(home-page "bleh")
(synopsis "mirror displays")
(description "mirror displays")
(license license:expat)))
2023-09-25 18:42:43 +00:00
(define-public xdg-desktop-portal-hyprland
(package
(name "xdg-desktop-portal-hyprland")
(version "1.1.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
"05gcdg3fw7plc9fri6rpq9la1xjij93jqkqmq57mrqjgwg3jlmrb"))))
(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
sdbus-c++
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)))
xdg-desktop-portal-hyprland