Toggle quote (502 lines)
>Thanks to Marks beautiful "computed-origin-method", Ungoogled-Chromium
>is finally ready for inclusion in Guix.
>
>Features:
>* Chromium 72.
>* No unsolicited network traffic.
>* Free software only.
>* No DRM.
>* Not an April Fools joke.
>
>It's currently using my trivial "fork" of Ungoogled-Chromium[0], which
>will be upstreamed once the upstream reorganization[1] is done.
>
>Comments appreciated!
>
>[0]:
>https://github.com/mbakke/ungoogled-chromium/commit/f9b9074c322a67b04baf0982797cd7b7e09614b5
>[1]: https://github.com/Eloston/ungoogled-chromium/issues/651
>
>* gnu/packages/aux-files/chromium/master-preferences.json,
>gnu/packages/chromium.scm: New files.
>* gnu/local.mk (GNU_SYSTEM_MODULES): Adjust accordingly.
>---
> gnu/local.mk | 1 +
> .../chromium/master-preferences.json | 26 +
> gnu/packages/chromium.scm | 741 ++++++++++++++++++
> 3 files changed, 768 insertions(+)
>create mode 100644
>gnu/packages/aux-files/chromium/master-preferences.json
> create mode 100644 gnu/packages/chromium.scm
>
>diff --git a/gnu/local.mk b/gnu/local.mk
>index 82db1488d6..b5e937cdd7 100644
>--- a/gnu/local.mk
>+++ b/gnu/local.mk
>@@ -100,6 +100,7 @@ GNU_SYSTEM_MODULES = \
> %D%/packages/check.scm \
> %D%/packages/chemistry.scm \
> %D%/packages/chez.scm \
>+ %D%/packages/chromium.scm \
> %D%/packages/ci.scm \
> %D%/packages/cinnamon.scm \
> %D%/packages/clojure.scm \
>diff --git a/gnu/packages/aux-files/chromium/master-preferences.json
>b/gnu/packages/aux-files/chromium/master-preferences.json
>new file mode 100644
>index 0000000000..0caa7cc4cd
>--- /dev/null
>+++ b/gnu/packages/aux-files/chromium/master-preferences.json
>@@ -0,0 +1,26 @@
>+{
>+ "distribution": {
>+ "import_bookmarks": false,
>+ "make_chrome_default": false,
>+ "make_chrome_default_for_user": false,
>+ "verbose_logging": true,
>+ "skip_first_run_ui": true,
>+ "suppress_first_run_default_browser_prompt": true
>+ },
>+ "browser": {
>+ "has_seen_welcome_page" : true,
>+ "check_default_browser" : false
>+ },
>+ "dns_prefetching": {
>+ "enabled": false
>+ },
>+ "alternate_error_pages": {
>+ "enabled": false
>+ },
>+ "hardware": {
>+ "audio_capture_enabled": false
>+ },
>+ "default_apps": "noinstall",
>+ "hide_web_store_icon": true,
>+ "homepage": "https://www.gnu.org/software/guix"
>+}
>diff --git a/gnu/packages/chromium.scm b/gnu/packages/chromium.scm
>new file mode 100644
>index 0000000000..eb404246d3
>--- /dev/null
>+++ b/gnu/packages/chromium.scm
>@@ -0,0 +1,741 @@
>+;;; GNU Guix --- Functional package management for GNU
>+;;; Copyright © 2019 Marius Bakke <mbakke@fastmail.com>
>+;;;
>+;;; 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 (gnu packages chromium)
>+ #:use-module ((guix licenses) #:prefix license:)
>+ #:use-module (guix packages)
>+ #:use-module (guix gexp)
>+ #:use-module (guix store)
>+ #:use-module (guix monads)
>+ #:use-module (guix download)
>+ #:use-module (guix git-download)
>+ #:use-module (guix utils)
>+ #:use-module (guix build-system gnu)
>+ #:use-module (gnu packages)
>+ #:use-module (gnu packages assembly)
>+ #:use-module (gnu packages base)
>+ #:use-module (gnu packages bison)
>+ #:use-module (gnu packages build-tools)
>+ #:use-module (gnu packages compression)
>+ #:use-module (gnu packages cups)
>+ #:use-module (gnu packages curl)
>+ #:use-module (gnu packages fontutils)
>+ #:use-module (gnu packages gcc)
>+ #:use-module (gnu packages ghostscript)
>+ #:use-module (gnu packages gl)
>+ #:use-module (gnu packages glib)
>+ #:use-module (gnu packages gnome)
>+ #:use-module (gnu packages gnuzilla)
>+ #:use-module (gnu packages gperf)
>+ #:use-module (gnu packages gtk)
>+ #:use-module (gnu packages icu4c)
>+ #:use-module (gnu packages image)
>+ #:use-module (gnu packages libevent)
>+ #:use-module (gnu packages libffi)
>+ #:use-module (gnu packages linux)
>+ #:use-module (gnu packages kerberos)
>+ #:use-module (gnu packages ninja)
>+ #:use-module (gnu packages node)
>+ #:use-module (gnu packages pciutils)
>+ #:use-module (gnu packages pkg-config)
>+ #: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)
>+ #:use-module (gnu packages tls)
>+ #:use-module (gnu packages valgrind)
>+ #:use-module (gnu packages vulkan)
>+ #:use-module (gnu packages video)
>+ #:use-module (gnu packages xiph)
>+ #:use-module (gnu packages xml)
>+ #:use-module (gnu packages xdisorg)
>+ #:use-module (gnu packages xorg))
>+
>+(define %preserved-third-party-files
>+ '("base/third_party/dmg_fp" ;X11-style
>+ "base/third_party/dynamic_annotations" ;BSD-2
>+ "base/third_party/icu" ;Unicode, X11-style
>+ "base/third_party/superfasthash" ;BSD-3
>+ "base/third_party/symbolize" ;BSD-3
>+ "base/third_party/xdg_mime" ;LGPL2.1+ or Academic 2.0
>+ "base/third_party/xdg_user_dirs" ;Expat
>+ "chrome/third_party/mozilla_security_manager"
>;MPL-1.1/GPL2+/LGPL2.1+
>+ "courgette/third_party/bsdiff" ;BSD-2, BSD protection license
>+ "courgette/third_party/divsufsort" ;Expat
>+ "net/third_party/http2" ;BSD-3
>+ "net/third_party/mozilla_security_manager" ;MPL-1.1/GPL2+/LGPL2.1+
>+ "net/third_party/nss" ;MPL-2.0
>+ "net/third_party/quic" ;BSD-3
>+ "net/third_party/spdy" ;BSD-3
>+ "net/third_party/uri_template" ;ASL2.0
>+ "third_party/abseil-cpp" ;ASL2.0
>+ "third_party/adobe/flash/flapper_version.h" ;no license, trivial
>+ "third_party/angle" ;BSD-3
>+ "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/third_party/glslang" ;BSD-3
>+ "third_party/angle/third_party/spirv-headers" ;Expat
>+ "third_party/angle/third_party/spirv-tools" ;Expat
>+ "third_party/angle/third_party/vulkan-headers" ;ASL2.0
>+ "third_party/angle/third_party/vulkan-loader" ;ASL2.0
>+ "third_party/angle/third_party/vulkan-tools" ;ASL2.0
>+ "third_party/angle/third_party/vulkan-validation-layers" ;ASL2.0
>+ "third_party/apple_apsl" ;APSL2.0
>+ "third_party/blink" ;BSD-3
>+ "third_party/boringssl" ;OpenSSL/ISC (Google additions are ISC)
>+ "third_party/boringssl/src/third_party/fiat" ;Expat
>+ "third_party/breakpad" ;BSD-3
>+ "third_party/brotli" ;Expat
>+ "third_party/cacheinvalidation" ;ASL2.0
>+ "third_party/catapult" ;BSD-3
>+ "third_party/catapult/common/py_vulcanize/third_party/rcssmin"
>;ASL2.0
>+ "third_party/catapult/common/py_vulcanize/third_party/rjsmin"
>;ASL2.0
>+ "third_party/catapult/third_party/polymer" ;BSD-3
>+ "third_party/catapult/tracing/third_party/d3" ;BSD-3
>+ "third_party/catapult/tracing/third_party/gl-matrix" ;Expat
>+ "third_party/catapult/tracing/third_party/jszip" ;Expat or GPL3
>+ "third_party/catapult/tracing/third_party/mannwhitneyu" ;Expat
>+ "third_party/catapult/tracing/third_party/oboe" ;BSD-2
>+ "third_party/catapult/tracing/third_party/pako" ;Expat
>+ "third_party/ced" ;BSD-3
>+ "third_party/cld_3" ;ASL2.0
>+ "third_party/closure_compiler" ;ASL2.0
>+ "third_party/crashpad" ;ASL2.0
>+ "third_party/crashpad/crashpad/third_party/zlib/zlib_crashpad.h"
>;Zlib
>+ "third_party/crc32c" ;BSD-3
>+ "third_party/cros_system_api" ;BSD-3
>+ "third_party/dom_distiller_js" ;BSD-3
>+ "third_party/fips181" ;BSD-3
>+ "third_party/flatbuffers" ;ASL2.0
>+ "third_party/google_input_tools" ;ASL2.0
>+ "third_party/google_input_tools/third_party/closure_library"
>;ASL2.0
>+
>"third_party/google_input_tools/third_party/closure_library/third_party/closure"
>;Expat
>+ "third_party/googletest" ;BSD-3
>+ "third_party/hunspell" ;MPL1.1/GPL2+/LGPL2.1+
>+ "third_party/iccjpeg" ;IJG
>+ "third_party/inspector_protocol" ;BSD-3
>+ "third_party/jinja2" ;BSD-3
>+ "third_party/jstemplate" ;ASL2.0
>+ "third_party/khronos" ;Expat, SGI
>+ "third_party/leveldatabase" ;BSD-3
>+ "third_party/libXNVCtrl" ;Expat
>+ "third_party/libaddressinput" ;ASL2.0
>+ "third_party/libaom" ;BSD-2 or "Alliance for Open Media Patent
>License 1.0"
>+ "third_party/libaom/source/libaom/third_party/vector" ;Expat
>+ "third_party/libaom/source/libaom/third_party/x86inc" ;ISC
>+ "third_party/libjingle_xmpp" ;BSD-3
>+ "third_party/libphonenumber" ;ASL2.0
>+ "third_party/libsecret" ;LGPL2.1+
>+ "third_party/libsrtp" ;BSD-3
>+ "third_party/libsync" ;ASL2.0
>+ "third_party/libudev" ;LGPL2.1+
>+ "third_party/libwebm" ;BSD-3
>+ "third_party/libxml/chromium" ;BSD-3
>+ "third_party/libyuv" ;BSD-3
>+ "third_party/lss" ;BSD-3
>+ "third_party/markupsafe" ;BSD-3
>+ "third_party/mesa_headers" ;Expat, SGI
>+ "third_party/metrics_proto" ;BSD-3
>+ "third_party/modp_b64" ;BSD-3
>+ "third_party/nasm" ;BSD-2
>+ "third_party/node" ;Expat
>+
>"third_party/node/node_modules/polymer-bundler/lib/third_party/UglifyJS2"
>;BSD-2
>+ "third_party/ots" ;BSD-3
>+ "third_party/pdfium" ;BSD-3
>+ "third_party/pdfium/third_party/agg23" ;Expat
>+ "third_party/pdfium/third_party/base" ;BSD-3
>+ "third_party/pdfium/third_party/bigint" ;Public domain, BSD-3
>+ "third_party/pdfium/third_party/skia_shared" ;BSD-3
>+ "third_party/pdfium/third_party/freetype/include/pstables.h"
>;FreeType
>+ "third_party/ply" ;BSD-3
>+ "third_party/polymer" ;BSD-3
>+ "third_party/protobuf" ;BSD-3
>+ "third_party/protobuf/third_party/six" ;Expat
>+ "third_party/pyjson5" ;ASL2.0
>+ "third_party/qcms" ;Expat
>+ "third_party/rnnoise" ;BSD-3
>+ "third_party/s2cellid" ;ASL2.0
>+ "third_party/sfntly" ;ASL2.0
>+ "third_party/skia" ;BSD-3
>+ "third_party/skia/third_party/gif" ;MPL1.1/GPL2+/LGPL2.1+
>+ "third_party/skia/third_party/skcms" ;BSD-3
>+ "third_party/skia/third_party/vulkan" ;BSD-3
>+ "third_party/smhasher" ;Expat, public domain
>+ "third_party/speech-dispatcher" ;GPL2+
>+ "third_party/spirv-headers" ;ASL2.0
>+ "third_party/SPIRV-Tools" ;ASL2.0
>+ "third_party/sqlite" ;Public domain
>+ "third_party/ungoogled" ;BSD-3
>+ "third_party/usb_ids" ;BSD-3
>+ "third_party/usrsctp" ;BSD-2
>+ "third_party/web-animations-js" ;ASL2.0
>+ "third_party/webdriver" ;ASL2.0
>+ "third_party/webrtc" ;BSD-3
>+ "third_party/webrtc/common_audio/third_party/fft4g" ;Non-copyleft
>+ "third_party/webrtc/common_audio/third_party/spl_sqrt_floor"
>;Public domain
>+ "third_party/webrtc/modules/third_party/fft" ;Non-copyleft
>+ "third_party/webrtc/modules/third_party/g711" ;Public domain
>+ "third_party/webrtc/modules/third_party/g722" ;Public domain
>+ "third_party/webrtc/rtc_base/third_party/base64" ;Non-copyleft
>+ "third_party/webrtc/rtc_base/third_party/sigslot" ;Public domain
>+ "third_party/widevine/cdm/widevine_cdm_version.h" ;BSD-3
>+ "third_party/widevine/cdm/widevine_cdm_common.h" ;BSD-3
>+ "third_party/woff2" ;ASL2.0
>+ "third_party/xdg-utils" ;Expat
>+ "third_party/yasm/run_yasm.py" ;BSD-2 or BSD-3
>+ "third_party/zlib/google" ;BSD-3
>+ "url/third_party/mozilla" ;BSD-3, MPL1.1/GPL2+/LGPL2.1+
>+ "v8/src/third_party/utf8-decoder" ;Expat
>+ "v8/src/third_party/valgrind" ;BSD-4
>+ "v8/third_party/inspector_protocol" ;BSD-3
>+ "v8/third_party/v8/builtins")) ;PSFL
>+
>+(define* (computed-origin-method gexp-promise hash-algo hash
>+ #:optional (name "source")
>+ #:key (system (%current-system))
>+ (guile (default-guile)))
>+ "Return a derivation that executes the G-expression that results
>+from forcing GEXP-PROMISE."
>+ (mlet %store-monad ((guile (package->derivation guile system)))
>+ (gexp->derivation (or name "computed-origin")
>+ (force gexp-promise)
>+ #:system system
>+ #:guile-for-build guile)))
>+
>+(define %chromium-version "72.0.3626.81")
>+(define %ungoogled-revision
>"f9b9074c322a67b04baf0982797cd7b7e09614b5")
>+
>+;; This is a computed origin that does the following:
>+;; 1) Runs the Ungoogled scripts on a pristine Chromium tarball.
>+;; 2) Prunes all third_party folders that are not explicitly
>preserved.
>+;; 3) Adjusts "GN" build files such that system libraries are
>preferred.
>+(define ungoogled-chromium-source
>+ (let* ((chromium-source
>+ (origin
>+ (method url-fetch)
>+ (uri (string-append
>"https://commondatastorage.googleapis.com"
>+ "/chromium-browser-official/chromium-"
>+ %chromium-version ".tar.xz"))
>+ (sha256
>+ (base32
>+
>"01l0vlvcckpag376mjld7qprv63l0z8li689k0h6v3h0i7irzs6z"))))
>+ (ungoogled-source
>+ (origin
>+ (method git-fetch)
>+ (uri (git-reference (url
>"https://github.com/mbakke/ungoogled-chromium")
>+ (commit %ungoogled-revision)))
>+ (file-name (git-file-name "ungoogled-chromium"
>+ (string-take %ungoogled-revision
>7)))
>+ (sha256
>+ (base32
>+
>"0gmk1n3i7lbm7rw8zl4df171yhvrlimj8ksj096bf2dlfhbd44rb")))))
>+
>+ (origin
>+ (method computed-origin-method)
>+ (file-name (string-append "ungoogled-chromium-"
>%chromium-version ".tar.xz"))
>+ (sha256 #f)
>+ (uri
>+ (delay
>+ (with-imported-modules '((guix build utils))
>+ #~(begin
>+ (use-modules (guix build utils))
>+ (let ((chromium-dir (string-append "chromium-"
>#$%chromium-version))
>+ (preserved-files (list
>#$@%preserved-third-party-files)))
>+
>+ (mkdir "/tmp/bin")
>+ (set-path-environment-variable
>+ "PATH" '("bin")
>+ (list "/tmp"
>+ #+(canonical-package patch)
>+ #+(canonical-package xz)
>+ #+(canonical-package tar)
>+ #+python-2
>+ #+python))
>+
>+ (copy-recursively #+ungoogled-source
>"/tmp/ungoogled")
>+
>+ (with-directory-excursion "/tmp/ungoogled"
>+
>+ (format #t "Unpacking chromium tarball...~%")
>+ (force-output)
>+ (invoke "tar" "xf" #+chromium-source)
>+
>+ (format #t "Ungooglifying...~%")
>+ (force-output)
>+ (invoke "python3" "run_buildkit_cli.py" "prune"
>+ "-b" "config_bundles/guix" chromium-dir)
>+ (invoke "python3" "run_buildkit_cli.py" "patches"
>"apply"
>+ "-b" "config_bundles/guix" chromium-dir)
>+ (invoke "python3" "run_buildkit_cli.py" "domains"
>"apply"
>+ "-b" "config_bundles/linux_rooted"
>+ "-c" "/tmp/domainscache.tar.gz"
>chromium-dir)
>+
>+ (with-directory-excursion chromium-dir
>+ (format #t "Pruning third party files...~%")
>+ (force-output)
>+ (apply invoke "python"
>+
>"build/linux/unbundle/remove_bundled_libraries.py"
>+ "--do-remove" preserved-files)
>+
>+ (format #t "Replacing GN files...~%")
>+ (force-output)
>+ (invoke "python3"
>"build/linux/unbundle/replace_gn_files.py"
>+ "--system-libraries" "ffmpeg" "flac"
>"fontconfig"
>+ "freetype" "harfbuzz-ng" "icu" "libdrm"
>"libevent"
>+ "libjpeg" "libpng" "libvpx" "libwebp"
>"libxml"
>+ "libxslt" "openh264" "opus" "re2"
>"snappy" "yasm"
>+ "zlib"))
>+
>+ (format #t (string-append "Packing new Ungoogled
>tarball ...~%"))
>+ (force-output)
>+ (invoke "tar" "cvfa" #$output
>+ ;; Avoid non-determinism in the archive.
>+ "--mtime=@0"
>+ "--owner=root:0"
>+ "--group=root:0"
>+ "--sort=name"
>+ chromium-dir)
>+
>+ #t)))))))))
>+
>+(define opus+custom
>+ (package/inherit opus
>+ (name "opus+custom")
>+ (arguments
>+ (substitute-keyword-arguments (package-arguments opus)
>+ ((#:configure-flags flags ''())
>+ ;; Opus Custom is an optional extension of the Opus
>+ ;; specification that allows for unsupported frame
>+ ;; sizes. Chromium requires that this is enabled.
>+ `(cons "--enable-custom-modes"
>+ ,flags))))))
>+
>+(define libvpx/chromium
>+ ;; Chromium 66 and later requires an unreleased libvpx, so we take
>the
>+ ;; commit from "third_party/libvpx/README.chromium" in the tarball.
>+ (let ((version (package-version libvpx))
>+ (commit "e188b5435de71bcd602c378f1ac0441111f0f915")
>+ (revision "0"))
>+ (package/inherit libvpx
>+ (name "libvpx-chromium")
>+ (version (git-version version revision commit))
>+ (source (origin
>+ (method git-fetch)
>+ (uri (git-reference
>+ (url
>"https://chromium.googlesource.com/webm/libvpx")
>+ (commit commit)))
>+ (file-name (git-file-name name version))
>+ (sha256
>+ (base32
>+
>"0v7lzvgy45zh7zwzmmzkvbcqmhs4xa97z0h97hd3j6myrxcfz1n9")))))))
>+
>+;; Transitional package until HarfBuzz 2.2 is available in Guix master
>branch.
>+(define harfbuzz/chromium
>+ (package/inherit harfbuzz
>+ (version "2.2.0")
>+ (source (origin
>+ (inherit (package-source harfbuzz))
>+ (uri (string-append
>"https://www.freedesktop.org/software/harfbuzz"
>+ "/release/harfbuzz-" version
>".tar.bz2"))
>+ (sha256
>+ (base32
>+
>"047q63jr513azf3g1y7f5xn60b4jdjs9zsmrx04sfw5rasyzrk5p"))))))
>+
>+(define-public ungoogled-chromium
>+ (package
>+ (name "ungoogled-chromium")
>+ (version %chromium-version)
>+ (synopsis "Graphical web browser")
>+ (source ungoogled-chromium-source)
>+ (build-system gnu-build-system)
>+ (arguments
>+ `(#:tests? #f
>+ ;; FIXME: There is a "gn" option specifically for setting
>-rpath, but
>+ ;; it overrides the RUNPATH set by the linker.
>+ #:validate-runpath? #f
>+ #:modules ((