3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/browsers/chromium/source/default.nix
Ambroz Bizjak b9093f1c64 chromium: Updates, fixes #11492
Built and run Beta and Stable locally. Dev is surrently superseded by Stable so
it doesn't matter much.

- Dev: 47.0.2508.0 -> 48.0.2564.22
- Beta: 46.0.2490.64 -> 48.0.2564.23
- Stable: 45.0.2454.101 -> 47.0.2526.73

Changed the SSL dependencies to the supported configuration on Linux (according
to Torne @Freenode/#chromium-support).

- NSS is a dependency since it is used to access the ceritiface store.
- Dropped system OpenSSL support, the bundled BoringSSL is used.

This probably fixes issue #10555. Note that without this adjustment the build
fails even.

Dropped uneeded old patches.
2015-12-07 14:52:15 +01:00

76 lines
1.7 KiB
Nix

{ stdenv, fetchurl, fetchpatch, patchutils, python
, channel ? "stable"
}:
with stdenv.lib;
with (import ./update.nix {
inherit (stdenv) system;
}).getChannel channel;
let
transform = flags: concatStringsSep ";" (map (subst: subst + flags) [
"s,^[^/]+(.*)$,$main\\1,"
"s,$main/(build|tools)(/.*)?$,$out/\\1\\2,"
"s,$main/third_party(/.*)?$,$bundled\\1,"
"s,^/,,"
]);
in stdenv.mkDerivation {
name = "chromium-source-${version}";
src = fetchurl main;
buildInputs = [ python ]; # cannot patch shebangs otherwise
phases = [ "unpackPhase" "patchPhase" ];
outputs = [ "out" "bundled" "main" ];
unpackPhase = ''
tar xf "$src" -C / \
--transform="${transform "xS"}" \
--anchored \
--no-wildcards-match-slash \
--exclude='*/tools/gyp' \
--exclude='*/.*'
'';
prePatch = ''
for i in $outputs; do
eval patchShebangs "\$$i"
done
'';
patches =
singleton ./nix_plugin_paths_46.patch ++
singleton ./build_fixes_46.patch ++
singleton ./widevine.patch;
patchPhase = let
diffmod = sym: "/^${sym} /{s/^${sym} //;${transform ""};s/^/${sym} /}";
allmods = "${diffmod "---"};${diffmod "\\+\\+\\+"}";
sedexpr = "/^(---|\\+\\+\\+) *\\/dev\\/null/b;${allmods}";
in ''
runHook prePatch
for i in $patches; do
header "applying patch $i" 3
sed -r -e "${sedexpr}" "$i" | patch -d / -p0
stopNest
done
runHook postPatch
'';
postPatch = ''
sed -i -r \
-e 's/-f(stack-protector)(-all)?/-fno-\1/' \
-e 's|/bin/echo|echo|' \
-e "/python_arch/s/: *'[^']*'/: '""'/" \
"$out/build/common.gypi" "$main/chrome/chrome_tests.gypi"
'';
passthru = {
inherit version channel;
plugins = fetchurl binary;
};
}