summary refs log tree commit diff
path: root/pkgs/applications/networking/browsers/chromium/common.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2016-03-20 17:50:17 +0100
committeraszlig <aszlig@redmoonstudios.org>2016-03-20 17:50:17 +0100
commit4f981b4f84707a63904410bb3e2b88621db03e8e (patch)
tree7e3f29ff90aba35f39ff2d6dbfc161b1676fca9e /pkgs/applications/networking/browsers/chromium/common.nix
parent37dbd62a83874cccb766a11e4e28ba88f226614e (diff)
downloadnixpkgs-4f981b4f84707a63904410bb3e2b88621db03e8e.tar
nixpkgs-4f981b4f84707a63904410bb3e2b88621db03e8e.tar.gz
nixpkgs-4f981b4f84707a63904410bb3e2b88621db03e8e.tar.bz2
nixpkgs-4f981b4f84707a63904410bb3e2b88621db03e8e.tar.lz
nixpkgs-4f981b4f84707a63904410bb3e2b88621db03e8e.tar.xz
nixpkgs-4f981b4f84707a63904410bb3e2b88621db03e8e.tar.zst
nixpkgs-4f981b4f84707a63904410bb3e2b88621db03e8e.zip
chromium: Move source/default.nix into common.nix
This addresses #12794 so that we now have only a single tarball where we
base our build on instead of splitting the source into different outputs
first and then reference the outputs.

The reason I did this in the first place is that we previously built the
sandbox as a different derivation and unpacking the whole source tree
just for building the sandbox was a bit too much.

As we now have namespaces sandbox built in by default we no longer have
that derivation anymore. It still might come up however if we want to
build NaCl as a separate derivation (see #8560), but splitting the
source code into things only NaCl might require is already too much work
and doesn't weight out the benefits.

Another issue with the source splitup is that Hydra now has an output
limit for non-fixed-output derivations which we're already hitting.

Tested the build against the stable channel and it went well, but I
haven't tested running the browser.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'pkgs/applications/networking/browsers/chromium/common.nix')
-rw-r--r--pkgs/applications/networking/browsers/chromium/common.nix35
1 files changed, 24 insertions, 11 deletions
diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix
index 8c2703e76ce..d77fd104815 100644
--- a/pkgs/applications/networking/browsers/chromium/common.nix
+++ b/pkgs/applications/networking/browsers/chromium/common.nix
@@ -29,7 +29,7 @@
 , pulseSupport ? false, libpulseaudio ? null
 , hiDPISupport ? false
 
-, source
+, upstream-info
 }:
 
 buildFun:
@@ -97,9 +97,17 @@ let
 
   base = rec {
     name = "${packageName}-${version}";
-    inherit (source) version;
+    inherit (upstream-info) version;
     inherit packageName buildType buildPath;
-    src = source;
+
+    src = upstream-info.main;
+
+    unpackCmd = ''
+      tar xf "$src" \
+        --anchored \
+        --no-wildcards-match-slash \
+        --exclude='*/tools/gyp'
+    '';
 
     buildInputs = defaultDependencies ++ [
       which
@@ -117,16 +125,21 @@ let
       ++ optionals cupsSupport [ libgcrypt cups ]
       ++ optional pulseSupport libpulseaudio;
 
-    # XXX: Wait for https://crbug.com/239107 and https://crbug.com/239181 to
-    #      be fixed, then try again to unbundle everything into separate
-    #      derivations.
-    prePatch = ''
-      cp -dr --no-preserve=mode "${source.main}"/* .
-      cp -dr "${source.bundled}" third_party
-      chmod -R u+w third_party
-    '';
+    patches = [
+      ./patches/build_fixes_46.patch
+      ./patches/widevine.patch
+      (if versionOlder version "50.0.0.0"
+       then ./patches/nix_plugin_paths_46.patch
+       else ./patches/nix_plugin_paths_50.patch)
+    ];
 
     postPatch = ''
+      sed -i -r \
+        -e 's/-f(stack-protector)(-all)?/-fno-\1/' \
+        -e 's|/bin/echo|echo|' \
+        -e "/python_arch/s/: *'[^']*'/: '""'/" \
+        build/common.gypi chrome/chrome_tests.gypi
+
       sed -i -e '/module_path *=.*libexif.so/ {
         s|= [^;]*|= base::FilePath().AppendASCII("${libexif}/lib/libexif.so")|
       }' chrome/utility/media_galleries/image_metadata_extractor.cc