summaryrefslogtreecommitdiffstats
path: root/chromium
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2016-11-02 21:01:27 +0000
committer Eric Hameleers <alien@slackware.com>2016-11-02 21:01:27 +0000
commit73b2b613cf2c838168825977d7af5230e4d2bfa1 (patch)
treeb94a6d05395df8cf0f9a3e1b72c95ece982f57c0 /chromium
parentb76ba03d5a4fad4afd813b007d91b1e71ce7624a (diff)
downloadasb-73b2b613cf2c838168825977d7af5230e4d2bfa1.tar.gz
asb-73b2b613cf2c838168825977d7af5230e4d2bfa1.tar.xz
chromium: change the build system from gyp to gn
Diffstat (limited to 'chromium')
-rwxr-xr-xchromium/build/chromium.SlackBuild206
1 files changed, 118 insertions, 88 deletions
diff --git a/chromium/build/chromium.SlackBuild b/chromium/build/chromium.SlackBuild
index be4bf065..20fd05e0 100755
--- a/chromium/build/chromium.SlackBuild
+++ b/chromium/build/chromium.SlackBuild
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# $Id$
# Copyright 2013, 2014, 2015, 2016 Eric Hameleers, Eindhoven, NL
# All rights reserved.
@@ -31,6 +31,7 @@
# URL: http://www.chromium.org/
# Build needs: - multilib gcc & glibc for compiling the Native Client (64-bit);
# - libelf with '-D_FILE_OFFSET_BITS=64' added to CFLAGS (32-bit);
+# - libtinfo (provides symlinks required by downloaded clang);
# - ninja.
# - Internet access (for downloading the nacl/pnacl toolchain bins)
# Needs:
@@ -253,7 +254,7 @@
# * Apply patch required for Slackware 14.1.
# 54.0.2840.90-1:
# 03/nov/2016 by Eric Hameleers <alien@slackware.com>
-# * First 54 release.
+# * First 54 release. Build system changed from gyp to gn.
#
# -----------------------------------------------------------------------------
#
@@ -384,34 +385,29 @@ fi
case "$ARCH" in
i486) SLKCFLAGS="-O2 -march=i486 -mtune=i686"
SLKLDFLAGS=""; LIBDIRSUFFIX=""
- TARGETARCH="ia32"
RPMARCH="i386"
DSSE="1"
;;
x86_64) SLKCFLAGS="-O2 -fPIC"
SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64"
- TARGETARCH="x64"
RPMARCH="x86_64"
#DSSE="0"
DSSE="1"
;;
armv7hl) SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16"
SLKLDFLAGS=""; LIBDIRSUFFIX=""
- TARGETARCH="arm"
DSSE="1"
# Widevine not supported (no binary library available):
USE_CDM=0
;;
armv6hl) SLKCFLAGS="-O2 -march=armv6 -mfpu=vfp -mfloat-abi=hard"
SLKLDFLAGS=""; LIBDIRSUFFIX=""
- TARGETARCH="arm"
DSSE="1"
# Widevine not supported (no binary library available):
USE_CDM=0
;;
*) SLKCFLAGS=${SLKCFLAGS:-"O2"}
SLKLDFLAGS=${SLKLDFLAGS:-""}; LIBDIRSUFFIX=${LIBDIRSUFFIX:-""}
- TARGETARCH="ia32"
DSSE="1"
# Widevine not supported by default:
USE_CDM=0
@@ -502,13 +498,15 @@ cat $SRCDIR/patches/chromium_vaapi.patch | patch -p1 --verbose \
# Disable MADV_FREE (if set by glibc) because we are not using linux 4.5 yet:
cat $SRCDIR/patches/chromium_madv_free.patch | patch -p1 --verbose \
2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
-# Don't crap out because of this new compression method of .pak files:
-cat $SRCDIR/patches/chromium_no_gzippable_bindata.patch | patch -p1 --verbose \
- 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
+## Don't crap out because of this new compression method of .pak files:
+#cat $SRCDIR/patches/chromium_no_gzippable_bindata.patch | patch -p1 --verbose \
+# 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
if [ "$ARCH" != "x86_64" ]; then
# For now, disable NaCl except on x86_64 because the precompiled toolchain is
# only available for that architecture at the moment.
+ echo "** Not using clang - architecture '$ARCH' is currently unsupported."
+ USE_CLANG=0
echo "** Not building NaCL - architecture '$ARCH' is currently unsupported."
USE_NACL=0
fi
@@ -529,113 +527,124 @@ if [ "x$SRCEXT" = "x-dev" ]; then
# Save configuration in ~/.config/chromium-dev":
sed -e "s|'filename': 'chromium-browser'|'filename': '${PRGNAM}'|" \
-e "s|'confdir': 'chromium'|'confdir': '${PRGNAM}'|" \
- -i chrome/chrome_exe.gypi
+ -i chrome/BUILD.gn
sed -e 's|config_dir.Append("chromium")|config_dir.Append("'${PRGNAM}'")|' \
-e 's|config_dir.Append("chrome-frame")|config_dir.Append("'chrome-frame$SRCEXT}'")|' \
-i chrome/common/chrome_paths_linux.cc
fi
if [ "$USE_CLANG" = "1" ]; then
- # clang doesn't support this option yet:
- sed -e '/-Wno-absolute-value/d' -i build/common.gypi
-
- # -Dclang=1 uses clang instead of gcc.
- # -Dclang_use_chrome_plugins=1 fails with clang 3.5 - disable for now.
- CLANG_OPTS=" -Dclang=1 -Dclang_use_chrome_plugins=0"
+ # is_clang=true uses clang instead of gcc. Does not work on 32bit though.
+ # clang_use_chrome_plugins=true fails with clang 3.5 - disable for now.
export CC="clang"
export CXX="clang++"
else
- CLANG_OPTS=" -Dclang=0"
+ export CC="gcc"
+ export CXX="g++"
fi
+export AS=as
+export AR=ar
chown -R root:root .
chmod -R u+w,go+r-w,a+X-s .
echo Building ...
-if [ ${USE_NACL} -eq 1 ]; then
- DNACL=0
-else
- DNACL=1
-fi
+[ ${USE_CLANG} -eq 1 ] && do_clang=true || do_clang=false
+[ ${USE_CDM} -eq 1 ] && do_cdm=true || do_cdm=false
+[ ${USE_HOTWORD} -eq 1 ] && do_hotword=true || do_hotword=false
+[ ${USE_NACL} -eq 1 ] && do_nacl=true || do_nacl=false
+[ ${USE_PA} -eq 1 ] && do_pa=true || do_pa=false
export -n LDFLAGS="$SLKLDFLAGS"
export -n CXXFLAGS="$SLKCFLAGS"
export -n CFLAGS="$SLKCFLAGS -Wno-unused-local-typedefs"
_chromium_conf=(
- ${CLANG_OPTS}
- -Ddisable_glibc=1
- -Denable_hangout_services_extension=1
- -Denable_hidpi=1
- -Denable_hotwording=${USE_HOTWORD}
- -Denable_pepper_cdms=1
- -Denable_webrtc=1
- -Denable_widevine=${USE_CDM}
- -Dffmpeg_branding=Chrome
- -Dffmpeg_component=${USE_FFMPEG}_library
- -Dgoogle_api_key=$_google_api_key
- -Dgoogle_default_client_id=$_google_default_client_id
- -Dgoogle_default_client_secret=$_google_default_client_secret
- -Dicu_use_data_file_flag=1
- -Dlinux_sandbox_path=/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/chrome_sandbox
- -Dlinux_strip_binary=1
- -Dlinux_use_bundled_binutils=0
- -Dlinux_use_bundled_gold=0
- -Dlinux_use_gold_binary=0
- -Dlinux_use_gold_flags=0
- -Dlogging_like_official_build=1
- -Dproprietary_codecs=1
- -Dremove_webcore_debug_symbols=1
- -Dusb_ids_path=/usr/share/hwdata/usb.ids
- -Duse_allocator=none
- -Duse_gconf=0
- -Duse_kerberos=0
- -Duse_pulseaudio=${USE_PA}
- -Duse_sysroot=0
- -Duse_system_bzip2=1
- -Duse_system_flac=1
- -Duse_system_ffmpeg=0
- -Duse_system_harfbuzz=0
- -Duse_system_icu=0
- -Duse_system_libevent=1
- -Duse_system_libjpeg=0
- -Duse_system_libpng=0
- -Duse_system_libxml=0
- -Duse_system_libxslt=0
- -Duse_system_nspr=1
- -Duse_system_opus=0
- -Duse_system_snappy=0
- -Duse_system_openssl=1
- -Duse_system_xdg_utils=1
- -Duse_system_yasm=1
- -Duse_system_zlib=0
- -Dwerror=
- -Drelease_extra_cflags="$CFLAGS"
- -Dtarget_arch=${TARGETARCH}
- -Ddisable_nacl=${DNACL}
- -Ddisable_sse2=${DSSE}
+ "clang_use_chrome_plugins=${do_clang}"
+ 'enable_hangout_services_extension=true'
+ 'enable_hidpi=true'
+ "enable_hotwording=${do_hotword}"
+ 'enable_glibc=false'
+ "enable_nacl=${do_nacl}"
+ "enable_nacl_nonsfi=${do_nacl}"
+ 'enable_pepper_cdms=true'
+ 'enable_webrtc=true'
+ "enable_widevine=${do_cdm}"
+ 'fatal_linker_warnings=false'
+ 'ffmpeg_branding="Chrome"'
+ "ffmpeg_component=\"${USE_FFMPEG}_library\""
+ 'fieldtrial_testing_like_official_build=false'
+ "google_api_key=\"$_google_api_key\""
+ "google_default_client_id=\"$_google_default_client_id\""
+ "google_default_client_secret=\"$_google_default_client_secret\""
+ "is_clang=${do_clang}"
+ 'is_debug=false'
+ "linux_sandbox_path=\"/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/chrome_sandbox\""
+ 'linux_strip_binary=true'
+ 'linux_use_bundled_binutils=false'
+ 'linux_use_bundled_gold=false'
+ 'linux_use_gold_binary=false'
+ 'linux_use_gold_flags=false'
+ 'logging_like_official_build=true'
+ 'proprietary_codecs=true'
+ 'remove_webcore_debug_symbols=true'
+ 'treat_warnings_as_errors=false'
+ "usb_ids_path=\"/usr/share/hwdata/usb.ids\""
+ 'use_allocator="none"'
+ 'use_gconf=false'
+ 'use_kerberos=false'
+ "use_pulseaudio=${do_pa}"
+ 'use_sysroot=false'
)
- #-Dlinux_link_gsettings=1
- #-Dlinux_link_libpci=1
- #-Dlinux_link_pulseaudio=0
# Change this back when CRBUG 592268 is fixed (error during final link:
# undefined reference to `base::i18n::GetRawIcuMemory())
# See https://bugs.chromium.org/p/chromium/issues/detail?id=592268
- #-Dicu_use_data_file_flag=0
+ # icu_use_data_file_flag=false
+
+gn_system_libraries=(
+ # 'bzip2'
+ # 'ffmpeg'
+ 'flac'
+ # 'harfbuzz'
+ # 'icu'
+ # 'libevent'
+ # 'libjpeg'
+ # 'libpng'
+ # 'libxml'
+ # 'libxslt'
+ # 'opus'
+ # 'snappy'
+ 'yasm'
+ # 'zlib'
+ )
+
+# Unbundle the libraries which we use from the system.
+# (taken from Arch Linux:)
+# This *should* do what the remove_bundled_libraries.py script does,
+# with the added benefit of not having to list all the remaining libraries:
+echo "-- Unbundling system libraries from $PRGNAM sources."
+for ULIB in ${gn_system_libraries[@]}; do
+ find -type f -path "*third_party/$ULIB/*" \
+ \! -path "*third_party/$ULIB/chromium/*" \
+ \! -path "*third_party/$ULIB/google/*" \
+ \! -regex '.*\.\(gn\|gni\|isolate\|py\)' \
+ -delete
+done
-# Download the NaCL toolchains:
-if [ ${USE_NACL} -eq 1 ]; then
- # We do not need arm_trusted on x86:
- build/download_nacl_toolchains.py --packages nacl_x86_newlib,pnacl_newlib,pnacl_translator sync --extract \
- 2>&1 | tee $OUTPUT/nacl_dl-${PRGNAM}.log
-fi
+# Change bundled libraries to system ones:
+echo "-- Change bundled to system libraries in $PRGNAM sources."
+build/linux/unbundle/replace_gn_files.py --system-libraries ${gn_system_libraries[@]}
# Do not make the build fail, see Chromium issue #386097:
third_party/libaddressinput/chromium/tools/update-strings.py \
2>&1 | tee $OUTPUT/update_strings-${PRGNAM}.log
+# Use usb.ids at run time instead of compiling it in:
+sed -i device/usb/BUILD.gn \
+ -e 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g'
+
# Do not make the build fail, see https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/9JX1N2nf4PU/discussion :
touch chrome/test/data/webui/i18n_process_css_test.html
@@ -655,18 +664,39 @@ cat <<EOF >chrome/test/data/webui_test_resources.grd
</grit>
EOF
fi
-# Unbundle the libraries which we use from the system:
-build/linux/unbundle/replace_gyp_files.py "${_chromium_conf[@]}" \
- 2>&1 | tee $OUTPUT/configure-${PRGNAM}.log
+
+# Download the NaCL and clang toolchains:
+if [ ${USE_NACL} -eq 1 ]; then
+ # We do not need arm_trusted on x86:
+ echo "-- Downloading NaCL toolchains."
+ build/download_nacl_toolchains.py --packages nacl_x86_newlib,pnacl_newlib,pnacl_translator sync --extract \
+ 2>&1 | tee $OUTPUT/nacl_dl-${PRGNAM}.log
+fi
+if [ ${USE_CLANG} -eq 1 -o ${USE_NACL} -eq 1 ]; then
+ # Download clang from Google, required for building NaCL.
+ # Also required when building for ARCH="x86_64" using clang:
+ echo "-- Downloading clang toolchains."
+ tools/clang/scripts/update.py \
+ 2>&1 | tee $OUTPUT/clang_dl-${PRGNAM}.log
+fi
+
# Generate the ninja build files:
-build/gyp_chromium --depth=. "${_chromium_conf[@]}" \
+echo "-- Bootstrapping 'gn'."
+tools/gn/bootstrap/bootstrap.py -v --gn-gen-args "${_chromium_conf[*]}" \
2>&1 | tee $OUTPUT/gyp-${PRGNAM}.log
+echo "-- Generating ninja build files."
+out/Release/gn gen out/Release -v --args="${_chromium_conf[*]}" \
+ 2>&1 | tee -a $OUTPUT/gyp-${PRGNAM}.log
+
# Compile everything:
+echo "-- Compiling the lot."
+LC_ALL=C \
ninja -C out/Release \
pdf chrome chrome_sandbox chromedriver widevinecdmadapter clearkeycdm \
2>&1 | tee $OUTPUT/ninja-${PRGNAM}.log
# Manually install everything:
+echo "-- Manually installing everything."
# The main binary:
install -D out/Release/chrome $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/${PRGNAM}