modules/ryan-packages/freedesktop.scm
broken-new-portal
· 9.0 KB · 211 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 build-system cmake) |
| 8 | #:use-module (guix build utils) |
| 9 | #:use-module (guix build glib-or-gtk-build-system) |
| 10 | #:use-module (guix packages) |
| 11 | #:use-module (guix git-download) |
| 12 | #:use-module (guix utils) |
| 13 | #:use-module (gnu packages) |
| 14 | #:use-module (gnu packages gl) |
| 15 | #:use-module (gnu packages linux) |
| 16 | #:use-module (gnu packages image) |
| 17 | #:use-module (gnu packages qt) |
| 18 | #:use-module (gnu packages cmake) |
| 19 | #:use-module (gnu packages pkg-config) |
| 20 | #:use-module (gnu packages freedesktop) |
| 21 | #:use-module (gnu packages bash) |
| 22 | #:use-module (gnu packages xorg) |
| 23 | #:use-module (gnu packages glib) |
| 24 | #:use-module (gnu packages man) |
| 25 | #:use-module (rosenthal packages wm) |
| 26 | #:use-module (gnu packages wm)) |
| 27 | |
| 28 | (define-public xdg-desktop-portal-wlr-new |
| 29 | (package |
| 30 | (inherit xdg-desktop-portal-wlr) |
| 31 | (version "0.7.0") |
| 32 | (source (origin |
| 33 | (method git-fetch) |
| 34 | (uri (git-reference |
| 35 | (url "https://github.com/emersion/xdg-desktop-portal-wlr") |
| 36 | (commit (string-append "v" version)))) |
| 37 | (sha256 |
| 38 | (base32 |
| 39 | "1b3hpp3ybjgnnmnwsyb5bsnvz9q5nr3zz0j1alh02g24f68lf00k")) |
| 40 | (patches (search-patches "xdg-desktop-portal-wlr-harcoded-length.patch")))) |
| 41 | (native-inputs (modify-inputs (package-native-inputs xdg-desktop-portal-wlr) |
| 42 | (append wlroots))))) |
| 43 | |
| 44 | (define xdg-desktop-portal-hyprland-old-original |
| 45 | (package |
| 46 | (name "xdg-desktop-portal-hyprland") |
| 47 | (version "0.5.0") |
| 48 | (source (origin |
| 49 | (method git-fetch) |
| 50 | (uri (git-reference |
| 51 | (url "https://github.com/hyprwm/xdg-desktop-portal-hyprland") |
| 52 | (commit (string-append "v" version)))) |
| 53 | (file-name (git-file-name name version)) |
| 54 | (sha256 |
| 55 | (base32 |
| 56 | "1dmgc0w4wjj9hwqg17wg529v8sbxr6czp9s319d5407jm780x40b")))) |
| 57 | (build-system meson-build-system) |
| 58 | (arguments |
| 59 | (list |
| 60 | #:modules |
| 61 | '((guix build utils) |
| 62 | (guix build meson-build-system) |
| 63 | ((guix build qt-build-system) #:prefix qt:)) |
| 64 | #:imported-modules |
| 65 | (append %meson-build-system-modules |
| 66 | %qt-build-system-modules) |
| 67 | #:tests? #f |
| 68 | #:configure-flags #~(list "-Dsystemd=disabled") |
| 69 | #:phases |
| 70 | ;; After building the portal, we need to build the share selector using qt |
| 71 | #~(modify-phases %standard-phases |
| 72 | (add-after 'install 'chdir |
| 73 | (lambda _ (chdir "../source/hyprland-share-picker/"))) |
| 74 | (add-after 'chdir 'check-setup |
| 75 | (assoc-ref qt:%standard-phases 'check-setup)) |
| 76 | (add-after 'check-setup 'qt-build |
| 77 | (lambda* (#:key inputs outputs #:allow-other-keys) |
| 78 | ((assoc-ref qt:%standard-phases 'build) |
| 79 | #:inputs inputs |
| 80 | #:outputs outputs |
| 81 | #:configure-flags '() |
| 82 | #:qtbase #$(this-package-native-input "qtbase-5")))) |
| 83 | (add-after 'qt-build 'qt-install |
| 84 | (lambda* (#:key inputs outputs #:allow-other-keys) |
| 85 | (let ((share-picker (string-append (assoc-ref outputs "out") |
| 86 | "/bin"))) |
| 87 | (install-file "build/hyprland-share-picker" share-picker) |
| 88 | #t))) |
| 89 | (add-after 'qt-install 'qt-wrap |
| 90 | (assoc-ref qt:%standard-phases 'qt-wrap)) |
| 91 | (add-after 'qt-wrap 'dep-wrap |
| 92 | (lambda* (#:key inputs #:allow-other-keys) |
| 93 | (let ((hyprland-share-picker (string-append #$output "/bin/hyprland-share-picker"))) |
| 94 | (wrap-program hyprland-share-picker |
| 95 | `("PATH" suffix |
| 96 | ,(map (lambda (program) |
| 97 | (dirname (search-input-file |
| 98 | inputs (string-append "/bin/" program)))) |
| 99 | '("slurp")))))))))) |
| 100 | (native-inputs (list cmake pkg-config qtbase-5)) |
| 101 | (inputs (list elogind hyprland hyprland-protocols slurp pipewire wayland-protocols wayland libinih mesa qtwayland-5 `(,util-linux "lib"))) |
| 102 | (home-page "") |
| 103 | (synopsis "test") |
| 104 | (description "test") |
| 105 | (license license:bsd-3))) |
| 106 | |
| 107 | (define-public wl-mirror |
| 108 | (package |
| 109 | (name "wl-mirror") |
| 110 | (version "0.13.2") |
| 111 | (source (origin |
| 112 | (method git-fetch) |
| 113 | (uri (git-reference |
| 114 | (url "https://github.com/Ferdi265/wl-mirror") |
| 115 | (commit (string-append "v" version)) |
| 116 | (recursive? #t))) |
| 117 | (file-name (git-file-name name version)) |
| 118 | (sha256 |
| 119 | (base32 |
| 120 | "0vkd73x5r2585s3w1ckvslc2mq9qbzrm5xkwg8gpy9ydaxhn8hmp")))) |
| 121 | (inputs (list wayland egl-wayland mesa)) |
| 122 | (native-inputs (list pkg-config scdoc wayland-protocols)) |
| 123 | (build-system cmake-build-system) |
| 124 | (arguments (list |
| 125 | #:tests? #f |
| 126 | #:phases |
| 127 | #~(modify-phases %standard-phases |
| 128 | (add-before 'configure 'touch |
| 129 | (lambda _ |
| 130 | (invoke "touch" "proto/wayland-protocols/.git") |
| 131 | (invoke "touch" "proto/wlr-protocols/.git")))))) |
| 132 | (home-page "bleh") |
| 133 | (synopsis "mirror displays") |
| 134 | (description "mirror displays") |
| 135 | (license license:expat))) |
| 136 | |
| 137 | (define-public xdg-desktop-portal-hyprland |
| 138 | (package |
| 139 | (name "xdg-desktop-portal-hyprland") |
| 140 | (version "1.1.0") |
| 141 | (source (origin |
| 142 | (method git-fetch) |
| 143 | (uri (git-reference |
| 144 | (url "https://github.com/hyprwm/xdg-desktop-portal-hyprland") |
| 145 | (commit (string-append "v" version)))) |
| 146 | (file-name (git-file-name name version)) |
| 147 | (sha256 |
| 148 | (base32 |
| 149 | "05gcdg3fw7plc9fri6rpq9la1xjij93jqkqmq57mrqjgwg3jlmrb")))) |
| 150 | (build-system meson-build-system) |
| 151 | (arguments |
| 152 | (list #:imported-modules |
| 153 | (append %meson-build-system-modules |
| 154 | %qt-build-system-modules) |
| 155 | #:modules |
| 156 | '((guix build utils) |
| 157 | (guix build meson-build-system) |
| 158 | ((guix build qt-build-system) #:prefix qt:)) |
| 159 | #:tests? #f ;No tests |
| 160 | #:phases |
| 161 | #~(modify-phases %standard-phases |
| 162 | (add-after 'unpack 'fix-path |
| 163 | (lambda* (#:key inputs #:allow-other-keys) |
| 164 | (substitute* (find-files "." "\\.cp?*$") |
| 165 | (("/bin/sh") "sh") |
| 166 | (("\\<(sh|grim|slurp)\\>" _ cmd) |
| 167 | (search-input-file inputs (string-append "/bin/" cmd))) |
| 168 | (("\"(hyprland-share-picker)\"" _ cmd) |
| 169 | (string-append "\"" #$output "/bin/" cmd "\""))))) |
| 170 | ;; After building the portal, we need to build the share selector |
| 171 | ;; using qt |
| 172 | (add-after 'install 'chdir |
| 173 | (lambda _ |
| 174 | (chdir "../source/hyprland-share-picker/"))) |
| 175 | (add-after 'chdir 'qt-build |
| 176 | (lambda* (#:key (make-flags '()) (parallel-build? #t) |
| 177 | #:allow-other-keys) |
| 178 | ((assoc-ref qt:%standard-phases 'build) |
| 179 | #:make-flags make-flags |
| 180 | #:parallel-build? parallel-build?))) |
| 181 | (add-after 'qt-build 'install-hyprland-share-picker |
| 182 | (lambda _ |
| 183 | (install-file "build/hyprland-share-picker" |
| 184 | (string-append #$output "/bin")))) |
| 185 | (add-after 'install-hyprland-share-picker 'qt-wrap |
| 186 | (assoc-ref qt:%standard-phases 'qt-wrap))))) |
| 187 | (native-inputs (list cmake-minimal pkg-config)) |
| 188 | (inputs |
| 189 | (list bash-minimal |
| 190 | basu |
| 191 | grim |
| 192 | hyprland-protocols |
| 193 | libinih |
| 194 | mesa |
| 195 | pipewire |
| 196 | sdbus-c++ |
| 197 | qtbase-5 |
| 198 | slurp |
| 199 | `(,util-linux "lib") |
| 200 | wayland |
| 201 | wayland-protocols)) |
| 202 | (home-page "https://github.com/hyprwm/xdg-desktop-portal-hyprland") |
| 203 | (synopsis "XDG Desktop Portal backend for Hyprland") |
| 204 | (description |
| 205 | "This package provides @code{xdg-desktop-portal-hyprland}, which extends |
| 206 | @code{xdg-desktop-portal-wlr} for Hyprland with support for |
| 207 | @code{xdg-desktop-portal} screenshot and casting interfaces, while adding a few |
| 208 | extra portals specific to Hyprland, mostly for window sharing.") |
| 209 | (license license:expat))) |
| 210 | |
| 211 | xdg-desktop-portal-hyprland |