2019-07-21 03:11:03 -06:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
2019-07-30 08:29:13 -06:00
|
|
|
pkg_dir=$1
|
|
|
|
|
|
|
|
set -- \
|
|
|
|
blink_symbol_level=0 \
|
|
|
|
clang_use_chrome_plugins=false \
|
|
|
|
closure_compile=false \
|
|
|
|
custom_toolchain=\"//build/toolchain/linux/unbundle:default\" \
|
2019-08-01 15:39:47 -06:00
|
|
|
enable_ipc_logging=false \
|
|
|
|
enable_iterator_debugging=false \
|
2019-08-01 15:41:14 -06:00
|
|
|
enable_nacl=false \
|
|
|
|
enable_nacl_nonsfi=false \
|
2019-08-01 15:39:47 -06:00
|
|
|
enable_native_notifications=false \
|
2019-07-30 08:29:13 -06:00
|
|
|
enable_service_discovery=false \
|
|
|
|
enable_swiftshader=false \
|
|
|
|
fatal_linker_warnings=false \
|
2019-08-01 15:41:14 -06:00
|
|
|
fieldtrial_testing_like_official_build=true \
|
2019-07-30 08:29:13 -06:00
|
|
|
host_toolchain=\"//build/toolchain/linux/unbundle:default\" \
|
2019-08-02 16:01:27 -06:00
|
|
|
icu_use_data_file=true \
|
2019-07-31 16:53:53 -06:00
|
|
|
is_clang=true \
|
2019-08-01 15:41:14 -06:00
|
|
|
is_component_build=false \
|
2019-07-30 08:29:13 -06:00
|
|
|
is_debug=false \
|
|
|
|
linux_use_bundled_binutils=false \
|
2019-08-01 15:41:14 -06:00
|
|
|
proprietary_codecs=false \
|
2019-07-30 08:29:13 -06:00
|
|
|
safe_browsing_mode=0 \
|
|
|
|
symbol_level=0 \
|
|
|
|
treat_warnings_as_errors=false \
|
|
|
|
use_allocator=\"none\" \
|
|
|
|
use_allocator_shim=false \
|
|
|
|
use_atk=false \
|
|
|
|
use_cups=false \
|
|
|
|
use_custom_libcxx=false \
|
|
|
|
use_dbus=false \
|
|
|
|
use_gnome_keyring=false \
|
2019-08-01 15:41:14 -06:00
|
|
|
use_official_google_api_keys=false \
|
2019-07-30 08:29:13 -06:00
|
|
|
use_pulseaudio=false \
|
|
|
|
use_sysroot=false \
|
|
|
|
use_system_harfbuzz=true \
|
2019-08-01 23:03:41 -06:00
|
|
|
rtc_use_pipewire = false
|
2019-07-30 08:29:13 -06:00
|
|
|
|
2019-07-28 09:49:11 -06:00
|
|
|
for patch in *.patch; do
|
|
|
|
patch -p1 < "$patch"
|
|
|
|
done
|
2019-07-28 09:07:09 -06:00
|
|
|
|
2019-07-31 16:53:53 -06:00
|
|
|
# Use 'clang' instead of 'gcc'.
|
2019-08-01 16:03:07 -06:00
|
|
|
# Clang is the officially supported compiler and builds chromium faster.
|
2019-08-01 15:55:01 -06:00
|
|
|
export CC=clang CXX=clang++ AR=llvm-ar NM=llvm-nm LD=clang++
|
2019-07-28 01:34:14 -06:00
|
|
|
export PATH=$PWD/fix-python-bin:$PATH
|
|
|
|
|
|
|
|
# Make a temporary script to cause 'python' to resolve to python 2 and not 3.
|
|
|
|
mkdir -p fix-python-bin
|
|
|
|
cat << EOF > ./fix-python-bin/python
|
|
|
|
#!/bin/sh
|
2019-07-28 01:44:02 -06:00
|
|
|
exec python2 "\$@"
|
2019-07-28 01:34:14 -06:00
|
|
|
EOF
|
|
|
|
chmod +x ./fix-python-bin/python
|
2019-07-28 00:36:10 -06:00
|
|
|
|
2019-07-28 15:38:37 -06:00
|
|
|
# Use system nodejs.
|
|
|
|
mkdir -p third_party/node/linux/node-linux-x64/bin
|
|
|
|
ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/
|
|
|
|
|
2019-07-28 14:54:27 -06:00
|
|
|
# Use system libraries.
|
2019-08-01 06:30:34 -06:00
|
|
|
for dep in fontconfig harfbuzz-ng libdrm libevent libjpeg \
|
2019-07-28 14:59:52 -06:00
|
|
|
libpng libwebp libxml libxslt opus re2 snappy yasm; do
|
2019-07-28 14:54:27 -06:00
|
|
|
find . -type f -path "*third_party/$dep/*" \
|
|
|
|
\! -path "*third_party/$dep/chromium/*" \
|
|
|
|
\! -path "*third_party/$dep/google/*" \
|
|
|
|
\! -path './base/third_party/icu/*' \
|
|
|
|
\! -path './third_party/pdfium/third_party/freetype/include/pstables.h' \
|
|
|
|
\! -path './third_party/yasm/run_yasm.py' \
|
|
|
|
\! -regex '.*\.\(gn\|gni\|isolate\|py\)' \
|
|
|
|
-delete
|
|
|
|
done
|
|
|
|
|
|
|
|
# Switch to system provided dependencies.
|
|
|
|
python2 build/linux/unbundle/replace_gn_files.py \
|
2019-08-01 06:30:34 -06:00
|
|
|
--system-libraries fontconfig harfbuzz-ng libdrm libevent \
|
2019-08-01 06:24:41 -06:00
|
|
|
libjpeg libpng libwebp libxml libxslt opus re2 \
|
|
|
|
snappy yasm
|
2019-07-28 14:54:27 -06:00
|
|
|
|
2019-07-30 08:29:13 -06:00
|
|
|
python2 tools/gn/bootstrap/bootstrap.py -s -v --gn-gen-args "$*"
|
2019-07-28 01:07:52 -06:00
|
|
|
|
2019-07-30 09:10:35 -06:00
|
|
|
# All shells seem to support this despite the lack of a POSIX spec for it.
|
|
|
|
# shellcheck disable=2039
|
2019-08-01 10:27:30 -06:00
|
|
|
ulimit -n 4096 ||:
|
2019-07-30 09:10:35 -06:00
|
|
|
|
2019-07-28 00:32:06 -06:00
|
|
|
out/Release/gn gen out/Release \
|
2019-07-28 00:48:09 -06:00
|
|
|
--script-executable=/usr/bin/python2
|
2019-07-27 23:49:13 -06:00
|
|
|
|
2019-07-28 00:32:06 -06:00
|
|
|
ninja -C out/Release chrome chromedriver
|
2019-07-28 09:49:11 -06:00
|
|
|
|
2019-07-28 10:08:35 -06:00
|
|
|
cd out/Release
|
|
|
|
|
|
|
|
for bin in chrome chromedriver *.bin; do
|
2019-07-30 08:29:13 -06:00
|
|
|
install -Dm755 "$bin" "$pkg_dir/usr/lib/chromium/$bin"
|
2019-07-28 10:08:35 -06:00
|
|
|
done
|
2019-07-30 08:29:13 -06:00
|
|
|
|
|
|
|
mkdir -p "$pkg_dir/usr/bin"
|
|
|
|
ln -s /usr/lib/chromium/chrome "$pkg_dir/usr/bin/chrome"
|
|
|
|
ln -s /usr/lib/chromium/chromedriver "$pkg_dir/usr/bin/chromedriver"
|