diff options
author | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2016-01-27 07:28:25 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2016-01-27 07:28:25 +0700 |
commit | fbd5bce35dd8171768675733385221d34b2cac91 (patch) | |
tree | fa64115622cf684ae8beec8cb45293b625221332 | |
parent | ff0fe8c14926f2d621cb856901ba3031346ae5f2 (diff) |
network/chromium: Support CLANG.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r-- | network/chromium/README | 3 | ||||
-rw-r--r-- | network/chromium/chromium.SlackBuild | 19 | ||||
-rw-r--r-- | network/chromium/chromium.sh | 2 |
3 files changed, 20 insertions, 4 deletions
diff --git a/network/chromium/README b/network/chromium/README index 79e14e9d5b854..3cb051a84ca36 100644 --- a/network/chromium/README +++ b/network/chromium/README @@ -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. diff --git a/network/chromium/chromium.SlackBuild b/network/chromium/chromium.SlackBuild index 6121cb5cbb9c8..665a5e3c94699 100644 --- a/network/chromium/chromium.SlackBuild +++ b/network/chromium/chromium.SlackBuild @@ -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 diff --git a/network/chromium/chromium.sh b/network/chromium/chromium.sh index c6e00532ab321..6057c639d9e49 100644 --- a/network/chromium/chromium.sh +++ b/network/chromium/chromium.sh @@ -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 "$@" |