From dc2ed80ece9030f79d5fd80282095162d34a50c2 Mon Sep 17 00:00:00 2001 From: John Kehayias Date: Wed, 10 Aug 2022 00:06:22 -0400 Subject: gnu: Add firefox-esr, update firefox to 103.0.2. * nongnu/packages/mozilla.scm (firefox-esr): New variable, previously package definition of firefox. [phases]: New phase set-build-id moved from configure. In configure, set GUIX_PYTHON_PATH. (firefox-esr/wayland): New variable. Adjusted packaged definition of firefox/wayland. (firefox): Inherit from firefox-esr. --- nongnu/packages/mozilla.scm | 164 +++++++++++++++++++++++++++++++------------- 1 file changed, 116 insertions(+), 48 deletions(-) diff --git a/nongnu/packages/mozilla.scm b/nongnu/packages/mozilla.scm index cf4ac8c..03b4766 100644 --- a/nongnu/packages/mozilla.scm +++ b/nongnu/packages/mozilla.scm @@ -532,19 +532,19 @@ according to Unicode Standard Annex #31") ;; 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 "20220531000000") +(define %firefox-esr-build-id "20220726000000") -(define-public firefox +(define-public firefox-esr (package - (name "firefox") - (version "101.0") + (name "firefox-esr") + (version "102.1.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 "15b0p2zwpln46x2ya27mv6izpw8w6yl660k46z4cpfsqgm8mpasm")))) + (base32 "0q4lawxynvdiihlqnqiwxdp0ai71qq2fp6mkdsy5p08vgmr6wyv3")))) (build-system gnu-build-system) (arguments (list @@ -621,10 +621,6 @@ according to Unicode Standard Annex #31") (substitute* "dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp" (("libavcodec\\.so") libavcodec))))) - (add-after 'fix-ffmpeg-runtime-linker 'lower-rust-cbindgen-version - (lambda _ - (substitute* "build/moz.configure/bindgen.configure" - (("0\\.23\\.0") "0.19.0")))) (add-after 'patch-source-shebangs 'patch-cargo-checksums (lambda _ (use-modules (guix build cargo-utils)) @@ -666,6 +662,12 @@ according to Unicode Standard Annex #31") (substitute* "build/RunCbindgen.py" (("\"--frozen\",") "")))) (delete 'bootstrap) + (add-before 'configure 'set-build-id + ;; Firefox will write the timestamp to output, which is harmful + ;; for reproducibility, so change it to a fixed date. Use a + ;; separate phase for easier modification with inherit. + (lambda _ + (setenv "MOZ_BUILD_DATE" #$%firefox-esr-build-id))) (replace 'configure (lambda* (#:key inputs outputs configure-flags #:allow-other-keys) (setenv "AUTOCONF" (string-append (assoc-ref inputs "autoconf") @@ -673,6 +675,11 @@ according to Unicode Standard Annex #31") (setenv "SHELL" (which "bash")) (setenv "CONFIG_SHELL" (which "bash")) (setenv "MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE" "system") + ;; This should use the host info probably (does firefox build on + ;; non-x86_64 though?) + (setenv "GUIX_PYTHONPATH" + (string-append (getcwd) + "/obj-x86_64-pc-linux-gnu/_virtualenvs/build")) ;; Use Clang, Clang is 2x faster than GCC (setenv "AR" "llvm-ar") @@ -689,9 +696,6 @@ according to Unicode Standard Annex #31") "/bin/clang++")) (setenv "MOZ_NOSPAM" "1") - ;; Firefox will write the timestamp to output, which is harmful for - ;; reproducibility, so change it to a fixed date. - (setenv "MOZ_BUILD_DATE" #$%firefox-build-id) (setenv "MOZBUILD_STATE_PATH" (getcwd)) @@ -863,48 +867,112 @@ according to Unicode Standard Annex #31") pkg-config python rust-firefox - rust-cbindgen-0.19 + rust-cbindgen-0.23 which yasm)) (home-page "https://mozilla.org/firefox/") (synopsis "Trademarkless version of Firefox") (description "Full-featured browser client built from Firefox source tree, without -the official icon and the name \"firefox\".") +the official icon and the name \"firefox\". This is the Extended Support +Release (ESR) version.") (license license:mpl2.0))) - (define-public firefox/wayland - (package - (inherit firefox) - (name "firefox-wayland") - (native-inputs '()) - (inputs - `(("bash" ,bash-minimal) - ("firefox" ,firefox))) - (build-system trivial-build-system) - (arguments - '(#:modules ((guix build utils)) - #:builder - (begin - (use-modules (guix build utils)) - (let* ((bash (assoc-ref %build-inputs "bash")) - (firefox (assoc-ref %build-inputs "firefox")) - (out (assoc-ref %outputs "out")) - (exe (string-append out "/bin/firefox"))) - (mkdir-p (dirname exe)) - - (call-with-output-file exe - (lambda (port) - (format port "#!~a +(define-public firefox-esr/wayland + (package + (inherit firefox-esr) + (name "firefox-esr-wayland") + (native-inputs '()) + (inputs + `(("bash" ,bash-minimal) + ("firefox-esr" ,firefox-esr))) + (build-system trivial-build-system) + (arguments + '(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let* ((bash (assoc-ref %build-inputs "bash")) + (firefox (assoc-ref %build-inputs "firefox-esr")) + (out (assoc-ref %outputs "out")) + (exe (string-append out "/bin/firefox"))) + (mkdir-p (dirname exe)) + + (call-with-output-file exe + (lambda (port) + (format port "#!~a +MOZ_ENABLE_WAYLAND=1 exec ~a $@\n" + (string-append bash "/bin/bash") + (string-append firefox "/bin/firefox")))) + (chmod exe #o555) + + ;; Provide the manual and .desktop file. + (copy-recursively (string-append firefox "/share") + (string-append out "/share")) + (substitute* (string-append + out "/share/applications/firefox.desktop") + ((firefox) out)) + #t)))))) + +;; 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 "20220809000000") + +(define-public firefox + (package + (inherit firefox-esr) + (name "firefox") + (version "103.0.2") + (source + (origin + (method url-fetch) + (uri (string-append "https://archive.mozilla.org/pub/firefox/releases/" + version "/source/firefox-" version ".source.tar.xz")) + (sha256 + (base32 "10ngqak8r4284pr6c5d0jgxjk5ax27l7cs380rj1x070zbslvnxj")))) + (arguments + (substitute-keyword-arguments (package-arguments firefox-esr) + ((#:phases phases) + #~(modify-phases #$phases + (replace 'set-build-id + (lambda _ + (setenv "MOZ_BUILD_DATE" #$%firefox-build-id))))))) + (description + "Full-featured browser client built from Firefox source tree, without +the official icon and the name \"firefox\"."))) + +(define-public firefox/wayland + (package + (inherit firefox) + (name "firefox-wayland") + (native-inputs '()) + (inputs + `(("bash" ,bash-minimal) + ("firefox" ,firefox))) + (build-system trivial-build-system) + (arguments + '(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let* ((bash (assoc-ref %build-inputs "bash")) + (firefox (assoc-ref %build-inputs "firefox")) + (out (assoc-ref %outputs "out")) + (exe (string-append out "/bin/firefox"))) + (mkdir-p (dirname exe)) + + (call-with-output-file exe + (lambda (port) + (format port "#!~a MOZ_ENABLE_WAYLAND=1 exec ~a $@\n" - (string-append bash "/bin/bash") - (string-append firefox "/bin/firefox")))) - (chmod exe #o555) - - ;; Provide the manual and .desktop file. - (copy-recursively (string-append firefox "/share") - (string-append out "/share")) - (substitute* (string-append - out "/share/applications/firefox.desktop") - ((firefox) out)) - #t)))))) + (string-append bash "/bin/bash") + (string-append firefox "/bin/firefox")))) + (chmod exe #o555) + + ;; Provide the manual and .desktop file. + (copy-recursively (string-append firefox "/share") + (string-append out "/share")) + (substitute* (string-append + out "/share/applications/firefox.desktop") + ((firefox) out)) + #t)))))) -- cgit v1.2.3