network/chromium: Support CLANG.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Willy Sudiarto Raharjo 2016-01-27 07:28:25 +07:00
parent ff0fe8c149
commit fbd5bce35d
3 changed files with 20 additions and 4 deletions

View file

@ -7,3 +7,6 @@ use ONLY. If you intend to use this build script for your own
distribution, please get your own set of keys.
Feel free to contact the maintainer of this SlackBuild for more
informations.
You have the option to use clang instead of gcc for the build
process. If so, set USE_CLANG=YES.

View file

@ -41,6 +41,7 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
USE_CLANG=${USE_CLANG:-NO}
# Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
# Here we following the same way of Arch Linux and Gentoo.
@ -87,11 +88,21 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
SLKCFLAGS="${SLKCFLAGS} -Wno-unused-local-typedefs"
if [ "$USE_CLANG" = "YES" ]; then
CLANG_OPT="-Dclang=1 -Dclang_use_chrome_plugins=0"
sed -e '/-Wno-absolute-value/d' -i build/common.gypi
export CC="clang"
export CXX="clang++"
SLKCFLAGS="${SLKCFLAGS} -Wno-unknown-warning-option"
else
CLANG_OPT="-Dclang=0"
SLKCFLAGS="${SLKCFLAGS} -Wno-unused-local-typedefs"
fi
export -n LDFLAGS="$SLKLDFLAGS" CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS"
_conf=(
-Dclang=0
$CLANG_OPT
-Ddisable_glibc=1
-Dffmpeg_branding=Chrome
-Dffmpeg_component=shared_library
@ -168,7 +179,9 @@ cp -a third_party/icu/source/data/in/icudtl.dat $PKG/usr/lib${LIBDIRSUFFIX}/chro
mkdir -p $PKG/usr/man/man1
install -m 0644 -D out/Release/chrome.1 $PKG/usr/man/man1/chromium.1
install -D -m0755 $CWD/chromium.sh $PKG/usr/bin/chromium
mkdir -p $PKG/usr/bin
cat $CWD/chromium.sh | sed s/@LIBDIRSUFFIX@/$LIBDIRSUFFIX/ > $PKG/usr/bin/chromium
chmod 0755 $PKG/usr/bin/chromium
ln -s ../lib${LIBDIRSUFFIX}/chromium/chromedriver $PKG/usr/bin/chromedriver
for size in 16 32; do

View file

@ -13,4 +13,4 @@ CHROMIUM_FLAGS=${CHROMIUM_USER_FLAGS:-$CHROMIUM_FLAGS}
export CHROME_WRAPPER=$(readlink -f "$0")
export CHROME_DESKTOP=chromium.desktop
exec /usr/lib64/chromium/chromium $CHROMIUM_FLAGS "$@"
exec /usr/lib@LIBDIRSUFFIX@/chromium/chromium $CHROMIUM_FLAGS "$@"