summaryrefslogtreecommitdiff
path: root/modules/ryan-packages/freedesktop.scm
blob: 7fb065237b6948cdb96330f88ca186c71db82464 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
(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)
                #:use-module (guix build-system cmake)
                #:use-module (guix build utils)
                #:use-module (guix build glib-or-gtk-build-system)
                #: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)
                #:use-module (gnu packages image)
                #:use-module (gnu packages qt)
                #:use-module (gnu packages cmake)
                #:use-module (gnu packages pkg-config)
                #:use-module (gnu packages freedesktop)
                #:use-module (gnu packages xorg)
                #:use-module (gnu packages man)
                #:use-module (rosenthal packages wm)
                #: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)))))

(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
        #: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))
            (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 '()
                 #:qtbase #$(this-package-native-input "qtbase-5"))))
            (add-after 'qt-build 'qt-install
              (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
              (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)))

(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)))

wl-mirror