2020-04-03 17:17:57 +00:00
|
|
|
{ stdenv, llvmPackages, gnChromium, ninja, which, nodejs, fetchpatch, gnutar
|
2014-04-01 05:36:26 +00:00
|
|
|
|
|
|
|
# default dependencies
|
2015-06-11 16:23:58 +00:00
|
|
|
, bzip2, flac, speex, libopus
|
2014-04-01 05:36:26 +00:00
|
|
|
, libevent, expat, libjpeg, snappy
|
2017-06-11 08:10:56 +00:00
|
|
|
, libpng, libcap
|
2014-04-01 05:36:26 +00:00
|
|
|
, xdg_utils, yasm, minizip, libwebp
|
2018-07-21 00:44:44 +00:00
|
|
|
, libusb1, pciutils, nss, re2, zlib
|
2014-04-01 05:36:26 +00:00
|
|
|
|
2020-03-23 18:46:22 +00:00
|
|
|
, python2Packages, perl, pkgconfig
|
2016-09-05 16:59:00 +00:00
|
|
|
, nspr, systemd, kerberos
|
2014-04-01 05:36:26 +00:00
|
|
|
, utillinux, alsaLib
|
2014-08-13 02:53:31 +00:00
|
|
|
, bison, gperf
|
2018-10-04 18:01:26 +00:00
|
|
|
, glib, gtk3, dbus-glib
|
2019-01-30 22:55:20 +00:00
|
|
|
, glibc
|
2019-11-10 16:44:34 +00:00
|
|
|
, libXScrnSaver, libXcursor, libXtst, libGLU, libGL
|
2014-12-07 13:52:36 +00:00
|
|
|
, protobuf, speechd, libXdamage, cups
|
2018-10-17 21:03:43 +00:00
|
|
|
, ffmpeg, libxslt, libxml2, at-spi2-core
|
2019-12-10 12:12:58 +00:00
|
|
|
, jre
|
2014-04-01 05:36:26 +00:00
|
|
|
|
|
|
|
# optional dependencies
|
|
|
|
, libgcrypt ? null # gnomeSupport || cupsSupport
|
2019-02-18 08:17:05 +00:00
|
|
|
, libva ? null # useVaapi
|
2020-02-04 21:08:31 +00:00
|
|
|
, libdrm ? null, wayland ? null, mesa_drivers ? null, libxkbcommon ? null # useOzone
|
2014-04-01 05:36:26 +00:00
|
|
|
|
|
|
|
# package customization
|
2019-03-31 00:04:49 +00:00
|
|
|
, useVaapi ? false
|
2020-02-04 21:08:31 +00:00
|
|
|
, useOzone ? false
|
2014-04-01 05:36:26 +00:00
|
|
|
, gnomeSupport ? false, gnome ? null
|
2018-02-25 02:23:58 +00:00
|
|
|
, gnomeKeyringSupport ? false, libgnome-keyring3 ? null
|
2014-04-01 05:36:26 +00:00
|
|
|
, proprietaryCodecs ? true
|
2014-12-07 13:52:36 +00:00
|
|
|
, cupsSupport ? true
|
2015-05-27 19:42:15 +00:00
|
|
|
, pulseSupport ? false, libpulseaudio ? null
|
2014-04-01 05:36:26 +00:00
|
|
|
|
2016-03-20 16:50:17 +00:00
|
|
|
, upstream-info
|
2014-04-01 05:36:26 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildFun:
|
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
2017-07-06 22:54:10 +00:00
|
|
|
# see http://www.linuxfromscratch.org/blfs/view/cvs/xsoft/chromium.html
|
2018-10-28 16:07:19 +00:00
|
|
|
|
2014-04-01 05:36:26 +00:00
|
|
|
let
|
|
|
|
# The additional attributes for creating derivations based on the chromium
|
|
|
|
# source tree.
|
|
|
|
extraAttrs = buildFun base;
|
|
|
|
|
2018-02-26 23:04:33 +00:00
|
|
|
githubPatch = commit: sha256: fetchpatch {
|
|
|
|
url = "https://github.com/chromium/chromium/commit/${commit}.patch";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
2018-01-09 01:11:02 +00:00
|
|
|
|
2016-10-29 02:05:53 +00:00
|
|
|
mkGnFlags =
|
2014-04-01 05:36:26 +00:00
|
|
|
let
|
2016-10-29 02:05:53 +00:00
|
|
|
# Serialize Nix types into GN types according to this document:
|
|
|
|
# https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/language.md
|
|
|
|
mkGnString = value: "\"${escape ["\"" "$" "\\"] value}\"";
|
2014-04-01 05:36:26 +00:00
|
|
|
sanitize = value:
|
2016-10-29 02:05:53 +00:00
|
|
|
if value == true then "true"
|
|
|
|
else if value == false then "false"
|
|
|
|
else if isList value then "[${concatMapStringsSep ", " sanitize value}]"
|
|
|
|
else if isInt value then toString value
|
|
|
|
else if isString value then mkGnString value
|
|
|
|
else throw "Unsupported type for GN value `${value}'.";
|
|
|
|
toFlag = key: value: "${key}=${sanitize value}";
|
2014-04-01 05:36:26 +00:00
|
|
|
in attrs: concatStringsSep " " (attrValues (mapAttrs toFlag attrs));
|
|
|
|
|
2016-10-29 02:05:53 +00:00
|
|
|
gnSystemLibraries = [
|
2019-07-31 08:58:08 +00:00
|
|
|
"flac" "libwebp" "libxslt" "yasm" "opus" "snappy" "libpng"
|
|
|
|
# "zlib" # version 77 reports unresolved dependency on //third_party/zlib:zlib_config
|
2017-07-31 08:01:15 +00:00
|
|
|
# "libjpeg" # fails with multiple undefined references to chromium_jpeg_*
|
|
|
|
# "re2" # fails with linker errors
|
|
|
|
# "ffmpeg" # https://crbug.com/731766
|
2017-12-08 03:44:06 +00:00
|
|
|
# "harfbuzz-ng" # in versions over 63 harfbuzz and freetype are being built together
|
|
|
|
# so we can't build with one from system and other from source
|
2016-10-29 02:05:53 +00:00
|
|
|
];
|
2014-04-01 05:36:26 +00:00
|
|
|
|
|
|
|
opusWithCustomModes = libopus.override {
|
2014-07-28 03:05:01 +00:00
|
|
|
withCustomModes = true;
|
2014-04-01 05:36:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
defaultDependencies = [
|
2015-06-11 16:23:58 +00:00
|
|
|
bzip2 flac speex opusWithCustomModes
|
2014-04-01 05:36:26 +00:00
|
|
|
libevent expat libjpeg snappy
|
2017-06-11 08:10:56 +00:00
|
|
|
libpng libcap
|
2014-04-01 05:36:26 +00:00
|
|
|
xdg_utils yasm minizip libwebp
|
2016-10-29 12:28:06 +00:00
|
|
|
libusb1 re2 zlib
|
2017-10-22 19:36:30 +00:00
|
|
|
ffmpeg libxslt libxml2
|
2018-05-27 12:25:55 +00:00
|
|
|
# harfbuzz # in versions over 63 harfbuzz and freetype are being built together
|
|
|
|
# so we can't build with one from system and other from source
|
2014-04-01 05:36:26 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# build paths and release info
|
2014-04-20 06:39:40 +00:00
|
|
|
packageName = extraAttrs.packageName or extraAttrs.name;
|
2014-04-01 05:36:26 +00:00
|
|
|
buildType = "Release";
|
|
|
|
buildPath = "out/${buildType}";
|
|
|
|
libExecPath = "$out/libexec/${packageName}";
|
|
|
|
|
2019-10-11 20:55:11 +00:00
|
|
|
versionRange = min-version: upto-version:
|
|
|
|
let inherit (upstream-info) version;
|
|
|
|
result = versionAtLeast version min-version && versionOlder version upto-version;
|
|
|
|
stable-version = (import ./upstream-info.nix).stable.version;
|
|
|
|
in if versionAtLeast stable-version upto-version
|
|
|
|
then warn "chromium: stable version ${stable-version} is newer than a patchset bounded at ${upto-version}. You can safely delete it."
|
|
|
|
result
|
|
|
|
else result;
|
|
|
|
|
2014-04-01 05:36:26 +00:00
|
|
|
base = rec {
|
2018-11-18 00:51:12 +00:00
|
|
|
name = "${packageName}-unwrapped-${version}";
|
2019-10-10 20:32:11 +00:00
|
|
|
inherit (upstream-info) channel version;
|
2014-04-01 05:36:26 +00:00
|
|
|
inherit packageName buildType buildPath;
|
2016-03-20 16:50:17 +00:00
|
|
|
|
|
|
|
src = upstream-info.main;
|
|
|
|
|
2017-02-08 19:47:07 +00:00
|
|
|
nativeBuildInputs = [
|
2017-02-08 19:40:39 +00:00
|
|
|
ninja which python2Packages.python perl pkgconfig
|
2017-05-14 13:03:21 +00:00
|
|
|
python2Packages.ply python2Packages.jinja2 nodejs
|
2017-07-06 22:54:10 +00:00
|
|
|
gnutar
|
2020-04-06 10:19:26 +00:00
|
|
|
] ++ optional (versionAtLeast version "83") python2Packages.setuptools;
|
2017-02-08 19:47:07 +00:00
|
|
|
|
2014-04-01 05:36:26 +00:00
|
|
|
buildInputs = defaultDependencies ++ [
|
2016-09-05 16:59:00 +00:00
|
|
|
nspr nss systemd
|
2014-04-01 05:36:26 +00:00
|
|
|
utillinux alsaLib
|
2014-12-30 08:05:12 +00:00
|
|
|
bison gperf kerberos
|
2018-10-04 18:01:26 +00:00
|
|
|
glib gtk3 dbus-glib
|
2019-11-10 16:44:34 +00:00
|
|
|
libXScrnSaver libXcursor libXtst libGLU libGL
|
2018-12-09 03:00:42 +00:00
|
|
|
pciutils protobuf speechd libXdamage at-spi2-core
|
2019-12-10 12:12:58 +00:00
|
|
|
jre
|
2018-02-25 02:23:58 +00:00
|
|
|
] ++ optional gnomeKeyringSupport libgnome-keyring3
|
2014-04-01 05:36:26 +00:00
|
|
|
++ optionals gnomeSupport [ gnome.GConf libgcrypt ]
|
2014-12-07 13:52:36 +00:00
|
|
|
++ optionals cupsSupport [ libgcrypt cups ]
|
2019-02-18 08:17:05 +00:00
|
|
|
++ optional useVaapi libva
|
2020-02-04 21:08:31 +00:00
|
|
|
++ optional pulseSupport libpulseaudio
|
|
|
|
++ optionals useOzone [ libdrm wayland mesa_drivers libxkbcommon ];
|
2014-04-01 05:36:26 +00:00
|
|
|
|
2019-08-10 23:09:55 +00:00
|
|
|
patches = [
|
2018-05-12 00:19:56 +00:00
|
|
|
./patches/nix_plugin_paths_68.patch
|
2018-07-13 21:40:18 +00:00
|
|
|
./patches/remove-webp-include-69.patch
|
2018-11-02 14:43:56 +00:00
|
|
|
./patches/no-build-timestamps.patch
|
2019-10-10 20:32:11 +00:00
|
|
|
./patches/widevine-79.patch
|
2019-12-15 02:40:41 +00:00
|
|
|
./patches/dont-use-ANGLE-by-default.patch
|
2018-10-22 21:36:37 +00:00
|
|
|
# Unfortunately, chromium regularly breaks on major updates and
|
2018-10-24 21:25:36 +00:00
|
|
|
# then needs various patches backported in order to be compiled with GCC.
|
|
|
|
# Good sources for such patches and other hints:
|
2018-10-22 21:36:37 +00:00
|
|
|
# - https://gitweb.gentoo.org/repo/gentoo.git/plain/www-client/chromium/
|
|
|
|
# - https://git.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/chromium
|
|
|
|
# - https://github.com/chromium/chromium/search?q=GCC&s=committer-date&type=Commits
|
|
|
|
#
|
2019-10-10 20:32:11 +00:00
|
|
|
# ++ optionals (channel == "dev") [ ( githubPatch "<patch>" "0000000000000000000000000000000000000000000000000000000000000000" ) ]
|
2019-10-11 20:55:11 +00:00
|
|
|
# ++ optional (versionRange "68" "72") ( githubPatch "<patch>" "0000000000000000000000000000000000000000000000000000000000000000" )
|
2020-04-09 23:08:28 +00:00
|
|
|
] ++ optionals (useVaapi) ([
|
2019-11-22 09:51:56 +00:00
|
|
|
# source: https://aur.archlinux.org/cgit/aur.git/tree/vaapi-fix.patch?h=chromium-vaapi
|
|
|
|
./patches/vaapi-fix.patch
|
2020-04-09 23:08:28 +00:00
|
|
|
] ++ optionals (versionRange "81" "82") [
|
|
|
|
(githubPatch "5b2ff215473e0526b5b24aeff4ad90d369b21c75" "0n00vh8wfpn2ay5fqsxcsx0zadnv7mihm72bcvnrfzh75nzbg902")
|
|
|
|
(githubPatch "98e343ab369e4262511b5fce547728e3e5eefba8" "00wwp653jk0k0yvix00vr7ymgck9dj7fxjwx4nc67ynn84dh6064")
|
|
|
|
]);
|
2018-10-24 21:25:36 +00:00
|
|
|
|
2015-06-19 17:35:30 +00:00
|
|
|
postPatch = ''
|
2016-08-04 19:26:05 +00:00
|
|
|
# We want to be able to specify where the sandbox is via CHROME_DEVEL_SANDBOX
|
|
|
|
substituteInPlace sandbox/linux/suid/client/setuid_sandbox_host.cc \
|
|
|
|
--replace \
|
2016-08-05 09:55:48 +00:00
|
|
|
'return sandbox_binary;' \
|
|
|
|
'return base::FilePath(GetDevelSandboxPath());'
|
2016-08-04 19:26:05 +00:00
|
|
|
|
2019-01-30 22:55:20 +00:00
|
|
|
substituteInPlace services/audio/audio_sandbox_hook_linux.cc \
|
|
|
|
--replace \
|
|
|
|
'/usr/share/alsa/' \
|
|
|
|
'${alsaLib}/share/alsa/' \
|
|
|
|
--replace \
|
|
|
|
'/usr/lib/x86_64-linux-gnu/gconv/' \
|
|
|
|
'${glibc}/lib/gconv/' \
|
|
|
|
--replace \
|
|
|
|
'/usr/share/locale/' \
|
|
|
|
'${glibc}/share/locale/'
|
|
|
|
|
2017-03-07 10:10:58 +00:00
|
|
|
sed -i -e 's@"\(#!\)\?.*xdg-@"\1${xdg_utils}/bin/xdg-@' \
|
|
|
|
chrome/browser/shell_integration_linux.cc
|
|
|
|
|
2016-09-05 16:59:00 +00:00
|
|
|
sed -i -e '/lib_loader.*Load/s!"\(libudev\.so\)!"${systemd.lib}/lib/\1!' \
|
2015-01-23 00:48:56 +00:00
|
|
|
device/udev_linux/udev?_loader.cc
|
|
|
|
|
|
|
|
sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \
|
|
|
|
gpu/config/gpu_info_collector_linux.cc
|
2016-05-28 17:04:22 +00:00
|
|
|
|
2016-03-29 23:05:07 +00:00
|
|
|
sed -i -re 's/([^:])\<(isnan *\()/\1std::\2/g' \
|
|
|
|
chrome/browser/ui/webui/engagement/site_engagement_ui.cc
|
2016-10-29 02:05:53 +00:00
|
|
|
|
|
|
|
sed -i -e '/#include/ {
|
|
|
|
i #include <algorithm>
|
|
|
|
:l; n; bl
|
|
|
|
}' gpu/config/gpu_control_list.cc
|
|
|
|
|
2017-06-18 02:29:22 +00:00
|
|
|
# Allow to put extensions into the system-path.
|
|
|
|
sed -i -e 's,/usr,/run/current-system/sw,' chrome/common/chrome_paths.cc
|
|
|
|
|
2016-10-29 02:05:53 +00:00
|
|
|
patchShebangs .
|
2017-05-14 13:03:21 +00:00
|
|
|
# use our own nodejs
|
|
|
|
mkdir -p third_party/node/linux/node-linux-x64/bin
|
|
|
|
ln -s $(which node) third_party/node/linux/node-linux-x64/bin/node
|
2017-07-06 22:54:10 +00:00
|
|
|
|
|
|
|
# remove unused third-party
|
2018-05-12 00:19:44 +00:00
|
|
|
# in third_party/crashpad third_party/zlib contains just a header-adapter
|
2017-07-06 22:54:10 +00:00
|
|
|
for lib in ${toString gnSystemLibraries}; do
|
|
|
|
find -type f -path "*third_party/$lib/*" \
|
2018-05-12 00:19:44 +00:00
|
|
|
\! -path "*third_party/crashpad/crashpad/third_party/zlib/*" \
|
2017-07-06 22:54:10 +00:00
|
|
|
\! -path "*third_party/$lib/chromium/*" \
|
|
|
|
\! -path "*third_party/$lib/google/*" \
|
|
|
|
\! -path "*base/third_party/icu/*" \
|
|
|
|
\! -path "*base/third_party/libevent/*" \
|
|
|
|
\! -regex '.*\.\(gn\|gni\|isolate\|py\)' \
|
|
|
|
-delete
|
|
|
|
done
|
2018-01-21 13:31:54 +00:00
|
|
|
'' + optionalString stdenv.isAarch64 ''
|
|
|
|
substituteInPlace build/toolchain/linux/BUILD.gn \
|
|
|
|
--replace 'toolprefix = "aarch64-linux-gnu-"' 'toolprefix = ""'
|
2018-10-24 21:25:36 +00:00
|
|
|
'' + optionalString stdenv.cc.isClang ''
|
|
|
|
mkdir -p third_party/llvm-build/Release+Asserts/bin
|
|
|
|
ln -s ${stdenv.cc}/bin/clang third_party/llvm-build/Release+Asserts/bin/clang
|
|
|
|
ln -s ${stdenv.cc}/bin/clang++ third_party/llvm-build/Release+Asserts/bin/clang++
|
|
|
|
ln -s ${llvmPackages.llvm}/bin/llvm-ar third_party/llvm-build/Release+Asserts/bin/llvm-ar
|
2014-04-01 05:36:26 +00:00
|
|
|
'';
|
|
|
|
|
2016-10-29 02:05:53 +00:00
|
|
|
gnFlags = mkGnFlags ({
|
2014-08-13 02:53:31 +00:00
|
|
|
linux_use_bundled_binutils = false;
|
2018-10-24 21:25:36 +00:00
|
|
|
use_lld = false;
|
2017-02-08 19:42:06 +00:00
|
|
|
use_gold = true;
|
|
|
|
gold_path = "${stdenv.cc}/bin";
|
2016-10-29 02:05:53 +00:00
|
|
|
is_debug = false;
|
2016-03-28 09:31:21 +00:00
|
|
|
|
2014-04-01 05:36:26 +00:00
|
|
|
proprietary_codecs = false;
|
2015-12-29 18:32:30 +00:00
|
|
|
use_sysroot = false;
|
2014-04-01 05:36:26 +00:00
|
|
|
use_gnome_keyring = gnomeKeyringSupport;
|
|
|
|
use_gio = gnomeSupport;
|
2019-12-14 18:07:28 +00:00
|
|
|
# ninja: error: '../../native_client/toolchain/linux_x86/pnacl_newlib/bin/x86_64-nacl-objcopy',
|
|
|
|
# needed by 'nacl_irt_x86_64.nexe', missing and no known rule to make it
|
|
|
|
enable_nacl = false;
|
2019-12-14 18:52:43 +00:00
|
|
|
# Enabling the Widevine component here doesn't affect whether we can
|
|
|
|
# redistribute the chromium package; the Widevine component is either
|
|
|
|
# added later in the wrapped -wv build or downloaded from Google.
|
2019-08-10 23:09:55 +00:00
|
|
|
enable_widevine = true;
|
2014-04-01 05:36:26 +00:00
|
|
|
use_cups = cupsSupport;
|
2017-07-31 08:01:15 +00:00
|
|
|
|
2016-10-29 02:05:53 +00:00
|
|
|
treat_warnings_as_errors = false;
|
2018-10-24 21:25:36 +00:00
|
|
|
is_clang = stdenv.cc.isClang;
|
2017-07-31 08:01:15 +00:00
|
|
|
clang_use_chrome_plugins = false;
|
2019-06-05 09:06:03 +00:00
|
|
|
blink_symbol_level = 0;
|
2017-07-31 08:01:15 +00:00
|
|
|
fieldtrial_testing_like_official_build = true;
|
2014-04-01 05:36:26 +00:00
|
|
|
|
2014-04-19 13:25:21 +00:00
|
|
|
# Google API keys, see:
|
|
|
|
# http://www.chromium.org/developers/how-tos/api-keys
|
2014-04-01 05:36:26 +00:00
|
|
|
# Note: These are for NixOS/nixpkgs use ONLY. For your own distribution,
|
|
|
|
# please get your own set of keys.
|
|
|
|
google_api_key = "AIzaSyDGi15Zwl11UNe6Y-5XW_upsfyw31qwZPI";
|
|
|
|
google_default_client_id = "404761575300.apps.googleusercontent.com";
|
|
|
|
google_default_client_secret = "9rIFQjfnkykEmqb6FfjJQD1D";
|
|
|
|
} // optionalAttrs proprietaryCodecs {
|
|
|
|
# enable support for the H.264 codec
|
|
|
|
proprietary_codecs = true;
|
2015-10-07 16:42:24 +00:00
|
|
|
enable_hangout_services_extension = true;
|
2014-04-01 05:36:26 +00:00
|
|
|
ffmpeg_branding = "Chrome";
|
2019-02-18 08:17:05 +00:00
|
|
|
} // optionalAttrs useVaapi {
|
|
|
|
use_vaapi = true;
|
2016-10-29 02:05:53 +00:00
|
|
|
} // optionalAttrs pulseSupport {
|
|
|
|
use_pulseaudio = true;
|
|
|
|
link_pulseaudio = true;
|
2020-02-04 21:08:31 +00:00
|
|
|
} // optionalAttrs useOzone {
|
|
|
|
use_ozone = true;
|
|
|
|
ozone_platform_gbm = false;
|
|
|
|
use_xkbcommon = true;
|
|
|
|
use_glib = true;
|
|
|
|
use_gtk = true;
|
|
|
|
use_system_libwayland = true;
|
|
|
|
use_system_minigbm = true;
|
|
|
|
use_system_libdrm = true;
|
|
|
|
system_wayland_scanner_path = "${wayland}/bin/wayland-scanner";
|
2016-10-29 02:05:53 +00:00
|
|
|
} // (extraAttrs.gnFlags or {}));
|
2014-04-01 05:36:26 +00:00
|
|
|
|
|
|
|
configurePhase = ''
|
2017-02-08 19:48:05 +00:00
|
|
|
runHook preConfigure
|
|
|
|
|
2014-04-01 05:36:26 +00:00
|
|
|
# This is to ensure expansion of $out.
|
|
|
|
libExecPath="${libExecPath}"
|
2016-10-29 02:05:53 +00:00
|
|
|
python build/linux/unbundle/replace_gn_files.py \
|
|
|
|
--system-libraries ${toString gnSystemLibraries}
|
2020-04-03 17:17:57 +00:00
|
|
|
${gnChromium}/bin/gn gen --args=${escapeShellArg gnFlags} out/Release | tee gn-gen-outputs.txt
|
2018-06-19 00:48:42 +00:00
|
|
|
|
|
|
|
# Fail if `gn gen` contains a WARNING.
|
|
|
|
grep -o WARNING gn-gen-outputs.txt && echo "Found gn WARNING, exiting nix build" && exit 1
|
2017-02-08 19:48:05 +00:00
|
|
|
|
|
|
|
runHook postConfigure
|
2014-04-01 05:36:26 +00:00
|
|
|
'';
|
|
|
|
|
2020-04-02 22:02:23 +00:00
|
|
|
# Don't spam warnings about unknown warning options. This is useful because
|
|
|
|
# our Clang is always older than Chromium's and the build logs have a size
|
|
|
|
# of approx. 25 MB without this option (and this saves e.g. 66 %).
|
|
|
|
NIX_CFLAGS_COMPILE = "-Wno-unknown-warning-option";
|
|
|
|
|
2014-04-01 05:36:26 +00:00
|
|
|
buildPhase = let
|
2017-09-01 10:24:47 +00:00
|
|
|
# Build paralelism: on Hydra the build was frequently running into memory
|
|
|
|
# exhaustion, and even other users might be running into similar issues.
|
|
|
|
# -j is halved to avoid memory problems, and -l is slightly increased
|
|
|
|
# so that the build gets slight preference before others
|
|
|
|
# (it will often be on "critical path" and at risk of timing out)
|
2014-08-13 02:49:53 +00:00
|
|
|
buildCommand = target: ''
|
2017-02-08 19:47:07 +00:00
|
|
|
ninja -C "${buildPath}" \
|
2017-09-01 10:24:47 +00:00
|
|
|
-j$(( ($NIX_BUILD_CORES+1) / 2 )) -l$(( $NIX_BUILD_CORES+1 )) \
|
2014-08-13 02:49:53 +00:00
|
|
|
"${target}"
|
2017-11-08 22:44:20 +00:00
|
|
|
(
|
|
|
|
source chrome/installer/linux/common/installer.include
|
|
|
|
PACKAGE=$packageName
|
|
|
|
MENUNAME="Chromium"
|
|
|
|
process_template chrome/app/resources/manpage.1.in "${buildPath}/chrome.1"
|
|
|
|
)
|
2014-04-25 01:58:33 +00:00
|
|
|
'';
|
|
|
|
targets = extraAttrs.buildTargets or [];
|
|
|
|
commands = map buildCommand targets;
|
|
|
|
in concatStringsSep "\n" commands;
|
2019-07-15 06:35:03 +00:00
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
# Make sure that libGLESv2 is found by dlopen (if using EGL).
|
|
|
|
chromiumBinary="$libExecPath/$packageName"
|
|
|
|
origRpath="$(patchelf --print-rpath "$chromiumBinary")"
|
|
|
|
patchelf --set-rpath "${libGL}/lib:$origRpath" "$chromiumBinary"
|
|
|
|
'';
|
2014-04-01 05:36:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Remove some extraAttrs we supplied to the base attributes already.
|
|
|
|
in stdenv.mkDerivation (base // removeAttrs extraAttrs [
|
2016-10-29 02:05:53 +00:00
|
|
|
"name" "gnFlags" "buildTargets"
|
2014-04-01 05:36:26 +00:00
|
|
|
])
|