Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ungoogled-chromium: 84.0.4147.89-1 -> 85.0.4183.102-1 #98231

Merged
merged 1 commit into from Sep 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 24 additions & 12 deletions pkgs/applications/networking/browsers/ungoogled-chromium/common.nix
@@ -1,7 +1,7 @@
{ stdenv, lib, llvmPackages, gnChromium, ninja, which, nodejs, fetchpatch, gnutar
{ stdenv, lib, llvmPackages, gnChromium, ninja, which, nodejs, fetchpatch, fetchurl

# default dependencies
, bzip2, flac, speex, libopus
, gnutar, bzip2, flac, speex, libopus
, libevent, expat, libjpeg, snappy
, libpng, libcap
, xdg_utils, yasm, nasm, minizip, libwebp
Expand Down Expand Up @@ -41,6 +41,7 @@
, ungoogled-chromium
, ungoogled ? false

, channel
, upstream-info
}:

Expand Down Expand Up @@ -110,7 +111,7 @@ let
versionRange = min-version: upto-version:
let inherit (upstream-info) version;
result = versionAtLeast version min-version && versionOlder version upto-version;
stable-version = (import ./upstream-info.nix).stable.version;
stable-version = (importJSON ./upstream-info.json).stable.version;
in if versionAtLeast stable-version upto-version
then warn "chromium: stable version ${stable-version} is newer than a patchset bounded at ${upto-version}. You can safely delete it."
result
Expand All @@ -123,10 +124,13 @@ let
};
base = rec {
name = "${packageName}-unwrapped-${version}";
inherit (upstream-info) channel version;
inherit packageName buildType buildPath;
inherit (upstream-info) version;
inherit channel packageName buildType buildPath;

src = upstream-info.main;
src = fetchurl {
url = "https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${version}.tar.xz";
inherit (upstream-info) sha256;
};

nativeBuildInputs = [
ninja which python2Packages.python perl pkgconfig
Expand All @@ -151,8 +155,9 @@ let
++ optional pulseSupport libpulseaudio
++ optionals useOzone [ libdrm wayland mesa_drivers libxkbcommon ];

patches = [
patches = optionals (versionRange "68" "86") [
./patches/nix_plugin_paths_68.patch
] ++ [
./patches/remove-webp-include-69.patch
./patches/no-build-timestamps.patch
./patches/widevine-79.patch
Expand All @@ -166,12 +171,18 @@ let
#
# ++ optionals (channel == "dev") [ ( githubPatch "<patch>" "0000000000000000000000000000000000000000000000000000000000000000" ) ]
# ++ optional (versionRange "68" "72") ( githubPatch "<patch>" "0000000000000000000000000000000000000000000000000000000000000000" )
] ++ optionals (useVaapi) [ # Improvements for the VA-API build:
] ++ optionals (useVaapi && versionRange "68" "86") [ # Improvements for the VA-API build:
./patches/enable-vdpau-support-for-nvidia.patch # https://aur.archlinux.org/cgit/aur.git/tree/vdpau-support.patch?h=chromium-vaapi
./patches/enable-video-acceleration-on-linux.patch # Can be controlled at runtime (i.e. without rebuilding Chromium)
];

postPatch = ''
postPatch = optionalString (!versionRange "0" "86") ''
# Required for patchShebangs (unsupported interpreter directive, basename: invalid option -- '*', etc.):
substituteInPlace native_client/SConstruct \
--replace "#! -*- python -*-" ""
substituteInPlace third_party/harfbuzz-ng/src/src/update-unicode-tables.make \
--replace "/usr/bin/env -S make -f" "/usr/bin/make -f"
'' + ''
# We want to be able to specify where the sandbox is via CHROME_DEVEL_SANDBOX
substituteInPlace sandbox/linux/suid/client/setuid_sandbox_host.cc \
--replace \
Expand Down Expand Up @@ -300,8 +311,8 @@ let
use_system_libdrm = true;
system_wayland_scanner_path = "${wayland}/bin/wayland-scanner";
} // optionalAttrs ungoogled {
closure_compile = false;
enable_hangout_services_extension = false;
enable_js_type_check = false;
enable_mdns = false;
enable_nacl_nonsfi = false;
enable_one_click_signin = false;
Expand All @@ -313,7 +324,6 @@ let
google_api_key = "";
google_default_client_id = "";
google_default_client_secret = "";
optimize_webui = false;
safe_browsing_mode = 0;
use_official_google_api_keys = false;
use_unofficial_version_number = false;
Expand Down Expand Up @@ -366,9 +376,11 @@ let
origRpath="$(patchelf --print-rpath "$chromiumBinary")"
patchelf --set-rpath "${libGL}/lib:$origRpath" "$chromiumBinary"
'';

passthru.updateScript = ./update.py;
};

# Remove some extraAttrs we supplied to the base attributes already.
in stdenv.mkDerivation (base // removeAttrs extraAttrs [
"name" "gnFlags" "buildTargets"
])
] // { passthru = base.passthru // (extraAttrs.passthru or {}); })
@@ -1,5 +1,5 @@
{ newScope, config, stdenv, llvmPackages_9, llvmPackages_10
, makeWrapper, ed, gnugrep
{ newScope, config, stdenv, fetchurl, makeWrapper
, llvmPackages_10, llvmPackages_11, ed, gnugrep, coreutils, xdg_utils
, glib, gtk3, gnome3, gsettings-desktop-schemas, gn, fetchgit
, libva ? null
, pipewire_0_2
Expand Down Expand Up @@ -29,30 +29,43 @@ let

callPackage = newScope chromium;

chromium = {
chromium = rec {
inherit stdenv llvmPackages;

upstream-info = (callPackage ./update.nix {}).getChannel channel;
upstream-info = (lib.importJSON ./upstream-info.json).${channel};

mkChromiumDerivation = callPackage ./common.nix ({
inherit gnome gnomeSupport gnomeKeyringSupport proprietaryCodecs cupsSupport pulseSupport useOzone;
inherit channel gnome gnomeSupport gnomeKeyringSupport proprietaryCodecs
cupsSupport pulseSupport useOzone;
inherit ungoogled;
# TODO: Remove after we can update gn for the stable channel (backward incompatible changes):
gnChromium = gn.overrideAttrs (oldAttrs: {
version = "2020-03-23";
version = "2020-05-19";
src = fetchgit {
url = "https://gn.googlesource.com/gn";
rev = "5ed3c9cc67b090d5e311e4bd2aba072173e82db9";
sha256 = "00y2d35wvqmx9glaqhfb62wdgbfpwr77v0934nnvh9ks71vnsjqy";
rev = "d0a6f072070988e7b038496c4e7d6c562b649732";
sha256 = "0197msabskgfbxvhzq73gc3wlr3n9cr4bzrhy5z5irbvy05lxk17";
};
});
} // lib.optionalAttrs (channel == "dev") {
} // lib.optionalAttrs (lib.versionAtLeast upstream-info.version "86") {
llvmPackages = llvmPackages_11;
gnChromium = gn.overrideAttrs (oldAttrs: {
version = "2020-05-19";
version = "2020-07-20";
src = fetchgit {
url = "https://gn.googlesource.com/gn";
rev = "d0a6f072070988e7b038496c4e7d6c562b649732";
sha256 = "0197msabskgfbxvhzq73gc3wlr3n9cr4bzrhy5z5irbvy05lxk17";
rev = "3028c6a426a4aaf6da91c4ebafe716ae370225fe";
sha256 = "0h3wf4152zdvrbb0jbj49q6814lfl3rcy5mj8b2pl9s0ahvkbc6q";
};
});
} // lib.optionalAttrs (lib.versionAtLeast upstream-info.version "87") {
llvmPackages = llvmPackages_11;
useOzone = true; # YAY: https://chromium-review.googlesource.com/c/chromium/src/+/2382834 \o/
gnChromium = gn.overrideAttrs (oldAttrs: {
version = "2020-08-17";
src = fetchgit {
url = "https://gn.googlesource.com/gn";
rev = "6f13aaac55a977e1948910942675c69f2b4f7a94";
sha256 = "01hpma1sllpdx09mvr4d6073sg6zmk6iv44kd3r28khymcj4s251";
};
});
});
Expand All @@ -66,22 +79,33 @@ let
ungoogled-chromium = callPackage ./ungoogled.nix {};
};

pkgSuffix = if channel == "dev" then "unstable" else channel;
pkgName = "google-chrome-${pkgSuffix}";
chromeSrc = fetchurl {
urls = map (repo: "${repo}/${pkgName}/${pkgName}_${version}-1_amd64.deb") [
"https://dl.google.com/linux/chrome/deb/pool/main/g"
"http://95.31.35.30/chrome/pool/main/g"
"http://mirror.pcbeta.com/google/chrome/deb/pool/main/g"
"http://repo.fdzh.org/chrome/deb/pool/main/g"
];
sha256 = chromium.upstream-info.sha256bin64;
};

mkrpath = p: "${lib.makeSearchPathOutput "lib" "lib64" p}:${lib.makeLibraryPath p}";
widevineCdm = let upstream-info = chromium.upstream-info; in stdenv.mkDerivation {
widevineCdm = stdenv.mkDerivation {
name = "chrome-widevine-cdm";

# The .deb file for Google Chrome
src = upstream-info.binary;
src = chromeSrc;

phases = [ "unpackPhase" "patchPhase" "installPhase" "checkPhase" ];

unpackCmd = let
widevineCdmPath =
if upstream-info.channel == "stable" then
if channel == "stable" then
"./opt/google/chrome/WidevineCdm"
else if upstream-info.channel == "beta" then
else if channel == "beta" then
"./opt/google/chrome-beta/WidevineCdm"
else if upstream-info.channel == "dev" then
else if channel == "dev" then
"./opt/google/chrome-unstable/WidevineCdm"
else
throw "Unknown chromium channel.";
Expand Down Expand Up @@ -191,10 +215,13 @@ in stdenv.mkDerivation {
'' + ''

# libredirect causes chromium to deadlock on startup
export LD_PRELOAD="\$(echo -n "\$LD_PRELOAD" | tr ':' '\n' | ${gnugrep}/bin/grep -v /lib/libredirect\\\\.so$ | tr '\n' ':')"
export LD_PRELOAD="\$(echo -n "\$LD_PRELOAD" | ${coreutils}/bin/tr ':' '\n' | ${gnugrep}/bin/grep -v /lib/libredirect\\\\.so$ | ${coreutils}/bin/tr '\n' ':')"

export XDG_DATA_DIRS=$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH\''${XDG_DATA_DIRS:+:}\$XDG_DATA_DIRS

# Mainly for xdg-open but also other xdg-* tools:
export PATH="${xdg_utils}/bin\''${PATH:+:}\$PATH"

.
w
EOF
Expand All @@ -214,6 +241,7 @@ in stdenv.mkDerivation {
passthru = {
inherit (chromium) upstream-info browser;
mkDerivation = chromium.mkChromiumDerivation;
inherit sandboxExecutableName;
inherit chromeSrc sandboxExecutableName;
updateScript = ./update.py;
};
}
@@ -1,6 +1,6 @@
{
"84.0.4147.89" = {
rev = "84.0.4147.89-1";
sha256 = "1bqvcq3dj6615198j7cz3ylyyic5zpis06capvl6ybl1na3ainb0";
"85.0.4183.102" = {
rev = "85.0.4183.102-1";
sha256 = "1mdx4a5zcs3an9yx1jxx4amq8p9rcj0hv76r8y7nz6cpsfgd9n3y";
};
}