summaryrefslogtreecommitdiff
path: root/source/xap/mozilla-thunderbird/mozilla-thunderbird.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/xap/mozilla-thunderbird/mozilla-thunderbird.SlackBuild')
-rwxr-xr-xsource/xap/mozilla-thunderbird/mozilla-thunderbird.SlackBuild110
1 files changed, 83 insertions, 27 deletions
diff --git a/source/xap/mozilla-thunderbird/mozilla-thunderbird.SlackBuild b/source/xap/mozilla-thunderbird/mozilla-thunderbird.SlackBuild
index d26fefed..49474421 100755
--- a/source/xap/mozilla-thunderbird/mozilla-thunderbird.SlackBuild
+++ b/source/xap/mozilla-thunderbird/mozilla-thunderbird.SlackBuild
@@ -1,6 +1,6 @@
-#!/bin/sh
+#!/bin/bash
-# Copyright 2008, 2009, 2010, 2011, 2012, 2014, 2016 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2008, 2009, 2010, 2011, 2012, 2014, 2016, 2017, 2018 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -25,6 +25,9 @@
# Thanks to the folks at the Mozilla Foundation for permission to
# distribute this, and for all the great work! :-)
+cd $(dirname $0) ; CWD=$(pwd)
+
+PKGNAM=mozilla-thunderbird
VERSION=$(basename $(ls thunderbird-*.tar.?z* | cut -d - -f 2 | rev | cut -f 3- -d . | rev) .source)
RELEASEVER=$(echo $VERSION | cut -f 1 -d e | cut -f 1 -d b)
BUILD=${BUILD:-1}
@@ -37,6 +40,14 @@ BUILD=${BUILD:-1}
#
MOZLOCALIZE=${MOZLOCALIZE:-}
+# This can be set to YES or NO:
+ENABLE_CALENDAR=${ENABLE_CALENDAR:-YES}
+if [ "$ENABLE_CALENDAR" = "NO" ]; then
+ ENABLE_CALENDAR="--disable-calendar"
+else
+ ENABLE_CALENDAR="--enable-calendar"
+fi
+
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -48,30 +59,69 @@ if [ -z "$ARCH" ]; then
esac
fi
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ if [ -z $MOZLOCALIZE ]; then
+ echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+ else
+ echo "$PKGNAM-$VERSION-$ARCH-${BUILD}_$MOZLOCALIZE.txz"
+ fi
+ exit 0
+fi
+
if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS=""
+ LIBDIRSUFFIX=""
+ OPTIMIZE=${OPTIMIZE:-"-O1"}
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS=""
LIBDIRSUFFIX=""
- OPTIMIZE=" --enable-optimize=-O2 "
- # On IA32, use gold since GNU ld runs out of memory linking libxul.so:
- PATH="$(pwd)/gold:$PATH"
- export CC="gcc -B$(pwd)/gold"
- export CXX="g++ -B$(pwd)/gold"
+ OPTIMIZE=${OPTIMIZE:-"-O1"}
elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-fPIC"
LIBDIRSUFFIX="64"
- OPTIMIZE=" --enable-optimize=-O2 "
+ OPTIMIZE=${OPTIMIZE:-"-O1"}
+elif [ "$ARCH" = "arm" ]; then
+ SLKCFLAGS="-march=armv4 -mtune=xscale"
+ LIBDIRSUFFIX=""
+ OPTIMIZE=${OPTIMIZE:-"-O1"}
else
+ SLKCFLAGS=""
LIBDIRSUFFIX=""
- OPTIMIZE=" --enable-optimize=-O2 "
+ OPTIMIZE=${OPTIMIZE:-"-O1"}
fi
-CWD=$(pwd)
+# Link using gold. This avoids running out of memory on 32-bit systems, and
+# avoids a recurring build failure with GNU ld on other systems.
+PATH="$(pwd)/gold:$PATH"
+export CC=${CC:-"gcc -B$(pwd)/gold"}
+export CXX=${CXX:-"g++ -B$(pwd)/gold"}
+
TMP=${TMP:-/tmp}
PKG=$TMP/package-mozilla-thunderbird
+# If there is a private Google API key available at compile time, use
+# it to enable support for Google Safe Browsing. For Slackware builds,
+# we use a private key issued for the Slackware project. If you are
+# rebuilding and need this support, or you are producing your own
+# distribution, you may obtain your own Google API key at no charge by
+# following these instructions:
+# https://bugzilla.mozilla.org/show_bug.cgi?id=1377987#c0
+if [ -r /root/google-api-key ]; then
+ GOOGLE_API_KEY="--with-google-api-keyfile=/root/google-api-key"
+fi
+
NUMJOBS=${NUMJOBS:-" -j7 "}
rm -rf $PKG
mkdir -p $TMP $PKG/usr/lib${LIBDIRSUFFIX}
+# We need to use the incredibly ancient autoconf-2.13 for this :/
+( cd $CWD/autoconf ; ./autoconf.build )
+PATH=$TMP/autoconf-tmp/usr/bin:$PATH
+
cd $TMP
rm -rf thunderbird-$VERSION
# Unpack this in a subdirectory to prevent changing permissions on /tmp:
@@ -84,6 +134,9 @@ cd ..
rm -rf thunderbird-unpack
cd thunderbird-$VERSION || exit 1
+# Retain GTK+ v2 scrolling behavior:
+zcat $CWD/tb.ui.scrollToClick.diff.gz | patch -p1 --verbose || exit 1
+
# Fetch localization, if requested:
if [ ! -z $MOZLOCALIZE ]; then
LOC_TAG="THUNDERBIRD_$( echo $VERSION | tr \. _ )_RELEASE"
@@ -115,30 +168,23 @@ OPTIONS="\
--enable-official-branding \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
- --with-default-mozilla-five-home=/usr/lib${LIBDIRSUFFIX}/thunderbird-$VERSION \
+ --with-default-mozilla-five-home=/usr/lib${LIBDIRSUFFIX}/thunderbird-$RELEASEVER \
--with-system-zlib \
+ --enable-alsa \
--enable-application=mail \
- --enable-calendar \
- --enable-default-toolkit=cairo-gtk2 \
+ $ENABLE_CALENDAR \
+ --enable-default-toolkit=cairo-gtk3 \
--enable-startup-notification \
- --enable-crypto \
--enable-ldap \
- --enable-libxul \
- --enable-svg \
- --enable-canvas \
- --enable-xft \
- $OPTIMIZE \
- --enable-reorder \
--enable-strip \
--enable-cpp-rtti \
- --disable-accessibility \
+ --enable-accessibility \
+ $GOOGLE_API_KEY \
--disable-crashreporter \
--disable-debug \
--disable-tests \
- --disable-pedantic \
--host=$ARCH-slackware-linux \
- --target=$ARCH-slackware-linux \
- --build=$ARCH-slackware-linux"
+ --target=$ARCH-slackware-linux"
# Complains about missing APNG support in Slackware's libpng:
#--with-system-png \
# Broken with 12.0:
@@ -157,6 +203,8 @@ fi
export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1
export MOZ_PHOENIX=1
+export CFLAGS="$SLKCFLAGS"
+export CXXFLAGS="$SLKCFLAGS"
export MOZ_MAKE_FLAGS="$NUMJOBS"
# Clear some variables that could break the build
@@ -166,6 +214,10 @@ unset DBUS_SESSION_BUS_ADDRESS ORBIT_SOCKETDIR SESSION_MANAGER \
# Assemble our .mozconfig:
echo > .mozconfig
+# Tell .mozconfig about the selected compiler:
+echo "export CC=\"${CC}\"" >> .mozconfig
+echo "export CXX=\"${CXX}\"" >> .mozconfig
+
# Mozilla devs enforce using an objdir for building
# https://developer.mozilla.org/en/Configuring_Build_Options#Building_with_an_objdir
mkdir obj
@@ -173,7 +225,10 @@ echo "mk_add_options MOZ_OBJDIR=$(pwd)/obj" >> .mozconfig
# This directory is also needed or the build will fail:
mkdir -p mozilla/obj
-# Write in it the options above
+# Set options for $OPTIMIZE:
+echo "ac_add_options --enable-optimize=\"${OPTIMIZE}\"" >> .mozconfig
+
+# Add the $OPTIONS above to .mozconfig:
for option in $OPTIONS; do echo "ac_add_options $option" >> .mozconfig; done
make -f client.mk build || exit 1
@@ -196,7 +251,8 @@ mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/mozilla/plugins
mkdir -p $PKG/usr/share/applications
cat $CWD/mozilla-thunderbird.desktop > $PKG/usr/share/applications/mozilla-thunderbird.desktop
mkdir -p $PKG/usr/share/pixmaps
-cat $CWD/thunderbird.png > $PKG/usr/share/pixmaps/thunderbird.png
+# Symlinked below.
+#cat $CWD/thunderbird.png > $PKG/usr/share/pixmaps/thunderbird.png
# These files/directories are usually created if Thunderbird is run as root,
# which on many systems might (and possibly should) be never. Therefore, if we
@@ -218,7 +274,7 @@ for i in 16 22 24 32 48 256; do
$PKG/usr/share/icons/hicolor/${i}x${i}/apps/thunderbird.png
done
mkdir -p $PKG/usr/share/pixmaps
-( cd $PKG/usr/share/pixmaps ; ln -sf /usr/share/icons/hicolor/256x256/apps/thunderbird . )
+( cd $PKG/usr/share/pixmaps ; ln -sf /usr/share/icons/hicolor/256x256/apps/thunderbird.png . )
mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/thunderbird-$RELEASEVER/chrome/icons/default
install -m 644 other-licenses/branding/thunderbird/mailicon16.png \
$PKG/usr/lib$LIBDIRSUFFIX/thunderbird-$RELEASEVER/icons/