Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 91 lines (69 sloc) 1.79 KB
#! /bin/bash
PKG=brave-browser
VERSION=0.64.60
BUILD=0
PREFIX=/pkg/$PKG-$VERSION-$BUILD
set -xe
umask 022
BUILD_TMPDIR=/scratch/local2/$PKG-$VERSION-$BUILD.build.tmp
test -d $BUILD_TMPDIR && chmod -c -R u+rwx $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
set -x
mkdir -p $BUILDDIR
cd $BUILDDIR
S=brave-browser-${VERSION}
[ -d brave-browser ] || git clone https://github.com/brave/brave-browser
cd brave-browser
# git pull --rebase
git checkout v${VERSION}
npm install
npm run init
npm run build
npm run build Release
find ${BUILDDIR} -perm -700 ! -perm -005 -exec chmod o+rx '{}' ';'
for b in Debug Release; do
mkdir -p ${PREFIX}/$b
for e in brave \
'*.so' \
'*.pak' \
'*.bin' \
icudtl.dat \
locales \
swiftshader \
; do
cp -ax ${BUILDDIR}/brave-browser/src/out/$b/$e ${PREFIX}/$b/
done
done
rm -f ${PREFIX}/$b/swiftshader/*.TOC
mkdir -p ${PREFIX}/bin
cat >${PREFIX}/bin/brave <<__EOS__
#!/bin/sh
export CHROME_LOG_FILE=chrome_debug.log
exec ${PREFIX}/Release/brave \
--enable-logging \
--v=0 \
--disable-brave-update --disable-chrome-google-url-tracking-client \
$@
__EOS__
chmod 755 ${PREFIX}/bin/brave
cat >${PREFIX}/bin/brave-debug <<__EOS__
#!/bin/sh -x
export CHROME_LOG_FILE=chrome_debug.log
exec ${PREFIX}/Debug/brave \
--enable-logging \
--v=0 \
--disable-brave-update --disable-chrome-google-url-tracking-client \
$@
__EOS__
chmod 755 ${PREFIX}/bin/brave-debug