aboutsummaryrefslogtreecommitdiff
path: root/tw/packages/zoom.scm
blob: be64d4d254725a517bc79814ecdaf86d6135a431 (about) (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
136
137
138
139
140
141
(define-module (tw packages zoom)
  #:use-module (ice-9 match)
  #:use-module (nongnu packages messaging)
  #:use-module (guix gexp)
  #:use-module (guix packages))

;; One Wayland, Zoom needs two extra environment variables to be set:
;; - XDG_CURRENT_DESKTOP=GNOME (to get past the refusal to try sharing the screen)
;; - QT_QPA_PLATFORM= (since QT_QPA_PLATFORM=wayland makes zoom fail to start)
;; The following package definition patches it to set those variables.

(define plist-delete
  (match-lambda*
    ((() _) '())
    (((unpaired-item) _)
     (error "Found unpaired item in plist" unpaired-item))
    (((key-to-delete _ . rest) key-to-delete)
     (plist-delete rest key-to-delete))
    (((key value . rest) key-to-delete)
     (cons* key value (plist-delete rest key-to-delete)))))

(define-public zoom/wayland
  (package
    (inherit zoom)
    (arguments
     (apply
      (lambda* (#:key phases #:allow-other-keys . args)
        (cons*
         #:phases
         #~(modify-phases #$phases
             (replace 'wrap-where-patchelf-does-not-work
               (lambda _
                 (wrap-program (string-append #$output "/lib/zoom/zopen")
                   `("LD_LIBRARY_PATH" prefix
                     ,(list #$@(map (lambda (pkg)
                                      (file-append (this-package-input pkg) "/lib"))
                                    '("fontconfig-minimal"
                                      "freetype"
                                      "gcc"
                                      "glib"
                                      "libxcomposite"
                                      "libxdamage"
                                      "libxkbcommon"
                                      "libxkbfile"
                                      "libxrandr"
                                      "libxrender"
                                      "zlib")))))
                 (wrap-program (string-append #$output "/lib/zoom/zoom")
                   '("XDG_CURRENT_DESKTOP" = ("GNOME")) ; tw: added
                   '("QT_QPA_PLATFORM" = ())            ; tw: added
                   '("QML2_IMPORT_PATH" = ())
                   '("QT_PLUGIN_PATH" = ())
                   '("QT_SCREEN_SCALE_FACTORS" = ())
                   `("FONTCONFIG_PATH" ":" prefix
                     (,(string-join
                        (list
                         (string-append #$(this-package-input "fontconfig-minimal") "/etc/fonts")
                         #$output)
                        ":")))
                   `("LD_LIBRARY_PATH" prefix
                     ,(list (string-append #$(this-package-input "nss") "/lib/nss")
                            #$@(map (lambda (pkg)
                                      (file-append (this-package-input pkg) "/lib"))
                                    ;; TODO: Reuse this long list as it is
                                    ;; needed for aomhost.  Or perhaps
                                    ;; aomhost has a shorter needed list,
                                    ;; but untested.
                                    '("alsa-lib"
                                      "atk"
                                      "at-spi2-atk"
                                      "at-spi2-core"
                                      "cairo"
                                      "cups"
                                      "dbus"
                                      "eudev"
                                      "expat"
                                      "gcc"
                                      "glib"
                                      "mesa"
                                      "mit-krb5"
                                      "nspr"
                                      "libxcb"
                                      "libxcomposite"
                                      "libxdamage"
                                      "libxext"
                                      "libxkbcommon"
                                      "libxkbfile"
                                      "libxrandr"
                                      "libxshmfence"
                                      "pango"
                                      "pulseaudio"
                                      "xcb-util"
                                      "xcb-util-image"
                                      "xcb-util-keysyms"
                                      "xcb-util-wm"
                                      "xcb-util-renderutil"
                                      "zlib")))))
                 (wrap-program (string-append #$output "/lib/zoom/aomhost")
                   `("FONTCONFIG_PATH" ":" prefix
                     (,(string-join
                        (list
                         (string-append #$(this-package-input "fontconfig-minimal") "/etc/fonts")
                         #$output)
                        ":")))
                   `("LD_LIBRARY_PATH" prefix
                     ,(list (string-append #$(this-package-input "nss") "/lib/nss")
                            #$@(map (lambda (pkg)
                                      (file-append (this-package-input pkg) "/lib"))
                                    '("alsa-lib"
                                      "atk"
                                      "at-spi2-atk"
                                      "at-spi2-core"
                                      "cairo"
                                      "cups"
                                      "dbus"
                                      "eudev"
                                      "expat"
                                      "gcc"
                                      "glib"
                                      "mesa"
                                      "mit-krb5"
                                      "nspr"
                                      "libxcb"
                                      "libxcomposite"
                                      "libxdamage"
                                      "libxext"
                                      "libxkbcommon"
                                      "libxkbfile"
                                      "libxrandr"
                                      "libxshmfence"
                                      "pango"
                                      "pulseaudio"
                                      "xcb-util"
                                      "xcb-util-image"
                                      "xcb-util-keysyms"
                                      "xcb-util-wm"
                                      "xcb-util-renderutil"
                                      "zlib"))))))))
         ;; ARGS still contains the old "#:phases ..." entry, so delete it.
         (plist-delete args #:phases)))
      (package-arguments zoom)))))