modules/ryan-packages/freedesktop.scm

1e3c6cd94583f8b4c7314dd5f5c0b332c5206445 · 4.4 KB · 100 lines raw

1 (define-module (ryan-packages freedesktop)
2 #:use-module (guix download)
3 #:use-module ((guix licenses) #:prefix license:)
4 #:use-module (guix gexp)
5 #:use-module (guix build-system meson)
6 #:use-module (guix build-system qt)
7 #:use-module (guix packages)
8 #:use-module (guix git-download)
9 #:use-module (guix utils)
10 #:use-module (gnu packages)
11 #:use-module (gnu packages gl)
12 #:use-module (gnu packages linux)
13 #:use-module (gnu packages image)
14 #:use-module (gnu packages qt)
15 #:use-module (gnu packages cmake)
16 #:use-module (gnu packages pkg-config)
17 #:use-module (gnu packages freedesktop)
18 #:use-module (rosenthal packages wm)
19 #:use-module (gnu packages wm))
20
21 (define-public xdg-desktop-portal-wlr-new
22 (package
23 (inherit xdg-desktop-portal-wlr)
24 (version "0.7.0")
25 (source (origin
26 (method git-fetch)
27 (uri (git-reference
28 (url "https://github.com/emersion/xdg-desktop-portal-wlr")
29 (commit (string-append "v" version))))
30 (sha256
31 (base32
32 "1b3hpp3ybjgnnmnwsyb5bsnvz9q5nr3zz0j1alh02g24f68lf00k"))
33 (patches (search-patches "xdg-desktop-portal-wlr-harcoded-length.patch"))))
34 (native-inputs (modify-inputs (package-native-inputs xdg-desktop-portal-wlr)
35 (append wlroots)))))
36
37 (define-public xdg-desktop-portal-hyprland
38 (package
39 (name "xdg-desktop-portal-hyprland")
40 (version "0.5.0")
41 (source (origin
42 (method git-fetch)
43 (uri (git-reference
44 (url "https://github.com/hyprwm/xdg-desktop-portal-hyprland")
45 (commit (string-append "v" version))))
46 (file-name (git-file-name name version))
47 (sha256
48 (base32
49 "1dmgc0w4wjj9hwqg17wg529v8sbxr6czp9s319d5407jm780x40b"))))
50 (build-system meson-build-system)
51 (arguments
52 (list
53 #:modules
54 '((guix build utils)
55 (guix build meson-build-system)
56 ((guix build qt-build-system) #:prefix qt:))
57 #:imported-modules
58 (append %meson-build-system-modules
59 %qt-build-system-modules)
60 #:tests? #f
61 #:configure-flags #~(list "-Dsystemd=disabled")
62 #:phases
63 ;; After building the portal, we need to build the share selector using qt
64 #~(modify-phases %standard-phases
65 (add-after 'install 'chdir
66 (lambda _ (chdir "../source/hyprland-share-picker/")))
67 (add-after 'chdir 'check-setup
68 (assoc-ref qt:%standard-phases 'check-setup))
69 (add-after 'check-setup 'qt-build
70 (lambda* (#:key inputs outputs #:allow-other-keys)
71 ((assoc-ref qt:%standard-phases 'build)
72 #:inputs inputs
73 #:outputs outputs
74 #:configure-flags '()
75 #:qtbase #$(this-package-native-input "qtbase-5"))))
76 (add-after 'qt-build 'qt-install
77 (lambda* (#:key inputs outputs #:allow-other-keys)
78 (let ((share-picker (string-append (assoc-ref outputs "out")
79 "/bin")))
80 (install-file "build/hyprland-share-picker" share-picker)
81 #t)))
82 (add-after 'qt-install 'qt-wrap
83 (assoc-ref qt:%standard-phases 'qt-wrap))
84 (add-after 'qt-wrap 'dep-wrap
85 (lambda* (#:key inputs #:allow-other-keys)
86 (let ((hyprland-share-picker (string-append #$output "/bin/hyprland-share-picker")))
87 (wrap-program hyprland-share-picker
88 `("PATH" suffix
89 ,(map (lambda (program)
90 (dirname (search-input-file
91 inputs (string-append "/bin/" program))))
92 '("slurp"))))))))))
93 (native-inputs (list cmake pkg-config qtbase-5))
94 (inputs (list elogind hyprland hyprland-protocols slurp pipewire wayland-protocols wayland libinih mesa qtwayland-5 `(,util-linux "lib")))
95 (home-page "")
96 (synopsis "test")
97 (description "test")
98 (license license:bsd-3)))
99
100 xdg-desktop-portal-hyprland