-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
139 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
#! /bin/bash -x | ||
|
||
PKG=chromium | ||
VERSION=89.0.4389.128 | ||
BUILD=0 | ||
|
||
PREFIX=/pkg/$PKG-$VERSION-$BUILD | ||
if [ -n "$TESTING" ]; then PREFIX=/scratch/local2/$PKG-$VERSION-$BUILD ; fi | ||
|
||
set -xe | ||
umask 022 | ||
|
||
BUILD_TMPDIR=/scratch/local2/$PKG-$VERSION-$BUILD.build.tmp | ||
test -d $BUILD_TMPDIR && rm -rf $BUILD_TMPDIR | ||
mkdir -p $BUILD_TMPDIR/home | ||
export TMPDIR=$BUILD_TMPDIR | ||
export HOME=$BUILD_TMPDIR/home | ||
|
||
exec </dev/null | ||
|
||
mkdir -p $PREFIX | ||
cat >$PREFIX/profile <<-EOF | ||
PATH=$PREFIX/bin:\$PATH | ||
if [ -d $PREFIX/.compatlibs ]; then export LD_LIBRARY_PATH=$PREFIX/.compatlibs\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH} ; fi | ||
EOF | ||
. $PREFIX/profile | ||
|
||
export MAKEFLAGS="-j $(nproc)" | ||
|
||
BUILDDIR=$PREFIX/build | ||
|
||
#source google API Zeug; wird benoetigt damit browser sync funktioniert | ||
dirname="$(dirname $0)" | ||
if [ -f ${dirname}/google_api_zeug ]; then | ||
. ${dirname}/google_api_zeug | ||
else | ||
echo "google_default_client_id, google_api_key und google_default_client_secret wird benoetigt, damit Browser Sync funktioniert(siehe HelmutSchmidtSeite)." | ||
exit 1 | ||
# uncomment if you want it with out api key | ||
fi | ||
|
||
mkdir -p $BUILDDIR | ||
cd $BUILDDIR | ||
|
||
#test -d depot_tools || git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git | ||
|
||
PATH=$PREFIX/build/depot_tools:$PATH | ||
|
||
test -e ${PKG}-${VERSION}.tar.xz || wget https://commondatastorage.googleapis.com/${PKG}-browser-official/${PKG}-${VERSION}.tar.xz | ||
test -d ${PKG}-${VERSION} || tar xvf ${PKG}-${VERSION}.tar.xz | ||
|
||
cd ${PKG}-${VERSION} | ||
|
||
cat /src/mariux/patches/chromium-72-as-needed.patch | patch -p1 --verbose | ||
|
||
#Create Directories for Build and Install | ||
test -d $PREFIX/bin || mkdir $PREFIX/bin | ||
test -d out || mkdir out | ||
|
||
mkdir -p third_party/node/linux/node-linux-x64/bin | ||
if [ ! -e third_party/node/linux/node-linux-x64/bin/node ]; then | ||
ln -s /pkg/node-10.16.0-0/bin/node third_party/node/linux/node-linux-x64/bin/ | ||
fi | ||
# Download the NaCL toolchains: | ||
python2 build/download_nacl_toolchains.py --packages nacl_x86_newlib,pnacl_newlib,pnacl_translator sync --extract | ||
# Do not make the build fail, see Chromium issue #386097: | ||
python2 third_party/libaddressinput/chromium/tools/update-strings.py | ||
|
||
# Fix for: ERROR at //build/config/sysroot.gni:57:5: Assertion failed | ||
python2 build/linux/sysroot_scripts/install-sysroot.py --arch=amd64 | ||
|
||
# Generate the ninja build files: | ||
python2 tools/gn/bootstrap/bootstrap.py | ||
|
||
python2 tools/clang/scripts/build.py \ | ||
--skip-checkout \ | ||
--use-system-cmake \ | ||
--without-android \ | ||
--without-fuchsia | ||
|
||
#Ensure that only this clang version is used | ||
export PATH=${BUILDDIR}/${PKG}-${VERSION}/third_party/llvm-build/Release+Asserts/bin:$PATH | ||
|
||
_chromium_conf=( | ||
'is_debug=false' | ||
'remove_webcore_debug_symbols=true' | ||
'use_gnome_keyring=true' | ||
'treat_warnings_as_errors=false' | ||
'enable_nacl=true' | ||
'use_sysroot=true' | ||
'is_official_build=true' | ||
'fatal_linker_warnings=false' | ||
'enable_platform_hevc=true' | ||
'enable_platform_ac3_eac3_audio=true' | ||
'enable_platform_mpeg_h_audio=true' | ||
'enable_precompiled_headers=false' | ||
"google_api_key=\"$google_api_key\"" | ||
"google_default_client_id=\"$google_default_client_id\"" | ||
"google_default_client_secret=\"$google_default_client_secret\"" | ||
) | ||
|
||
# make sure to use python2 | ||
source /pkg/python-2.7.16-0/profile | ||
|
||
out/Release/gn gen out/Release --args="${_chromium_conf[*]}" | ||
|
||
#ninja -C out/Release pdf chrome chromedriver chrome_sandbox | ||
ninja -C out/Release chrome | ||
|
||
install -D out/Release/chrome ${PREFIX}/bin/chrome2 | ||
|
||
cp -a out/Release/*.pak ${PREFIX}/bin/ | ||
cp -a out/Release/*.so ${PREFIX}/bin/ | ||
cp -a out/Release/nacl_helper{,_bootstrap,_nonsfi} ${PREFIX}/bin/ | ||
cp -a out/Release/nacl_irt_*.nexe ${PREFIX}/bin/ | ||
cp -a out/Release/icudtl.dat ${PREFIX}/bin/ | ||
cp -a out/Release/locales ${PREFIX}/bin/ | ||
cp -ar out/Release/swiftshader ${PREFIX}/bin/ | ||
|
||
for i in out/Release/{natives_blob.bin,snapshot_blob.bin,v8_context_snapshot.bin}; do | ||
if [ -f $i ]; then | ||
cp -a $i ${PREFIX}/bin/ | ||
fi | ||
done | ||
|
||
strip --strip-unneeded ${PREFIX}/bin/*.so | ||
strip --strip-unneeded ${PREFIX}/bin/chrome2 | ||
strip --strip-unneeded ${PREFIX}/bin/nacl_helper{,_bootstrap,_nonsfi} | ||
strip --strip-unneeded ${PREFIX}/bin/swiftshader/*.so | ||
|
||
cat >$PREFIX/bin/chromium <<-EOF | ||
#!/usr/bin/bash | ||
$PREFIX/bin/chrome2 --password-store=basic \${@} | ||
EOF | ||
chmod a+x $PREFIX/bin/chromium | ||
cd $PREFIX/bin | ||
ln -s chromium chrome | ||
|
||
exit |