git.iko.soy/typeable/nixpkgs
on master help sign in
chromiumDev: Fix the build

python.withPackages avoids the problem with mixed Python 2 and Python 3 dependencies.

commite2adee682725044ddc24ad731a54d6f84e314066 authorMichael Weiss <dev.primeos@gmail.com> dateSat 8 May 2021, 19:55 (6 years ago) parent6751553
1 file changed+13−17
pkgs/applications/networking/browsers/chromium/common.nix+13−17
pkgs/applications/networking/browsers/chromium/common.nix+13−17
@@ -7,7 +7,7 @@
77, xdg-utils, yasm, nasm, minizip, libwebp
88, libusb1, pciutils, nss, re2
99
10−, python2Packages, python3Packages, perl, pkg-config
10+, python2, python3, perl, pkg-config
1111, nspr, systemd, libkrb5
1212, util-linux, alsaLib
1313, bison, gperf
@@ -43,16 +43,12 @@ with lib;
4343
4444let
4545 jre = jre8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731
46− # TODO: Python 3 support is incomplete and "python3 ../../build/util/python2_action.py"
47− # currently doesn't work due to mixed Python 2/3 dependencies:
48− pythonPackages = if chromiumVersionAtLeast "93"
49− then python3Packages
50− else python2Packages;
51− forcePython3Patch = (githubPatch
52− # Reland #8 of "Force Python 3 to be used in build."":
53− "a2d3c362802d9e6b62f895fcda75a3695b77b1b8"
54− "1r9spr2wmjk9x9l3m1gzn6692mlvbxdz0r5hlr5rfwiwr900rxi2"
55− );
46+ python2WithPackages = python2.withPackages(ps: with ps; [
47+ ply jinja2 setuptools
48+ ]);
49+ python3WithPackages = python3.withPackages(ps: with ps; [
50+ ply jinja2 setuptools
51+ ]);
5652
5753 # The additional attributes for creating derivations based on the chromium
5854 # source tree.
@@ -138,10 +134,12 @@ let
138134 };
139135
140136 nativeBuildInputs = [
137+ ninja pkg-config
138+ python2WithPackages perl nodejs
139+ gnutar which
141140 llvmPackages.lldClang.bintools
142− ninja which pythonPackages.python perl pkg-config
143− pythonPackages.ply pythonPackages.jinja2 nodejs
144− gnutar pythonPackages.setuptools
141+ ] ++ lib.optionals (chromiumVersionAtLeast "92") [
142+ python3WithPackages
145143 ];
146144
147145 buildInputs = defaultDependencies ++ [
@@ -174,8 +172,6 @@ let
174172 postPatch = lib.optionalString (chromiumVersionAtLeast "91") ''
175173 # Required for patchShebangs (unsupported):
176174 chmod -x third_party/webgpu-cts/src/tools/deno
177− '' + optionalString (chromiumVersionAtLeast "92") ''
178− patch -p1 --reverse < ${forcePython3Patch}
179175 '' + ''
180176 # remove unused third-party
181177 for lib in ${toString gnSystemLibraries}; do
@@ -313,7 +309,7 @@ let
313309
314310 # This is to ensure expansion of $out.
315311 libExecPath="${libExecPath}"
316− python build/linux/unbundle/replace_gn_files.py --system-libraries ${toString gnSystemLibraries}
312+ ${python2}/bin/python2 build/linux/unbundle/replace_gn_files.py --system-libraries ${toString gnSystemLibraries}
317313 ${gnChromium}/bin/gn gen --args=${escapeShellArg gnFlags} out/Release | tee gn-gen-outputs.txt
318314
319315 # Fail if `gn gen` contains a WARNING.