summary refs log tree commit diff
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2021-09-22 22:29:31 +0200
committerMarius Bakke <marius@gnu.org>2021-09-23 12:05:53 +0200
commit6a805f22a3b4ecff668c21b7ef5017321c27036c (patch)
treeb2bc9013dfcea3ea103f0a53729c8b9d24630615
parent88f4f1f5af0ecae3ce9c4a894eed569de8e1221e (diff)
downloadguix-6a805f22a3b4ecff668c21b7ef5017321c27036c.tar.gz
gnu: ungoogled-chromium: Update to 93.0.4577.82-0.3f62dbc.
* gnu/packages/patches/ungoogled-chromium-ffmpeg-compat.patch,
gnu/packages/patches/ungoogled-chromium-system-nspr.patch: New files.
* gnu/local.mk (dist_patch_DATA): Adjust accordingly.
* gnu/packages/chromium.scm (%preserved-third-party-files): Adjust for version
93.
(%chromium-version): Set to 93.0.4577.82.
(%ungoogled-revision): Set to 93.0.4577.82-1-2-g3f62dbc.
(%debian-patches): Remove 'system/nspr.patch'.
(%ungoogled-origin): Update source hash.
(%guix-patches): Add 'ungoogled-chromium-ffmpeg-compat.patch' and
'ungoogled-chromium-system-nspr.patch'.
(ungoogled-chromium-snippet): Remove PYTHON-2 usage.  Don't unbundle
'snappy'.
(libvpx/chromium): Remove variable.
(ungoogled-chromium)[source]: Update hash.
[arguments]: Add "is_cfi=false", "use_thin_lto=false", and
"blink_enable_generated_code_formatting=false".
[native-inputs]: Change CLANG-11 to CLANG-12.  Change NODE to NODE-LTS.  Add
PYTHON-BEAUTIFULSOUP4 and PYTHON-HTML5LIB.  Remove PYTHON-2.
[inputs]: Change LIBVPX/CHROMIUM to LIBVPX.
-rw-r--r--gnu/local.mk2
-rw-r--r--gnu/packages/chromium.scm64
-rw-r--r--gnu/packages/patches/ungoogled-chromium-ffmpeg-compat.patch68
-rw-r--r--gnu/packages/patches/ungoogled-chromium-system-nspr.patch54
4 files changed, 154 insertions, 34 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 8327f5c6c8..ba87264948 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1808,6 +1808,8 @@ dist_patch_DATA =						\
   %D%/packages/patches/ucx-tcp-iface-ioctl.patch		\
   %D%/packages/patches/udiskie-no-appindicator.patch		\
   %D%/packages/patches/ungoogled-chromium-extension-search-path.patch	\
+  %D%/packages/patches/ungoogled-chromium-ffmpeg-compat.patch	\
+  %D%/packages/patches/ungoogled-chromium-system-nspr.patch	\
   %D%/packages/patches/unison-fix-ocaml-4.08.patch		\
   %D%/packages/patches/unknown-horizons-python-3.8-distro.patch	\
   %D%/packages/patches/unzip-CVE-2014-8139.patch		\
diff --git a/gnu/packages/chromium.scm b/gnu/packages/chromium.scm
index 26ae1e2550..23b6b0dfab 100644
--- a/gnu/packages/chromium.scm
+++ b/gnu/packages/chromium.scm
@@ -58,6 +58,8 @@
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-web)
+  #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages regex)
   #:use-module (gnu packages serialization)
   #:use-module (gnu packages speech)
@@ -95,7 +97,6 @@
     "third_party/angle/src/common/third_party/base" ;BSD-3
     "third_party/angle/src/common/third_party/smhasher" ;Public domain
     "third_party/angle/src/common/third_party/xxhash" ;BSD-2
-    "third_party/angle/src/third_party/compiler" ;BSD-2
     "third_party/angle/src/third_party/libXNVCtrl" ;Expat
     "third_party/angle/src/third_party/trace_event" ;BSD-3
     "third_party/angle/src/third_party/volk" ;Expat
@@ -249,6 +250,11 @@
     "third_party/skia/third_party/skcms" ;BSD-3
     "third_party/skia/third_party/vulkanmemoryallocator" ;BSD-3, Expat
     "third_party/smhasher" ;Expat, public domain
+
+    ;; FIXME: the snappy "replacement" shim (see replace_gn_files.py below) does
+    ;; not declare a library dependency added in M93, causing a link failure.
+    "third_party/snappy" ;BSD-3
+
     "third_party/speech-dispatcher" ;GPL2+
     "third_party/sqlite" ;Public domain
     "third_party/swiftshader" ;ASL2.0
@@ -300,7 +306,6 @@
 
     "third_party/zlib/google" ;BSD-3
     "third_party/zxcvbn-cpp" ;Expat
-    "tools/grit/third_party/six" ;Expat
     "url/third_party/mozilla" ;BSD-3, MPL1.1/GPL2+/LGPL2.1+
     "v8/src/third_party/siphash" ;Public domain
     "v8/src/third_party/utf8-decoder" ;Expat
@@ -324,17 +329,15 @@
                   (string-append "ungoogled-chromium-" category "-" name))))
     (sha256 (base32 hash))))
 
-(define %chromium-version "92.0.4515.159")
+(define %chromium-version "93.0.4577.82")
 (define %debian-revision "debian/90.0.4430.85-1")
 ;; Note: use 'git describe --long' even for exact tags to placate the
 ;; custom version format for ungoogled-chromium.
-(define %ungoogled-revision "92.0.4515.159-1-8-g8164c91")
+(define %ungoogled-revision "93.0.4577.82-1-2-g3f62dbc")
 
 (define %debian-patches
   (list (debian-patch "fixes/nomerge.patch"
                       "0lybs2b5gk08j8cr6vjrs9d3drd7qfw013z2r0y00by8dnpm74i3")
-        (debian-patch "system/nspr.patch"
-                      "1gdirn1k1i841l8zp8xgr95kl16b5nx827am9rcxj8sfkm8hgkn3")
         (debian-patch "system/zlib.patch"
                       "0j313bd3q8qc065j60x97dckrfgbwl4qxc8jhz33iihvv4lwziwv")
         (debian-patch "system/openjpeg.patch"
@@ -348,12 +351,18 @@
     (file-name (git-file-name "ungoogled-chromium" %ungoogled-revision))
     (sha256
      (base32
-      "0wbcbjzh5ak4nciahqw4yvxc4x8ik4x0iz9h4kfy0m011sxzy174"))))
+      "1n0bffmwrzp3g1zzsy6qq325mbp4yn629m5zlfyz261szhvl9rgw"))))
 
 (define %guix-patches
   (list (local-file
          (assume-valid-file-name
-          (search-patch "ungoogled-chromium-extension-search-path.patch")))))
+          (search-patch "ungoogled-chromium-extension-search-path.patch")))
+        (local-file
+         (assume-valid-file-name
+          (search-patch "ungoogled-chromium-ffmpeg-compat.patch")))
+        (local-file
+         (assume-valid-file-name
+          (search-patch "ungoogled-chromium-system-nspr.patch")))))
 
 ;; This is a source 'snippet' that does the following:
 ;; *) Applies various patches for unbundling purposes and libstdc++ compatibility.
@@ -397,7 +406,7 @@
 
           (format #t "Pruning third party files...~%")
           (force-output)
-          (apply invoke (string-append #+python-2 "/bin/python")
+          (apply invoke "python"
                  "build/linux/unbundle/remove_bundled_libraries.py"
                  "--do-remove" '#$%preserved-third-party-files)
 
@@ -414,7 +423,7 @@
                   "--system-libraries" "ffmpeg" "flac" "fontconfig"
                   "freetype" "harfbuzz-ng" "icu" "libdrm" "libevent"
                   "libjpeg" "libpng" "libwebp" "libxml" "libxslt"
-                  "openh264" "opus" "snappy" "zlib")))))
+                  "openh264" "opus" "zlib")))))
 
 (define opus+custom
   (package/inherit opus
@@ -428,22 +437,6 @@
         `(cons "--enable-custom-modes"
                ,flags))))))
 
-;; WebRTC in Chromium 88 requires an unreleased version of libvpx.  Use the
-;; commit mentioned in "third_party/libvpx/README.chromium".
-(define libvpx/chromium
-  (package
-    (inherit libvpx)
-    (version "1.9.0-147-g61edec1ef")
-    (source (origin
-              (inherit (package-source libvpx))
-              (uri (git-reference
-                    (url "https://chromium.googlesource.com/webm/libvpx")
-                    (commit (string-append "v" version))))
-              (file-name (git-file-name "libvpx" version))
-              (sha256
-               (base32
-                "0mw13y7j2lg8jj3alm9367c3b40b6s218fdz3nn1m2k85c78wzr7"))))))
-
 ;; 'make-ld-wrapper' can only work with an 'ld' executable, so we need
 ;; this trick to make it wrap 'lld'.
 (define (make-lld-wrapper lld)
@@ -484,7 +477,7 @@
                                   %chromium-version ".tar.xz"))
               (sha256
                (base32
-                "04gxgimg5ygzx6nvfws5y9dppdfjg1fhyl8zbykmksbh1myk6zfr"))
+                "0lr8zdq06smncdzd6knzww9hxl8ynvxadmrkyyl13fpwb1422rjx"))
               (modules '((guix build utils)))
               (snippet (force ungoogled-chromium-snippet))))
     (build-system gnu-build-system)
@@ -506,6 +499,8 @@
              ;; a developer build.
              "is_official_build=true"
              "clang_use_chrome_plugins=false"
+             "is_cfi=false"             ;requires Clang 13
+             "use_thin_lto=false"       ;XXX ICE with Clang+LLD 12.0.1
              "chrome_pgo_phase=0"
              "use_sysroot=false"
              "goma_dir=\"\""
@@ -529,6 +524,8 @@
              ;; Disable code using TensorFlow until it has been scrutinized
              ;; by the ungoogled project.
              "build_with_tflite_lib=false"
+             ;; Avoid dependency on code formatting tools.
+             "blink_enable_generated_code_formatting=false"
 
              ;; Define a custom toolchain that simply looks up CC, AR and
              ;; friends from the environment.
@@ -823,21 +820,20 @@
                   '("24" "48" "64" "128" "256")))))))))
     (native-inputs
      `(("bison" ,bison)
-       ("clang" ,clang-11)
+       ("clang" ,clang-12)
        ("gn" ,gn)
        ("gperf" ,gperf)
        ("ld-wrapper" ,(make-lld-wrapper lld))
        ("ninja" ,ninja)
-       ("node" ,node)
+       ("node" ,node-lts)
        ("pkg-config" ,pkg-config)
        ("which" ,which)
+
        ;; This file contains defaults for new user profiles.
        ("master-preferences" ,(local-file "aux-files/chromium/master-preferences.json"))
 
-       ;; Try unbundling these when upstream has completed its Python 3 transition.
-       ;; ("python-beautifulsoup4" ,python-beautifulsoup4)
-       ;; ("python-html5lib" ,python-html5lib)
-       ("python2" ,python-2)
+       ("python-beautifulsoup4" ,python-beautifulsoup4)
+       ("python-html5lib" ,python-html5lib)
        ("python" ,python-wrapper)
        ("wayland-scanner" ,wayland)))
     (inputs
@@ -862,7 +858,7 @@
        ("libjpeg-turbo" ,libjpeg-turbo)
        ("libpng" ,libpng)
        ("libva" ,libva)
-       ("libvpx" ,libvpx/chromium)
+       ("libvpx" ,libvpx)
        ("libwebp" ,libwebp)
        ("libx11" ,libx11)
        ("libxcb" ,libxcb)
diff --git a/gnu/packages/patches/ungoogled-chromium-ffmpeg-compat.patch b/gnu/packages/patches/ungoogled-chromium-ffmpeg-compat.patch
new file mode 100644
index 0000000000..636f518a33
--- /dev/null
+++ b/gnu/packages/patches/ungoogled-chromium-ffmpeg-compat.patch
@@ -0,0 +1,68 @@
+The bundled ffmpeg in Chromium is newer than the one in Guix.  Patch so
+we can build with the new and old ffmpeg versions.
+
+Taken from Gentoo:
+https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/files/chromium-93-fix-build-with-system-ffmpeg.patch
+
+diff --git a/media/filters/audio_decoder_unittest.cc b/media/filters/audio_decoder_unittest.cc
+--- a/media/filters/audio_decoder_unittest.cc
++++ b/media/filters/audio_decoder_unittest.cc
+@@ -109,7 +109,11 @@ void SetDiscardPadding(AVPacket* packet,
+   }
+ 
+   // If the timestamp is positive, try to use FFmpeg's discard data.
++#if LIBAVUTIL_VERSION_MAJOR < 57
++  int skip_samples_size = 0;
++#else
+   size_t skip_samples_size = 0;
++#endif
+   const uint32_t* skip_samples_ptr =
+       reinterpret_cast<const uint32_t*>(av_packet_get_side_data(
+           packet, AV_PKT_DATA_SKIP_SAMPLES, &skip_samples_size));
+diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
+--- a/media/filters/ffmpeg_demuxer.cc
++++ b/media/filters/ffmpeg_demuxer.cc
+@@ -427,11 +427,19 @@ void FFmpegDemuxerStream::EnqueuePacket(
+   scoped_refptr<DecoderBuffer> buffer;
+ 
+   if (type() == DemuxerStream::TEXT) {
++#if LIBAVUTIL_VERSION_MAJOR < 57
++    int id_size = 0;
++#else
+     size_t id_size = 0;
++#endif
+     uint8_t* id_data = av_packet_get_side_data(
+         packet.get(), AV_PKT_DATA_WEBVTT_IDENTIFIER, &id_size);
+ 
++#if LIBAVUTIL_VERSION_MAJOR < 57
++    int settings_size = 0;
++#else
+     size_t settings_size = 0;
++#endif
+     uint8_t* settings_data = av_packet_get_side_data(
+         packet.get(), AV_PKT_DATA_WEBVTT_SETTINGS, &settings_size);
+ 
+@@ -443,7 +451,11 @@ void FFmpegDemuxerStream::EnqueuePacket(
+     buffer = DecoderBuffer::CopyFrom(packet->data, packet->size,
+                                      side_data.data(), side_data.size());
+   } else {
++#if LIBAVUTIL_VERSION_MAJOR < 57
++    int side_data_size = 0;
++#else
+     size_t side_data_size = 0;
++#endif
+     uint8_t* side_data = av_packet_get_side_data(
+         packet.get(), AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, &side_data_size);
+ 
+@@ -504,7 +516,11 @@ void FFmpegDemuxerStream::EnqueuePacket(
+                                        packet->size - data_offset);
+     }
+ 
++#if LIBAVUTIL_VERSION_MAJOR < 57
++    int skip_samples_size = 0;
++#else
+     size_t skip_samples_size = 0;
++#endif
+     const uint32_t* skip_samples_ptr =
+         reinterpret_cast<const uint32_t*>(av_packet_get_side_data(
+             packet.get(), AV_PKT_DATA_SKIP_SAMPLES, &skip_samples_size));
diff --git a/gnu/packages/patches/ungoogled-chromium-system-nspr.patch b/gnu/packages/patches/ungoogled-chromium-system-nspr.patch
new file mode 100644
index 0000000000..831e2b899c
--- /dev/null
+++ b/gnu/packages/patches/ungoogled-chromium-system-nspr.patch
@@ -0,0 +1,54 @@
+Build with the system NSPR library instead of the bundled version.
+
+Originally based on this Debian patch:
+https://salsa.debian.org/chromium-team/chromium/-/blob/master/debian/patches/system/nspr.patch
+
+diff --git a/base/BUILD.gn b/base/BUILD.gn
+--- a/base/BUILD.gn
++++ b/base/BUILD.gn
+@@ -141,6 +141,12 @@ config("perfetto_config") {
+   }
+ }
+ 
++if (is_linux) {
++  ldflags = [
++    "-lnspr4",
++  ]
++}
++
+ # Base and everything it depends on should be a static library rather than
+ # a source set. Base is more of a "library" in the classic sense in that many
+ # small parts of it are used in many different contexts. This combined with a
+@@ -759,8 +765,6 @@ component("base") {
+     "third_party/cityhash_v103/src/city_v103.cc",
+     "third_party/cityhash_v103/src/city_v103.h",
+     "third_party/icu/icu_utf.h",
+-    "third_party/nspr/prtime.cc",
+-    "third_party/nspr/prtime.h",
+     "third_party/superfasthash/superfasthash.c",
+     "thread_annotations.h",
+     "threading/hang_watcher.cc",
+diff --git a/base/time/pr_time_unittest.cc b/base/time/pr_time_unittest.cc
+--- a/base/time/pr_time_unittest.cc
++++ b/base/time/pr_time_unittest.cc
+@@ -7,7 +7,7 @@
+ 
+ #include "base/compiler_specific.h"
+ #include "base/cxx17_backports.h"
+-#include "base/third_party/nspr/prtime.h"
++#include <nspr/prtime.h>
+ #include "base/time/time.h"
+ #include "build/build_config.h"
+ #include "testing/gtest/include/gtest/gtest.h"
+diff --git a/base/time/time.cc b/base/time/time.cc
+--- a/base/time/time.cc
++++ b/base/time/time.cc
+@@ -18,7 +18,7 @@
+ #include <utility>
+ 
+ #include "base/strings/stringprintf.h"
+-#include "base/third_party/nspr/prtime.h"
++#include <nspr/prtime.h>
+ #include "base/time/time_override.h"
+ #include "build/build_config.h"
+ #include "third_party/abseil-cpp/absl/types/optional.h"