From 5cc66880dddd3e8e7fee38152712ef44e326e9b5 Mon Sep 17 00:00:00 2001 From: Jonathan Brielmaier Date: Sun, 1 Nov 2020 19:21:00 +0100 Subject: nongnu: Add firefox-wayland. This gives us firefox with Wayland support. Especially usefull on HiDPI environments. * nongnu/packages/mozilla.scm (firefox/wayland): New variable. --- nongnu/packages/mozilla.scm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/nongnu/packages/mozilla.scm b/nongnu/packages/mozilla.scm index bd93b05..7c7971f 100644 --- a/nongnu/packages/mozilla.scm +++ b/nongnu/packages/mozilla.scm @@ -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))))))))) -- cgit v1.2.3