@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, python
1+{ stdenv, fetchurl, fetchpatch, patchutils, python
22, channel ? "stable"
33, useOpenSSL # XXX
44}:
@@ -19,6 +19,7 @@ let
1919 ]);
2020
2121 pre44 = versionOlder version "44.0.0.0";
22+ is44 = versionOlder version "45.0.0.0" && !pre44;
2223
2324in stdenv.mkDerivation {
2425 name = "chromium-source-${version}";
@@ -47,11 +48,39 @@ in stdenv.mkDerivation {
4748 done
4849 '';
4950
50− patches = if pre44 then [
51− ./nix_plugin_paths_42.patch
52− ] else [
53− ./nix_plugin_paths_44.patch
54− ];
51+ patches = let
52+ baseURL = "https://codereview.chromium.org/download";
53+
54+ mkBlinkFix = issue: sha256: fetchpatch {
55+ url = "${baseURL}/issue${issue}.diff";
56+ inherit sha256;
57+ postFetch = ''
58+ sed -i -e 's,^\(---\|+++\) *[ab]/,&third_party/WebKit/,' "$out"
59+ '';
60+ };
61+
62+ fixes44 = [
63+ # WebPluginContainer::setNeedsLayout
64+ # https://codereview.chromium.org/1157943002/
65+ (mkBlinkFix "1157943002_20001"
66+ "0932yd15zlh2g5a5bbm6qrnfvv22jlfdg8pj0w9z58m5zdzw1p82")
67+ # WebRuntimeFeatures::enablePermissionsAPI
68+ # https://codereview.chromium.org/1156113007/
69+ (mkBlinkFix "1156113007_1"
70+ "1v76brrgdziv1q62ba4bimg0my2dmnkyl68b21nv2vw661v0hzwh")
71+ # Revert of https://codereview.chromium.org/1150543002/
72+ (fetchpatch {
73+ url = "${baseURL}/issue1150543002_1.diff";
74+ sha256 = "0x9sya0m1zcb2vcp2vfss88qqdrh6bzcbx2ngfiql7rkbynnpqn6";
75+ postFetch = ''
76+ ${patchutils}/bin/interdiff "$out" /dev/null > reversed.patch
77+ mv reversed.patch "$out"
78+ '';
79+ })
80+ ];
81+ pluginPaths = if pre44 then singleton ./nix_plugin_paths_42.patch
82+ else singleton ./nix_plugin_paths_44.patch;
83+ in pluginPaths ++ optionals is44 fixes44;
5584
5685 patchPhase = let
5786 diffmod = sym: "/^${sym} /{s/^${sym} //;${transform ""};s/^/${sym} /}";