nongnu: Add firefox-wayland.

This gives us firefox with Wayland support. Especially usefull on HiDPI
environments.

* nongnu/packages/mozilla.scm (firefox/wayland): New variable.
This commit is contained in:
Jonathan Brielmaier 2020-11-01 19:21:00 +01:00
parent 8581fb999d
commit 5cc66880dd
No known key found for this signature in database
GPG key ID: ECFC83988B4E4B9F

View file

@ -415,3 +415,32 @@
"Full-featured browser client built from Firefox source tree, without
the official icon and the name \"firefox\".")
(license license:mpl2.0)))
(define-public firefox/wayland
(package/inherit firefox
(name "firefox-wayland")
(arguments
(substitute-keyword-arguments (package-arguments firefox)
((#:configure-flags flags)
`(append (list "--enable-default-toolkit=cairo-gtk3-wayland")
(delete "--enable-default-toolkit=cairo-gtk3" ,flags)))
;; We need to set the MOZ_ENABLE_WAYLAND env variable.
((#:phases phases)
`(modify-phases ,phases
(replace 'wrap-program
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(lib (string-append out "/lib"))
(ld-libs (map (lambda (x)
(string-append (assoc-ref inputs x)
"/lib"))
'("pulseaudio" "mesa")))
(gtk-share (string-append (assoc-ref inputs "gtk+")
"/share")))
(wrap-program (car (find-files lib "^firefox$"))
`("LD_LIBRARY_PATH" prefix ,ld-libs)
`("XDG_DATA_DIRS" prefix (,gtk-share))
`("MOZ_ENABLE_WAYLAND" = ("1"))
`("MOZ_LEGACY_PROFILES" = ("1"))
`("MOZ_ALLOW_DOWNGRADE" = ("1")))
#t)))))))))