2016-05-04 17:37:34 +02:00
|
|
|
{ stdenv, mkChromiumDerivation, channel }:
|
2014-03-19 12:21:10 +01:00
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
2014-04-01 07:36:26 +02:00
|
|
|
mkChromiumDerivation (base: rec {
|
|
|
|
name = "chromium-browser";
|
2014-04-20 08:39:40 +02:00
|
|
|
packageName = "chromium";
|
2015-07-02 10:41:51 +02:00
|
|
|
buildTargets = [ "mksnapshot" "chrome_sandbox" "chrome" ];
|
2014-03-19 12:21:10 +01:00
|
|
|
|
2016-08-06 15:40:56 +02:00
|
|
|
outputs = ["out" "sandbox"];
|
|
|
|
|
|
|
|
sandboxExecutableName = "__chromium-suid-sandbox";
|
|
|
|
|
2014-03-19 12:57:49 +01:00
|
|
|
installPhase = ''
|
2017-06-25 22:37:50 +02:00
|
|
|
mkdir -p "$libExecPath/swiftshader"
|
2015-01-23 01:48:56 +01:00
|
|
|
cp -v "$buildPath/"*.pak "$buildPath/"*.bin "$libExecPath/"
|
2014-04-01 07:36:26 +02:00
|
|
|
cp -v "$buildPath/icudtl.dat" "$libExecPath/"
|
2014-06-18 12:11:36 +02:00
|
|
|
cp -vLR "$buildPath/locales" "$buildPath/resources" "$libExecPath/"
|
2017-06-25 22:37:50 +02:00
|
|
|
cp -v "$buildPath/swiftshader/"*.so "$libExecPath/swiftshader/"
|
2014-04-01 07:36:26 +02:00
|
|
|
cp -v "$buildPath/chrome" "$libExecPath/$packageName"
|
2016-08-06 15:40:56 +02:00
|
|
|
|
2016-11-08 20:18:15 +01:00
|
|
|
if [ -e "$buildPath/libwidevinecdmadapter.so" ]; then
|
|
|
|
cp -v "$buildPath/libwidevinecdmadapter.so" \
|
|
|
|
"$libExecPath/libwidevinecdmadapter.so"
|
|
|
|
fi
|
|
|
|
|
2016-08-06 15:40:56 +02:00
|
|
|
mkdir -p "$sandbox/bin"
|
|
|
|
cp -v "$buildPath/chrome_sandbox" "$sandbox/bin/${sandboxExecutableName}"
|
2014-03-19 12:21:10 +01:00
|
|
|
|
|
|
|
mkdir -vp "$out/share/man/man1"
|
2014-04-01 07:36:26 +02:00
|
|
|
cp -v "$buildPath/chrome.1" "$out/share/man/man1/$packageName.1"
|
2014-03-19 12:21:10 +01:00
|
|
|
|
|
|
|
for icon_file in chrome/app/theme/chromium/product_logo_*[0-9].png; do
|
|
|
|
num_and_suffix="''${icon_file##*logo_}"
|
|
|
|
icon_size="''${num_and_suffix%.*}"
|
|
|
|
expr "$icon_size" : "^[0-9][0-9]*$" || continue
|
|
|
|
logo_output_prefix="$out/share/icons/hicolor"
|
|
|
|
logo_output_path="$logo_output_prefix/''${icon_size}x''${icon_size}/apps"
|
|
|
|
mkdir -vp "$logo_output_path"
|
2014-04-01 07:36:26 +02:00
|
|
|
cp -v "$icon_file" "$logo_output_path/$packageName.png"
|
2014-03-19 12:21:10 +01:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2016-08-06 15:40:56 +02:00
|
|
|
passthru = { inherit sandboxExecutableName; };
|
|
|
|
|
2017-01-03 13:54:07 +01:00
|
|
|
requiredSystemFeatures = [ "big-parallel" ];
|
|
|
|
|
2014-03-19 12:21:10 +01:00
|
|
|
meta = {
|
|
|
|
description = "An open source web browser from Google";
|
|
|
|
homepage = http://www.chromium.org/;
|
2016-01-18 03:33:02 +01:00
|
|
|
maintainers = with maintainers; [ chaoflow ];
|
2014-03-19 12:21:10 +01:00
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.linux;
|
2016-05-04 17:37:34 +02:00
|
|
|
hydraPlatforms = if channel == "stable" then ["x86_64-linux"] else [];
|
2014-03-19 12:21:10 +01:00
|
|
|
};
|
2014-04-01 07:36:26 +02:00
|
|
|
})
|