Archived
1
0
Fork 0

gnu: icedove-wayland: Refactor as a wrapper around icedove.

This saves us a full build of icedove-wayland analogue to
chromium-wayland.

* gnu/packages/gnuzilla.scm (icedove-wayland)[inputs]: Add bash and
icedove.
[arguments]: Copy the binary over and wrap it for Wayland. As well as
the desktop-file and the license file.
This commit is contained in:
Jonathan Brielmaier 2021-06-06 11:13:35 +02:00
parent b65c02e2d3
commit db8ea15ba0
No known key found for this signature in database
GPG key ID: ECFC83988B4E4B9F

View file

@ -1618,25 +1618,40 @@ Thunderbird. It supports email, news feeds, chat, calendar and contacts.")
(license license:mpl2.0))) (license license:mpl2.0)))
(define-public icedove/wayland (define-public icedove/wayland
(package/inherit icedove (package
(inherit icedove)
(name "icedove-wayland") (name "icedove-wayland")
(native-inputs '())
(inputs
`(("bash" ,bash-minimal)
("icedove" ,icedove)))
(build-system trivial-build-system)
(arguments (arguments
(substitute-keyword-arguments (package-arguments icedove) '(#:modules ((guix build utils))
((#:phases phases) #:builder
`(modify-phases ,phases (begin
(replace 'wrap-program (use-modules (guix build utils))
(lambda* (#:key inputs outputs #:allow-other-keys) (let* ((bash (assoc-ref %build-inputs "bash"))
(let* ((out (assoc-ref outputs "out")) (icedove (assoc-ref %build-inputs "icedove"))
(lib (string-append out "/lib")) (out (assoc-ref %outputs "out"))
(gtk (assoc-ref inputs "gtk+")) (exe (string-append out "/bin/icedove")))
(gtk-share (string-append gtk "/share")) (mkdir-p (dirname exe))
(pulseaudio (assoc-ref inputs "pulseaudio"))
(pulseaudio-lib (string-append pulseaudio "/lib"))) (call-with-output-file exe
(wrap-program (car (find-files lib "^icedove$")) (lambda (port)
`("MOZ_ENABLE_WAYLAND" = ("1")) (format port "#!~a
`("XDG_DATA_DIRS" prefix (,gtk-share)) MOZ_ENABLE_WAYLAND=1 exec ~a $@"
`("LD_LIBRARY_PATH" prefix (,pulseaudio-lib))) (string-append bash "/bin/bash")
#t))))))))) (string-append icedove "/bin/icedove"))))
(chmod exe #o555)
;; Provide the manual and .desktop file.
(copy-recursively (string-append icedove "/share")
(string-append out "/share"))
(substitute* (string-append
out "/share/applications/icedove.desktop")
((icedove) out))
#t))))))
(define-public firefox-decrypt (define-public firefox-decrypt
(package (package