summaryrefslogtreecommitdiffstats
path: root/chromium/build/chromium.SlackBuild
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2020-04-16 15:26:41 +0000
committer Eric Hameleers <alien@slackware.com>2020-04-16 15:26:41 +0000
commit12579a3ddacb736d8382d589fbac283deb7ccd03 (patch)
tree44ff45e3cc90d0ea6d0f547034eafd7ab4401210 /chromium/build/chromium.SlackBuild
parent3af79ef585027aa41b30118d2e26bacb494bba66 (diff)
downloadasb-12579a3ddacb736d8382d589fbac283deb7ccd03.tar.gz
asb-12579a3ddacb736d8382d589fbac283deb7ccd03.tar.xz
chromium: allow building with a sysroot on older SlackwaresHEADmaster
Diffstat (limited to 'chromium/build/chromium.SlackBuild')
-rwxr-xr-xchromium/build/chromium.SlackBuild39
1 files changed, 38 insertions, 1 deletions
diff --git a/chromium/build/chromium.SlackBuild b/chromium/build/chromium.SlackBuild
index e50d976f..e14f6276 100755
--- a/chromium/build/chromium.SlackBuild
+++ b/chromium/build/chromium.SlackBuild
@@ -490,6 +490,9 @@ else
USE_PA=${USE_PA:-0}
fi
+# Build Chromium using a debian sysroot for Slackware 14.2 or older:
+USE_SYSROOT=${USE_SYSROOT:-0}
+
# By default the ffmpeg and other component libraries are built statically
# into the chromium binary. This takes more time at the linking stage but
# will speed up the browser's startup.
@@ -595,6 +598,8 @@ case "$ARCH" in
SLKLDFLAGS="-Wl,-z,notext"; LIBDIRSUFFIX=""
DSSE="1"
FFMPEG_ARCH="ia32"
+ SYSROOT_ARCH="i386"
+ SYSROOT_TARGET="i386"
PKGARCH="$ARCH"
;;
x86_64) # Ensure that 32bit libraries are found first if we cross-compile:
@@ -602,11 +607,15 @@ case "$ARCH" in
SLKCFLAGS="-O2"
SLKLDFLAGS="-L/usr/lib"; LIBDIRSUFFIX=""
FFMPEG_ARCH="ia32"
+ SYSROOT_ARCH="i386"
+ SYSROOT_TARGET="i386"
PKGARCH="i586"
else
SLKCFLAGS="-O2 -fPIC"
SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64"
FFMPEG_ARCH="x64"
+ SYSROOT_ARCH="amd64"
+ SYSROOT_TARGET="x86_64"
PKGARCH="$ARCH"
fi
#DSSE="0"
@@ -618,6 +627,8 @@ case "$ARCH" in
# Widevine not supported (no binary library available):
USE_CDM=0
FFMPEG_ARCH="arm"
+ SYSROOT_ARCH="arm"
+ SYSROOT_TARGET="arm"
PKGARCH="$ARCH"
;;
armv6hl) SLKCFLAGS="-O2 -march=armv6 -mfpu=vfp -mfloat-abi=hard"
@@ -626,6 +637,8 @@ case "$ARCH" in
# Widevine not supported (no binary library available):
USE_CDM=0
FFMPEG_ARCH="arm"
+ SYSROOT_ARCH="arm"
+ SYSROOT_TARGET="arm"
PKGARCH="$ARCH"
;;
*) SLKCFLAGS=${SLKCFLAGS:-"O2"}
@@ -634,6 +647,8 @@ case "$ARCH" in
# Widevine not supported by default:
USE_CDM=0
FFMPEG_ARCH="$ARCH"
+ SYSROOT_ARCH="$ARCH"
+ SYSROOT_TARGET="$ARCH"
PKGARCH="$ARCH"
;;
esac
@@ -819,6 +834,7 @@ echo Building ...
[ ${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
+[ ${USE_SYSROOT} -eq 1 ] && do_sysroot=true || do_sysroot=false
[ ${FFMPEG_HEVC} -eq 1 ] && do_hevc=true || do_hevc=false
export LDFLAGS="$SLKLDFLAGS"
@@ -875,7 +891,7 @@ _chromium_conf=(
'use_kerberos=false'
'use_lld=true'
"use_pulseaudio=${do_pa}"
- 'use_sysroot=false'
+ "use_sysroot=${do_sysroot}"
"extra_cxxflags=\"${CXXFLAGS}\""
"extra_ldflags=\"${LDFLAGS}\""
)
@@ -968,6 +984,27 @@ if [ ${USE_NACL} -eq 1 ]; then
2>&1 | tee $OUTPUT/nacl_dl-${PRGNAM}.log
fi
+if [ ${USE_SYSROOT} -eq 1 ]; then
+ # Download a sysroot image:
+ python2 build/linux/sysroot_scripts/install-sysroot.py --arch=${SYSROOT_ARCH}
+
+ # Take care of Debian/Ubuntu related missing header issues:
+ SYSROOTDIR=$(basename $(ls build/linux/ |grep ${SYSROOT_ARCH}-sysroot))
+
+ ln -s ../../lib/${SYSROOT_TARGET}-linux-gnu/glib-2.0/include/glibconfig.h \
+ build/linux/${SYSROOTDIR}/usr/include/glib-2.0/glibconfig.h
+ ln -s ../../../lib/${SYSROOT_TARGET}-linux-gnu/dbus-1.0/include/dbus/dbus-arch-deps.h \
+ build/linux/${SYSROOTDIR}/usr/include/dbus-1.0/dbus/dbus-arch-deps.h
+ ln -s ../../lib/${SYSROOT_TARGET}-linux-gnu/graphene-1.0/include/graphene-config.h \
+ build/linux/${SYSROOTDIR}/usr/include/graphene-1.0/graphene-config.h
+
+ # Take care of Debian/Ubuntu related linker issues:
+ echo "/usr/lib/${SYSROOT_TARGET}-linux-gnu/nss" >> \
+ build/linux/${SYSROOTDIR}/etc/ld.so.conf.d/${SYSROOT_TARGET}-linux-gnu.conf
+ ln -s libsqlite3.so.0 \
+ build/linux/${SYSROOTDIR}/usr/lib/${SYSROOT_TARGET}-linux-gnu/libsqlite3.so
+fi
+
# --- Compile --- #
# Final link uses lots of file descriptors.