summary refs log tree commit diff
path: root/gnu/packages/gnuzilla.scm
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2022-08-16 10:28:31 +0200
committerMarius Bakke <marius@gnu.org>2022-08-27 01:31:23 +0200
commitd6fa3ac7a8203173b125390aed596832565a3687 (patch)
tree5556b695952ea52729cd7481b36d6da6bf6c6928 /gnu/packages/gnuzilla.scm
parent283d3fd7c3ce46519a0063bcecde497abffb5ad5 (diff)
downloadguix-d6fa3ac7a8203173b125390aed596832565a3687.tar.gz
gnu: mozjs: Update to 102.2.0.
* gnu/packages/gnuzilla.scm (mozjs): Update to 102.2.0.
(source)[uri]: Use new download location.
[arguments]: Adjust configure phase for upstream changes.  Remove
adjust-tests-for-icu-68 phase, add adjust-tests phase.  Don't delete tests in
pre-check phase.
[native-inputs]: Remove AUTOCONF-2.13 and PYTHON-3.  Add AUTOCONF, M4, and
PYTHON-WRAPPER.
[inputs]: Replace ICU4C with ICU4C-71.
(mozjs-78): New variable.
* gnu/packages/games.scm (0ad)[inputs]: Change from MOZJS to MOZJS-78.
* gnu/packages/polkit.scm (polkit-mozjs)[inputs]: Likewise.
Diffstat (limited to 'gnu/packages/gnuzilla.scm')
-rw-r--r--gnu/packages/gnuzilla.scm204
1 files changed, 142 insertions, 62 deletions
diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index ad955649cc..3fc0355e60 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -14,7 +14,7 @@
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
 ;;; Copyright © 2019, 2020 Adrian Malacoda <malacoda@monarch-pass.net>
 ;;; Copyright © 2020, 2021, 2022 Jonathan Brielmaier <jonathan.brielmaier@web.de>
-;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
+;;; Copyright © 2020, 2022 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;; Copyright © 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
@@ -96,16 +96,16 @@
 (define-public mozjs
   (package
     (name "mozjs")
-    (version "78.15.0")
+    (version "102.2.0")
     (source (origin
               (method url-fetch)
               ;; TODO: Switch to IceCat source once available on ftp.gnu.org.
-              (uri (string-append "https://archive.mozilla.org/pub/firefox"
+              (uri (string-append "https://ftp.mozilla.org/pub/firefox"
                                   "/releases/" version "esr/source/firefox-"
                                   version "esr.source.tar.xz"))
               (sha256
                (base32
-                "0l91cxdc5v9fps79ckb1kid4gw6v5qng1jd9zvaacwaiv628shx4"))))
+                "1zwpgis7py1bf8p88pz3mpai6a02qrdb8ww2fa9kxxdl9b8r2k81"))))
     (build-system gnu-build-system)
     (arguments
      (list
@@ -147,7 +147,7 @@
                 (for-each generate-all-checksums
                           '("js" "third_party/rust")))))
           (replace 'configure
-            (lambda* (#:key inputs configure-flags #:allow-other-keys)
+            (lambda* (#:key configure-flags #:allow-other-keys)
               ;; The configure script does not accept environment variables as
               ;; arguments.  It also must be run from a different directory,
               ;; but not the root directory either.
@@ -156,43 +156,11 @@
               (setenv "SHELL" (which "sh"))
               (setenv "CONFIG_SHELL" (which "sh"))
               (setenv "AUTOCONF" (which "autoconf"))
-              (apply invoke "../js/src/configure"
-                     (cons (string-append "--prefix=" #$output)
-                           configure-flags))))
-          (add-after 'unpack 'adjust-for-icu-68
-            (lambda _
-              (with-directory-excursion "js/src/tests"
-                ;; The test suite expects a lightly patched ICU 67.  Since
-                ;; Guix is about to switch to ICU 68, massage the tests to
-                ;; work with that instead of patching ICU.  Try removing this
-                ;; phase for newer versions of mozjs.
-
-                ;; These tests look up locale names and expects to get
-                ;; "GB" instead of "UK".
-                (substitute* "non262/Intl/DisplayNames/language.js"
-                  (("Traditionell, GB")
-                   "Traditionell, UK"))
-                (substitute* "non262/Intl/DisplayNames/region.js"
-                  (("\"GB\": \"GB\"")
-                   "\"GB\": \"UK\""))
-
-                ;; XXX: Some localized time formats have changed, and
-                ;; substitution fails for accented characters, even though
-                ;; it works in the REPL(?).  Just delete these for now.
-                (delete-file "non262/Intl/Date/toLocaleString_timeZone.js")
-                (delete-file "non262/Intl/Date/toLocaleDateString_timeZone.js")
-
-                ;; Similarly, these get an unexpected "A" suffix when looking
-                ;; up a time in the "ar-MA-u-ca-islamicc" locale, which is
-                ;; tricky to substitute.
-                (delete-file "non262/Intl/DateTimeFormat/format_timeZone.js")
-                (delete-file "non262/Intl/DateTimeFormat/format.js")
-
-                ;; This file compares a generated list of ICU locale names
-                ;; with actual lookups.  Some have changed slightly, i.e.
-                ;; daf-Latn-ZZ -> daf-Latn-CI, so drop it for simplicity.
-                (delete-file "non262/Intl/Locale/likely-subtags-generated.js"))))
-          (add-before 'check 'pre-check
+              (apply invoke "python" "../configure.py"
+                     "--enable-project=js"
+                     (string-append "--prefix=" #$output)
+                     configure-flags)))
+          (add-before 'check 'adjust-tests
             (lambda _
               (with-directory-excursion "../js/src/tests"
                 (substitute* "shell/os.js"
@@ -200,34 +168,44 @@
                   ((".*killed process should not have exitStatus.*")
                    ""))
 
-                ;; XXX: Delete all tests that test time zone functionality,
-                ;; because the test suite uses /etc/localtime to figure out
-                ;; the offset from the hardware clock, which does not work
-                ;; in the build container.  See <tests/non262/Date/shell.js>.
-                (delete-file-recursively "non262/Date")
-                (delete-file "non262/Intl/DateTimeFormat/tz-environment-variable.js")
+                ;; The test suite expects a lightly patched ICU.  Disable tests
+                ;; that do not work with the system version.  See
+                ;; "intl/icu-patches" for clues.
 
-                (setenv "JSTESTS_EXTRA_ARGS"
-                        (string-join
-                         (list
-                          ;; Do not run tests marked as "random".
-                          "--exclude-random"
-                          ;; Exclude web platform tests.
-                          "--wpt=disabled"
-                          ;; Respect the daemons configured number of jobs.
-                          (string-append "--worker-count="
-                                         (number->string (parallel-job-count))))))))))))
+                ;; See <https://unicode-org.atlassian.net/browse/ICU-20992> and
+                ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=1636984> and
+                ;; related patch for why this is failing.
+                (delete-file "non262/Intl/DateTimeFormat/\
+fractional-second-digits-append-item.js")
+                ;; FIXME: got "0 \u251CAM/PM: noon\u2524", expected "0 (AM/PM: noon)"
+                (delete-file "non262/Intl/DateTimeFormat/day-period-hour-cycle.js")
+                ;; FIXME: got "en-US-posix", expected "en-US-POSIX".
+                (delete-file "non262/Intl/available-locales-supported.js")
+                ;; FIXME: got "en-US", expected "en-US-POSIX"
+                (delete-file "non262/Intl/available-locales-resolved.js"))))
+          (add-before 'check 'pre-check
+            (lambda _
+              (setenv "JSTESTS_EXTRA_ARGS"
+                      (string-join
+                       (list
+                        ;; Do not run tests marked as "random".
+                        "--exclude-random"
+                        ;; Exclude web platform tests.
+                        "--wpt=disabled"
+                        ;; Respect the daemons configured number of jobs.
+                        (string-append "--worker-count="
+                                       (number->string (parallel-job-count)))))))))))
     (native-inputs
-     (list autoconf-2.13
-           automake
+     (list autoconf
            llvm                         ;for llvm-objdump
+           m4
            perl
            pkg-config
-           python-3
+           python-wrapper
            rust
            `(,rust "cargo")))
     (inputs
-     (list icu4c readline zlib))
+     (list icu4c-71 readline zlib))
     (propagated-inputs
      (list nspr))                ; in the Requires.private field of mozjs-*.pc
     (home-page
@@ -237,6 +215,108 @@
 in C/C++.")
     (license license:mpl2.0))) ; and others for some files
 
+(define-public mozjs-78
+  (package
+    (inherit mozjs)
+    (name "mozjs")
+    (version "78.15.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://archive.mozilla.org/pub/firefox"
+                                  "/releases/" version "esr/source/firefox-"
+                                  version "esr.source.tar.xz"))
+              (sha256
+               (base32
+                "0l91cxdc5v9fps79ckb1kid4gw6v5qng1jd9zvaacwaiv628shx4"))))
+    (build-system gnu-build-system)
+    (arguments
+     (substitute-keyword-arguments (package-arguments mozjs)
+       ((#:phases phases)
+        #~(modify-phases #$phases
+            (replace 'configure
+              (lambda* (#:key configure-flags #:allow-other-keys)
+                ;; The configure script does not accept environment variables as
+                ;; arguments.  It also must be run from a different directory,
+                ;; but not the root directory either.
+                (mkdir "run-configure-from-here")
+                (chdir "run-configure-from-here")
+                (setenv "SHELL" (which "sh"))
+                (setenv "CONFIG_SHELL" (which "sh"))
+                (setenv "AUTOCONF" (which "autoconf"))
+                (apply invoke "../js/src/configure"
+                       (cons (string-append "--prefix=" #$output)
+                             configure-flags))))
+            (replace 'adjust-tests
+              (lambda _
+                (with-directory-excursion "../js/src/tests"
+                  ;; The test suite expects a lightly patched ICU 67.  Since
+                  ;; Guix is about to switch to ICU 68, massage the tests to
+                  ;; work with that instead of patching ICU.  Try removing this
+                  ;; phase for newer versions of mozjs.
+
+                  ;; These tests look up locale names and expects to get
+                  ;; "GB" instead of "UK".
+                  (substitute* "non262/Intl/DisplayNames/language.js"
+                    (("Traditionell, GB")
+                     "Traditionell, UK"))
+                  (substitute* "non262/Intl/DisplayNames/region.js"
+                    (("\"GB\": \"GB\"")
+                     "\"GB\": \"UK\""))
+
+                  ;; XXX: Some localized time formats have changed, and
+                  ;; substitution fails for accented characters, even though
+                  ;; it works in the REPL(?).  Just delete these for now.
+                  (delete-file "non262/Intl/Date/toLocaleString_timeZone.js")
+                  (delete-file "non262/Intl/Date/toLocaleDateString_timeZone.js")
+
+                  ;; Similarly, these get an unexpected "A" suffix when looking
+                  ;; up a time in the "ar-MA-u-ca-islamicc" locale, which is
+                  ;; tricky to substitute.
+                  (delete-file "non262/Intl/DateTimeFormat/format_timeZone.js")
+                  (delete-file "non262/Intl/DateTimeFormat/format.js")
+
+                  ;; This file compares a generated list of ICU locale names
+                  ;; with actual lookups.  Some have changed slightly, i.e.
+                  ;; daf-Latn-ZZ -> daf-Latn-CI, so drop it for simplicity.
+                  (delete-file "non262/Intl/Locale/likely-subtags-generated.js"))))
+            (replace 'pre-check
+              (lambda _
+                (with-directory-excursion "../js/src/tests"
+                  (substitute* "shell/os.js"
+                    ;; FIXME: Why does the killed process have an exit status?
+                    ((".*killed process should not have exitStatus.*")
+                     ""))
+
+                  ;; XXX: Delete all tests that test time zone functionality,
+                  ;; because the test suite uses /etc/localtime to figure out
+                  ;; the offset from the hardware clock, which does not work
+                  ;; in the build container.  See <tests/non262/Date/shell.js>.
+                  (delete-file-recursively "non262/Date")
+                  (delete-file "non262/Intl/DateTimeFormat/tz-environment-variable.js")
+
+                  (setenv "JSTESTS_EXTRA_ARGS"
+                          (string-join
+                           (list
+                            ;; Do not run tests marked as "random".
+                            "--exclude-random"
+                            ;; Exclude web platform tests.
+                            "--wpt=disabled"
+                            ;; Respect the daemons configured number of jobs.
+                            (string-append "--worker-count="
+                                           (number->string
+                                            (parallel-job-count)))))))))))))
+    (native-inputs
+     (list autoconf-2.13
+           automake
+           llvm                         ;for llvm-objdump
+           perl
+           pkg-config
+           python-3
+           rust
+           `(,rust "cargo")))
+    (inputs
+     (list icu4c readline zlib))))
+
 (define mozilla-compare-locales
   (origin
     (method hg-fetch)