summaryrefslogtreecommitdiff
path: root/nongnu/packages/mozilla.scm
diff options
context:
space:
mode:
Diffstat (limited to 'nongnu/packages/mozilla.scm')
-rw-r--r--nongnu/packages/mozilla.scm274
1 files changed, 58 insertions, 216 deletions
diff --git a/nongnu/packages/mozilla.scm b/nongnu/packages/mozilla.scm
index ee1977e..035b13e 100644
--- a/nongnu/packages/mozilla.scm
+++ b/nongnu/packages/mozilla.scm
@@ -1,7 +1,7 @@
-;;; GNU Guix --- Functional package management for GNU
+;;; SPDX-License-Identifier: GPL-3.0-or-later
;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
-;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
;;; Copyright © 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
@@ -14,27 +14,12 @@
;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
;;; Copyright © 2019, 2020 Adrian Malacoda <malacoda@monarch-pass.net>
-;;; Copyright © 2020-2022 Jonathan Brielmaier <jonathan.brielmaier@web.de>
+;;; Copyright © 2020-2023 Jonathan Brielmaier <jonathan.brielmaier@web.de>
;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
;;; Copyright © 2021 pineapples <guixuser6392@protonmail.com>
;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
-;;; Copyright © 2021, 2022 John Kehayias <john.kehayias@protonmail.com>
+;;; Copyright © 2021, 2022, 2023 John Kehayias <john.kehayias@protonmail.com>
;;; Copyright © 2022 Pierre Langlois <pierre.langlois@gmx.com>
-;;;
-;;; This file is not part of GNU Guix.
-;;;
-;;; GNU Guix is free software; you can redistribute it and/or modify it
-;;; under the terms of the GNU General Public License as published by
-;;; the Free Software Foundation; either version 3 of the License, or (at
-;;; your option) any later version.
-;;;
-;;; GNU Guix is distributed in the hope that it will be useful, but
-;;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;;; GNU General Public License for more details.
-;;;
-;;; You should have received a copy of the GNU General Public License
-;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (nongnu packages mozilla)
#:use-module (guix build-system gnu)
@@ -60,6 +45,7 @@
#:use-module (gnu packages glib)
#:use-module (gnu packages gnome)
#:use-module (gnu packages gtk)
+ #:use-module (gnu packages hunspell)
#:use-module (gnu packages icu4c)
#:use-module (gnu packages image)
#:use-module (gnu packages jemalloc)
@@ -67,7 +53,6 @@
#:use-module (gnu packages libcanberra)
#:use-module (gnu packages libevent)
#:use-module (gnu packages libffi)
- #:use-module (gnu packages libreoffice) ;for hunspell
#:use-module (gnu packages linux)
#:use-module (gnu packages llvm)
#:use-module (gnu packages m4)
@@ -85,222 +70,44 @@
#:use-module (gnu packages xdisorg)
#:use-module (gnu packages xorg))
-;; Copied from guix/gnu/packages/rust.scm
-(define* (rust-uri version #:key (dist "static"))
- (string-append "https://" dist ".rust-lang.org/dist/"
- "rustc-" version "-src.tar.gz"))
-
-(define* (rust-bootstrapped-package base-rust version checksum)
- "Bootstrap rust VERSION with source checksum CHECKSUM using BASE-RUST."
- (package
- (inherit base-rust)
- (version version)
- (source
- (origin
- (inherit (package-source base-rust))
- (uri (rust-uri version))
- (sha256 (base32 checksum))))
- (native-inputs
- (alist-replace "cargo-bootstrap" (list base-rust "cargo")
- (alist-replace "rustc-bootstrap" (list base-rust)
- (package-native-inputs base-rust))))))
-
-(define rust-firefox-1.61
- (let ((base-rust (rust-bootstrapped-package
- rust "1.61.0"
- "1vfs05hkf9ilk19b2vahqn8l6k17pl9nc1ky9kgspaascx8l62xd")))
- (package
- (inherit base-rust)
- (arguments
- (substitute-keyword-arguments (package-arguments base-rust)
- ((#:phases phases)
- `(modify-phases ,phases
- (add-after 'unpack 'disable-tests-with-sigint
- ;; These tests rely on killing a process with SIGINT which
- ;; fails in the build container.
- (lambda _
- (substitute* "library/std/src/sys/unix/process/process_common/tests.rs"
- (("fn test_process_group_posix_spawn")
- "#[ignore]\nfn test_process_group_posix_spawn")
- (("fn test_process_group_no_posix_spawn")
- "#[ignore]\nfn test_process_group_no_posix_spawn")))))))))))
-
;; Define the versions of rust needed to build firefox, trying to match
;; upstream. See the file taskcluster/ci/toolchain/rust.yml at
;; https://searchfox.org under the particular firefox release, like
;; mozilla-esr102.
(define-public rust-firefox-esr rust) ; 1.60 is the default in Guix
-(define-public rust-firefox rust-firefox-1.61) ; 1.63 is also listed, but 1.61 is the minimum needed
-
-;; rust-cbindgen-0.23/0.24 dependencies
-(define-public rust-unicode-ident-1
- (package
- (name "rust-unicode-ident")
- (version "1.0.3")
- (source (origin
- (method url-fetch)
- (uri (crate-uri "unicode-ident" version))
- (file-name (string-append name "-" version ".tar.gz"))
- (sha256
- (base32
- "1bqswc96ws8l6k7xx56dg521a3l5imi3mhlcz7rsi6a92mxb7xf4"))))
- (build-system cargo-build-system)
- (arguments
- `(#:skip-build? #t))
- (home-page "https://github.com/dtolnay/unicode-ident")
- (synopsis
- "Better optimized implementation of the older unicode-xid crate")
- (description
- "Determine whether characters have the XID_Start or XID_Continue properties
-according to Unicode Standard Annex #31")
- (license (list license:unicode license:expat))))
+(define-public rust-firefox (@@ (gnu packages rust) rust-1.65)) ; 1.63 is also listed, but 1.61 is the minimum needed
-(define-public rust-textwrap-0.15
+(define icu4c-72
(package
- (inherit rust-textwrap-0.12)
- (name "rust-textwrap")
- (version "0.15.0")
+ (inherit icu4c)
+ (version "72.1")
(source (origin
(method url-fetch)
- (uri (crate-uri "textwrap" version))
- (file-name (string-append name "-" version ".tar.gz"))
+ (uri (string-append
+ "https://github.com/unicode-org/icu/releases/download/release-"
+ (string-map (lambda (x) (if (char=? x #\.) #\- x)) version)
+ "/icu4c-"
+ (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
+ "-src.tgz"))
(sha256
(base32
- "1yw513k61lfiwgqrfvsjw1a5wpvm0azhpjr2kr0jhnq9c56is55i"))))
- (arguments
- `(#:skip-build? #t
- #:cargo-inputs (("rust-hyphenation" ,rust-hyphenation-0.8)
- ("rust-smawk" ,rust-smawk-0.3)
- ("rust-terminal-size" ,rust-terminal-size-0.1)
- ("rust-unicode-linebreak" ,rust-unicode-linebreak-0.1)
- ("rust-unicode-width" ,rust-unicode-width-0.1))))))
-
-(define-public rust-clap-lex-0.2
- (package
- (name "rust-clap-lex")
- (version "0.2.4")
- (source (origin
- (method url-fetch)
- (uri (crate-uri "clap_lex" version))
- (file-name (string-append name "-" version ".tar.gz"))
- (sha256
- (base32
- "1ib1a9v55ybnaws11l63az0jgz5xiy24jkdgsmyl7grcm3sz4l18"))))
- (build-system cargo-build-system)
- (arguments
- `(#:skip-build? #t
- #:cargo-inputs (("rust-os-str-bytes" ,rust-os-str-bytes-6))))
- (home-page "https://github.com/clap-rs/clap/tree/master/clap_lex")
- (synopsis "Minimal, flexible command line parser")
- (description "Minimal, flexible command line parser")
- (license (list license:expat license:asl2.0))))
-
-(define-public rust-clap-derive-3.2.15
- (package
- (inherit rust-clap-derive-3)
- (name "rust-clap-derive")
- (version "3.2.15")
- (source (origin
- (method url-fetch)
- (uri (crate-uri "clap_derive" version))
- (file-name (string-append name "-" version ".tar.gz"))
- (sha256
- (base32
- "1d2c4vs345fwihkd8cc7m6acbiydcwramkd5mnp36p0a7g6jm9cv"))))
- (arguments
- `(#:skip-build? #t
- #:cargo-inputs (("rust-heck" ,rust-heck-0.4)
- ("rust-proc-macro-error" ,rust-proc-macro-error-1)
- ("rust-proc-macro2" ,rust-proc-macro2-1)
- ("rust-quote" ,rust-quote-1)
- ("rust-syn" ,rust-syn-1))))))
-
-(define-public rust-clap-3.2.16
- (package
- (inherit rust-clap-3)
- (name "rust-clap")
- (version "3.2.16")
- (source (origin
- (method url-fetch)
- (uri (crate-uri "clap" version))
- (file-name (string-append name "-" version ".tar.gz"))
- (sha256
- (base32
- "1af06z8z7m3327yz1xvzxfjanclgpvvy3lssb745rig7adkbpnx3"))))
- (arguments
- `(#:skip-build? #t
- #:cargo-inputs (("rust-atty" ,rust-atty-0.2)
- ("rust-backtrace" ,rust-backtrace-0.3)
- ("rust-bitflags" ,rust-bitflags-1)
- ("rust-clap-derive" ,rust-clap-derive-3.2.15)
- ("rust-clap-lex" ,rust-clap-lex-0.2)
- ("rust-indexmap" ,rust-indexmap-1)
- ("rust-once-cell" ,rust-once-cell-1)
- ("rust-regex" ,rust-regex-1)
- ("rust-strsim" ,rust-strsim-0.10)
- ("rust-termcolor" ,rust-termcolor-1)
- ("rust-terminal-size" ,rust-terminal-size-0.1)
- ("rust-textwrap" ,rust-textwrap-0.15)
- ("rust-unicase" ,rust-unicase-2)
- ("rust-yaml-rust" ,rust-yaml-rust-0.4))))))
-
-(define-public rust-cbindgen-0.24
- (package
- (inherit rust-cbindgen-0.19)
- (name "rust-cbindgen")
- (version "0.24.3")
- (source (origin
- (method url-fetch)
- (uri (crate-uri "cbindgen" version))
- (file-name (string-append name "-" version ".tar.gz"))
- (sha256
- (base32
- "1yqxqsz2d0cppd8zwihk2139g5gy38wqgl9snj6rnk8gyvnqsdd6"))))
- (arguments
- `(#:cargo-inputs (("rust-clap" ,rust-clap-3.2.16)
- ("rust-heck" ,rust-heck-0.4)
- ("rust-indexmap" ,rust-indexmap-1)
- ("rust-log" ,rust-log-0.4)
- ("rust-proc-macro2" ,rust-proc-macro2-1)
- ("rust-quote" ,rust-quote-1)
- ("rust-serde" ,rust-serde-1)
- ("rust-serde-json" ,rust-serde-json-1)
- ("rust-syn" ,rust-syn-1)
- ("rust-tempfile" ,rust-tempfile-3)
- ("rust-toml" ,rust-toml-0.5))
- #:cargo-development-inputs (("rust-serial-test" ,rust-serial-test-0.5))))))
-
-;; Bug with firefox build (v101-102) with cbindgen-0.24, see
-;; https://bugzilla.mozilla.org/show_bug.cgi?id=1773259#c5 for possible patch
-;; (untested)
-(define-public rust-cbindgen-0.23
- (package
- (inherit rust-cbindgen-0.24)
- (name "rust-cbindgen")
- (version "0.23.0")
- (source (origin
- (method url-fetch)
- (uri (crate-uri "cbindgen" version))
- (file-name (string-append name "-" version ".tar.gz"))
- (sha256
- (base32
- "006rn3fn4njayjxr2vd24g1awssr9i3894nbmfzkybx07j728vav"))))))
+ "0s0xly0ndspd4p9jl6101qvnp5rgz5kl9qrmcvapwah92y1d7lm2"))))))
;; Update this id with every firefox update to it's release date.
;; It's used for cache validation and therefor can lead to strange bugs.
-(define %firefox-esr-build-id "20221018000000")
+(define %firefox-esr-build-id "20230411000000")
(define-public firefox-esr
(package
(name "firefox-esr")
- (version "102.4.0esr")
+ (version "102.10.0esr")
(source
(origin
(method url-fetch)
(uri (string-append "https://archive.mozilla.org/pub/firefox/releases/"
version "/source/firefox-" version ".source.tar.xz"))
(sha256
- (base32 "0klh3lbm0zdmv90kmmpkzgn15pfjibr7zsjy3kvbzpql97fhv7z7"))))
+ (base32 "1y7v19xxl6jchywd0zxy5vr4pj23pi6di4lhlivxpki2pkgm8scc"))))
(build-system gnu-build-system)
(arguments
(list
@@ -348,7 +155,12 @@ according to Unicode Standard Annex #31")
#:imported-modules %cargo-utils-modules
#:modules `((ice-9 regex)
(ice-9 ftw)
+ (srfi srfi-1)
(srfi srfi-26)
+ (rnrs bytevectors)
+ (rnrs io ports)
+ (guix elf)
+ (guix build gremlin)
,@%gnu-build-system-modules)
#:phases
#~(modify-phases %standard-phases
@@ -508,6 +320,19 @@ according to Unicode Standard Annex #31")
(lambda _ (invoke "./mach" "install")))
(add-after 'install 'wrap-program
(lambda* (#:key inputs outputs #:allow-other-keys)
+ ;; The following two functions are from Guix's icecat package in
+ ;; (gnu packages gnuzilla). See commit
+ ;; b7a0935420ee630a29b7e5ac73a32ba1eb24f00b.
+ (define (runpath-of lib)
+ (call-with-input-file lib
+ (compose elf-dynamic-info-runpath
+ elf-dynamic-info
+ parse-elf
+ get-bytevector-all)))
+ (define (runpaths-of-input label)
+ (let* ((dir (string-append (assoc-ref inputs label) "/lib"))
+ (libs (find-files dir "\\.so$")))
+ (append-map runpath-of libs)))
(let* ((out (assoc-ref outputs "out"))
(lib (string-append out "/lib"))
;; TODO: make me a loop again
@@ -518,6 +343,20 @@ according to Unicode Standard Annex #31")
;; For hardware video acceleration via VA-API
(libva-lib (string-append (assoc-ref inputs "libva")
"/lib"))
+ ;; VA-API is run in the RDD (Remote Data Decoder) sandbox
+ ;; and must be explicitly given access to files it needs.
+ ;; Rather than adding the whole store (as Nix had
+ ;; upstream do, see
+ ;; <https://github.com/NixOS/nixpkgs/pull/165964> and
+ ;; linked upstream patches), we can just follow the
+ ;; runpaths of the needed libraries to add everything to
+ ;; LD_LIBRARY_PATH. These will then be accessible in the
+ ;; RDD sandbox.
+ (rdd-whitelist
+ (map (cut string-append <> "/")
+ (delete-duplicates
+ (append-map runpaths-of-input
+ '("mesa" "ffmpeg")))))
(pulseaudio-lib (string-append (assoc-ref inputs "pulseaudio")
"/lib"))
;; For U2F and WebAuthn
@@ -526,7 +365,7 @@ according to Unicode Standard Annex #31")
"/share")))
(wrap-program (car (find-files lib "^firefox$"))
`("LD_LIBRARY_PATH" prefix (,mesa-lib ,libnotify-lib ,libva-lib
- ,pulseaudio-lib ,eudev-lib))
+ ,pulseaudio-lib ,eudev-lib ,@rdd-whitelist))
`("XDG_DATA_DIRS" prefix (,gtk-share))
`("MOZ_LEGACY_PROFILES" = ("1"))
`("MOZ_ALLOW_DOWNGRADE" = ("1"))))))
@@ -673,20 +512,20 @@ MOZ_ENABLE_WAYLAND=1 exec ~a $@\n"
;; Update this id with every firefox update to it's release date.
;; It's used for cache validation and therefor can lead to strange bugs.
-(define %firefox-build-id "20221103000000")
+(define %firefox-build-id "20230411000000")
(define-public firefox
(package
(inherit firefox-esr)
(name "firefox")
- (version "106.0.4")
+ (version "112.0")
(source
(origin
(method url-fetch)
(uri (string-append "https://archive.mozilla.org/pub/firefox/releases/"
version "/source/firefox-" version ".source.tar.xz"))
(sha256
- (base32 "1dwykdd3nyvkv34nq2zwfa6kkzw4w8pw5300y25gfny94ksx06g6"))))
+ (base32 "1nbmh1mlh1wnh0wkbf4x2fr3pgs41cb5gapdfc63np7sgdgih6gb"))))
(arguments
(substitute-keyword-arguments (package-arguments firefox-esr)
((#:phases phases)
@@ -694,6 +533,9 @@ MOZ_ENABLE_WAYLAND=1 exec ~a $@\n"
(replace 'set-build-id
(lambda _
(setenv "MOZ_BUILD_DATE" #$%firefox-build-id)))))))
+ (inputs
+ (modify-inputs (package-inputs firefox-esr)
+ (replace "icu4c" icu4c-72)))
(native-inputs
(modify-inputs (package-native-inputs firefox-esr)
(replace "rust" rust-firefox)