Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge pull request #124183 from primeos/chromium-backport

[20.09] chromiumBeta: Backport patches to fix the build

authored by Michael Weiss and committed by GitHub b8f96258 12f2cf84

Changed files
+42 -34
pkgs
applications
networking
browsers
+30 -22
pkgs/applications/networking/browsers/chromium/common.nix
··· 7 7 , xdg_utils, yasm, nasm, minizip, libwebp 8 8 , libusb1, pciutils, nss, re2 9 9 10 - , python2Packages, perl, pkgconfig 10 + , python2, python3, perl, pkgconfig 11 11 , nspr, systemd, kerberos 12 12 , utillinux, alsaLib 13 13 , bison, gperf ··· 20 20 , pipewire 21 21 , libva 22 22 , libdrm, wayland, mesa, libxkbcommon # Ozone 23 + , curl 23 24 24 25 # optional dependencies 25 26 , libgcrypt ? null # gnomeSupport || cupsSupport ··· 42 43 43 44 let 44 45 jre = jre8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731 46 + python2WithPackages = python2.withPackages(ps: with ps; [ 47 + ply jinja2 setuptools 48 + ]); 49 + python3WithPackages = python3.withPackages(ps: with ps; [ 50 + ply jinja2 setuptools 51 + ]); 45 52 46 53 # The additional attributes for creating derivations based on the chromium 47 54 # source tree. ··· 100 107 buildPath = "out/${buildType}"; 101 108 libExecPath = "$out/libexec/${packageName}"; 102 109 110 + warnObsoleteVersionConditional = min-version: result: 111 + let ungoogled-version = (importJSON ./upstream-info.json).ungoogled-chromium.version; 112 + in if versionAtLeast ungoogled-version min-version 113 + then warn "chromium: ungoogled version ${ungoogled-version} is newer than a conditional bounded at ${min-version}. You can safely delete it." 114 + result 115 + else result; 103 116 chromiumVersionAtLeast = min-version: 104 - versionAtLeast upstream-info.version min-version; 117 + let result = versionAtLeast upstream-info.version min-version; 118 + in warnObsoleteVersionConditional min-version result; 105 119 versionRange = min-version: upto-version: 106 120 let inherit (upstream-info) version; 107 121 result = versionAtLeast version min-version && versionOlder version upto-version; 108 - ungoogled-version = (importJSON ./upstream-info.json).ungoogled-chromium.version; 109 - in if versionAtLeast ungoogled-version upto-version 110 - then warn "chromium: ungoogled version ${ungoogled-version} is newer than a patchset bounded at ${upto-version}. You can safely delete it." 111 - result 112 - else result; 122 + in warnObsoleteVersionConditional upto-version result; 113 123 114 124 ungoogler = ungoogled-chromium { 115 125 inherit (upstream-info.deps.ungoogled-patches) rev sha256; ··· 126 136 }; 127 137 128 138 nativeBuildInputs = [ 139 + ninja pkgconfig 140 + python2WithPackages perl nodejs 141 + gnutar which 129 142 llvmPackages.lldClang.bintools 130 - ninja which python2Packages.python perl pkgconfig 131 - python2Packages.ply python2Packages.jinja2 nodejs 132 - gnutar python2Packages.setuptools 143 + ] ++ lib.optionals (chromiumVersionAtLeast "92") [ 144 + python3WithPackages 133 145 ]; 134 146 135 147 buildInputs = defaultDependencies ++ [ ··· 143 155 pipewire 144 156 libva 145 157 libdrm wayland mesa.drivers libxkbcommon 158 + curl 146 159 ] ++ optional gnomeKeyringSupport libgnome-keyring3 147 160 ++ optionals gnomeSupport [ gnome.GConf libgcrypt ] 148 161 ++ optionals cupsSupport [ libgcrypt cups ] ··· 151 164 patches = [ 152 165 ./patches/no-build-timestamps.patch # Optional patch to use SOURCE_DATE_EPOCH in compute_build_timestamp.py (should be upstreamed) 153 166 ./patches/widevine-79.patch # For bundling Widevine (DRM), might be replaceable via bundle_widevine_cdm=true in gnFlags 154 - ] ++ optional (chromiumVersionAtLeast "90") 167 + # Fix the build by adding a missing dependency (s. https://crbug.com/1197837): 155 168 ./patches/fix-missing-atspi2-dependency.patch 156 - ++ optionals (chromiumVersionAtLeast "91") [ 169 + ] ++ optionals (chromiumVersionAtLeast "91") [ 157 170 ./patches/closure_compiler-Use-the-Java-binary-from-the-system.patch 158 - (githubPatch 159 - # Revert "Reland #7 of "Force Python 3 to be used in build."" 160 - "38b6a9a8e5901766613879b6976f207aa163588a" 161 - "1lvxbd7rl6hz5j6kh6q83yb6vd9g7anlqbai8g1w1bp6wdpgwvp9" 162 - ) 163 171 ]; 164 172 165 - postPatch = '' 173 + postPatch = lib.optionalString (chromiumVersionAtLeast "91") '' 174 + # Required for patchShebangs (unsupported): 175 + chmod -x third_party/webgpu-cts/src/tools/deno 176 + '' + '' 166 177 # remove unused third-party 167 178 for lib in ${toString gnSystemLibraries}; do 168 179 if [ -d "third_party/$lib" ]; then ··· 266 277 } // optionalAttrs pulseSupport { 267 278 use_pulseaudio = true; 268 279 link_pulseaudio = true; 269 - } // optionalAttrs (chromiumVersionAtLeast "89") { 270 - rtc_pipewire_version = "0.3"; # TODO: Can be removed once ungoogled-chromium is at M90 271 280 # Disable PGO (defaults to 2 since M89) because it fails without additional changes: 272 281 # error: Could not read profile ../../chrome/build/pgo_profiles/chrome-linux-master-1610647094-405a32bcf15e5a84949640f99f84a5b9f61e2f2e.profdata: Unsupported instrumentation profile format version 273 282 chrome_pgo_phase = 0; 274 - } // optionalAttrs (chromiumVersionAtLeast "90") { 275 283 # Disable build with TFLite library because it fails without additional changes: 276 284 # ninja: error: '../../chrome/test/data/simple_test.tflite', needed by 'test_data/simple_test.tflite', missing and no known rule to make it 277 285 # Note: chrome/test/data/simple_test.tflite is in the Git repository but not in chromium-90.0.4400.8.tar.xz ··· 302 310 303 311 # This is to ensure expansion of $out. 304 312 libExecPath="${libExecPath}" 305 - python build/linux/unbundle/replace_gn_files.py --system-libraries ${toString gnSystemLibraries} 313 + ${python2}/bin/python2 build/linux/unbundle/replace_gn_files.py --system-libraries ${toString gnSystemLibraries} 306 314 ${gnChromium}/bin/gn gen --args=${escapeShellArg gnFlags} out/Release | tee gn-gen-outputs.txt 307 315 308 316 # Fail if `gn gen` contains a WARNING.
+12 -12
pkgs/applications/networking/browsers/chromium/upstream-info.json
··· 18 18 } 19 19 }, 20 20 "beta": { 21 - "version": "90.0.4430.72", 22 - "sha256": "0hw916j55lm3qnidfp92i8w6zywdd47rhihn9pn23b7ziz58ik55", 23 - "sha256bin64": "1ddj2pk4m26dpl1ja0r56fvm67c1z1hq5rq5an8px6ixy78s2760", 21 + "version": "91.0.4472.69", 22 + "sha256": "0yqc7py5x48wqg5x90j57vp07qfc20w1j0f30rmyxbgl6v346s0z", 23 + "sha256bin64": "1z82i6pq4wbx44d6ij32dkappywdpaxlfp23kl3p7x4x9hv1c0yq", 24 24 "deps": { 25 25 "gn": { 26 - "version": "2021-02-09", 26 + "version": "2021-04-06", 27 27 "url": "https://gn.googlesource.com/gn", 28 - "rev": "dfcbc6fed0a8352696f92d67ccad54048ad182b3", 29 - "sha256": "1941bzg37c4dpsk3sh6ga3696gpq6vjzpcw9rsnf6kdr9mcgdxvn" 28 + "rev": "dba01723a441c358d843a575cb7720d54ddcdf92", 29 + "sha256": "199xkks67qrn0xa5fhp24waq2vk8qb78a96cb3kdd8v1hgacgb8x" 30 30 } 31 31 } 32 32 }, 33 33 "dev": { 34 - "version": "91.0.4469.4", 35 - "sha256": "08lffqjfcszniwwshililab553a0dvycaa72h1dklxvxf360nz5f", 36 - "sha256bin64": "14xyzjwzcyp6idscq6i87yh2fibjamkz5xfsb2y0hrf2diaqijw1", 34 + "version": "92.0.4512.4", 35 + "sha256": "0ycwr11bz2hlzczs6cajxn5k32m44ndhmqh86iykcbi982dj7jq2", 36 + "sha256bin64": "0wv29rghcbin725qbl8cq20j8w5mlcjmjaqdcr73m753dv3jv8rq", 37 37 "deps": { 38 38 "gn": { 39 - "version": "2021-04-06", 39 + "version": "2021-05-07", 40 40 "url": "https://gn.googlesource.com/gn", 41 - "rev": "dba01723a441c358d843a575cb7720d54ddcdf92", 42 - "sha256": "199xkks67qrn0xa5fhp24waq2vk8qb78a96cb3kdd8v1hgacgb8x" 41 + "rev": "39a87c0b36310bdf06b692c098f199a0d97fc810", 42 + "sha256": "0x63jr5hssm9dl6la4q5ahy669k4gxvbapqxi5w32vv107jrj8v4" 43 43 } 44 44 } 45 45 },