summaryrefslogtreecommitdiffstats
path: root/office/LibreOffice/LibreOffice.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'office/LibreOffice/LibreOffice.SlackBuild')
-rw-r--r--office/LibreOffice/LibreOffice.SlackBuild140
1 files changed, 94 insertions, 46 deletions
diff --git a/office/LibreOffice/LibreOffice.SlackBuild b/office/LibreOffice/LibreOffice.SlackBuild
index 14fd0f2042..b3b349606f 100644
--- a/office/LibreOffice/LibreOffice.SlackBuild
+++ b/office/LibreOffice/LibreOffice.SlackBuild
@@ -1,10 +1,10 @@
-#!/bin/sh
+#!/bin/bash
#
# ex:set ai shiftwidth=4 inputtab=spaces smarttab noautotab:
# Slackware build script for LibreOffice
-# Copyright 2015-2019 Christoph Willing Brisbane, Australia
+# Copyright 2015-2024 Christoph Willing Sydney, Australia
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -24,15 +24,19 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=LibreOffice
SRCNAM=libreoffice
-VERSION=${VERSION:-6.2.8.2}
+VERSION=${VERSION:-24.2.2.2}
SHORT_VERSION=${VERSION%.*.*}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
-PACKAGER=${PACKAGER:-"AnonymousCoward"}
+PKGTYPE=${PKGTYPE:-tgz}
HAVE_SRCS_TARBALL=${HAVE_SRCS_TARBALL:-1}
+unset UNO_PATH
+unset URE_BOOTSTRAP
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -42,7 +46,11 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
@@ -61,6 +69,18 @@ else
LIBDIRSUFFIX=""
fi
+if [ -x /usr/bin/gcc-11.* ];
+then
+ echo Slackware-15.0
+ export CC=/usr/bin/clang
+ export CXX=/usr/bin/clang++
+ CXXCLANGFLAGS="-Wno-c++11-narrowing"
+else
+ echo Slackware-15.0++
+ export CC=/usr/bin/gcc
+ export CXX=/usr/bin/g++
+fi
+
set -e
rm -rf $PKG
@@ -70,8 +90,15 @@ rm -rf $SRCNAM-$VERSION
tar xvf $CWD/$SRCNAM-$VERSION.tar.xz
cd $SRCNAM-$VERSION
-if [ "$HAVE_SRCS_TARBALL" = "1" ]; then
+if [ -r $CWD/$SRCNAM-${VERSION}-srcs.tar.xz ]; then
tar xvf $CWD/$SRCNAM-${VERSION}-srcs.tar.xz
+ # For 7.2.0.4 these aren't found as previously so unpack them manually
+ cd $TMP
+ tar xf libreoffice-${VERSION}/external/tarballs/libreoffice-translations-${VERSION}.tar.xz
+ tar xf libreoffice-${VERSION}/external/tarballs/libreoffice-help-${VERSION}.tar.xz
+ cd $SRCNAM-$VERSION
+else
+ HAVE_SRCS_TARBALL=0
fi
chown -R root:root .
@@ -91,18 +118,30 @@ jval="$(echo $MAKEFLAGS |grep -o "\-j *[0-9]*" | grep -o "[0-9]*")" || true
# If PARALLEL environment variable is set, use that to override everything.
[ "${PARALLEL:-0}" != "0" ] && parallel="--with-parallelism=$PARALLEL"
-JAVA=${JAVA:-openjdk7}
-if [ "$JAVA" = "openjdk7" ]; then
- . /etc/profile.d/openjdk7.sh
- use_java="--with-java=java"
-elif [ "$JAVA" = "openjdk8" ]; then
- . /etc/profile.d/openjdk8.sh
- use_java="--with-java=java"
-elif [ "$JAVA" = "jdk" ]; then
- . /etc/profile.d/jdk.sh
- use_java="--with-java=java"
-elif [ "$JAVA" = "no" ]; then
+JAVA=${JAVA:-}
+if [ "$JAVA" = "no" ]; then
use_java="--with-java=no"
+else
+ if [ -z "$JAVA_HOME" ]; then
+ # if JAVA_HOME isn't set, try to set it by sourcing the profile script
+ for i in /etc/profile.d/*jdk*.sh; do
+ if [ -x $i ]; then
+ source $i
+ break
+ fi
+ done
+ fi
+
+ if [ -z "$JAVA_HOME" ]; then
+ cat <<EOF
+!!! Java support requested, but JAVA_HOME is unset and I can't find
+!!! a /etc/profile.d script that sets it. Are you sure you have a JDK
+!!! package installed?
+EOF
+ exit 1
+ fi
+
+ use_java="--with-jdk-home=$JAVA_HOME"
fi
# General optional use of packages available from SBo. If not found, LibreOffice internal versions are used
@@ -136,6 +175,7 @@ if pkg-config --exists mdds-1.4 ; then mdds="--with-system-mdds" ; else mdds=""
if pkg-config --exists mythes ; then mythes="--with-system-mythes" ; else mythes="" ; fi
if test -x /usr/bin/odbc_config ; then odbc="--with-system-odbc" ; else odbc="" ; fi
#if test -d /usr/lib${LIBDIRSUFFIX}/python3*/site-packages/lxml ; then lxml="--with-system-lxml" ; else lxml="" ; fi
+
if pkg-config --exists xmlsec1 ; then
xmlsec="--with-system-xmlsec"
else
@@ -143,6 +183,7 @@ else
# Also ensure correct nspr implementation is used if building libreoffice supplied xmlsec
sed -i -e 's:openssl:openssl --with-mozilla-ver=/usr:' external/xmlsec/ExternalProject_xmlsec.mk
fi
+
#if test -e /usr/share/ant/lib/rhino.jar ; then rhino="--with-system-rhino --with-rhino-jar=/usr/share/ant/lib/rhino.jar" ; else rhino="" ; fi
if pkg-config --exists libvlc ; then vlc="--enable-vlc" ; else vlc="" ; fi
# Building with vlc backend is marked as experimental so demand explicit indication via environment variable VLC to do it.
@@ -150,11 +191,8 @@ if pkg-config --exists libvlc ; then vlc="--enable-vlc" ; else vlc="" ; fi
# Other options
if pkg-config --exists avahi-core ; then avahi="--enable-avahi" ; else avahi="" ; fi
-if pkg-config --exists python3 ; then Python3="--enable-python=system" ; else Python3="" ; fi
-if pkg-config --exists Qt5 ; then qt5="--enable-qt5" ; else qt5="" ; fi
if pkg-config --exists valgrind ; then valgrind="--with-valgrind" ; else valgrind="" ; fi
-kde4="--enable-kde4" ; [ "${KDE4:-yes}" != "yes" ] && kde4="--disable-kde4"
use_ccache="--disable-ccache" ; [ "${USE_CCACHE:-no}" != "no" ] && use_ccache=""
# Extensions
@@ -165,9 +203,20 @@ extwikipub="--enable-ext-wiki-publisher"; [ "${EXTWIKIPUB:-no}" != "yes" ] &
extnlpsolver="--enable-ext-nlpsolver"; [ "${EXTNLPSOLVER:-yes}" != "yes" ] && extnlpsolver=""
-./autogen.sh \
+# Temporary fix for problems with boost > 1.80
+# Results in additional download of compatible boost to use internally
+BOOST_MINOR_VERSION=$(basename $(ls -d /usr/lib${LIBDIRSUFFIX}/cmake/Boost-1.*) | cut -d'.' -f2)
+if [ "$BOOST_MINOR_VERSION" -gt "80" ]; then
+ boost="--without-system-boost"
+else
+ boost="--with-system-boost"
+fi
+
+
+./configure \
CFLAGS="$SLKCFLAGS" \
- CXXFLAGS="$SLKCFLAGS" \
+ CXXFLAGS="$SLKCFLAGS $CXXCLANGFLAGS" \
+ LDFLAGS="-lz" \
NSS_CFLAGS="$(pkg-config --cflags-only-I mozilla-nss)"\
--prefix=/usr \
--mandir=/usr/man \
@@ -175,10 +224,11 @@ extnlpsolver="--enable-ext-nlpsolver"; [ "${EXTNLPSOLVER:-yes}" != "yes" ] &
--libdir=/usr/lib$LIBDIRSUFFIX \
--sysconfdir=/etc \
--build=$ARCH-slackware-linux \
- --with-build-version="SlackBuild for $PRGNAM-$VERSION by $PACKAGER" \
--with-vendor="Just Another Slacker" \
--with-lang="$LOLANGS" \
--enable-release-build=yes \
+ --enable-qt5 \
+ --enable-python=system \
--enable-gio \
$extct2n \
$extnumbertext \
@@ -186,9 +236,7 @@ extnlpsolver="--enable-ext-nlpsolver"; [ "${EXTNLPSOLVER:-yes}" != "yes" ] &
$extlanguagetool \
$extwikipub \
$avahi \
- $Python3 \
$vlc \
- $kde4 \
$use_ccache \
$use_java \
$parallel \
@@ -197,10 +245,9 @@ extnlpsolver="--enable-ext-nlpsolver"; [ "${EXTNLPSOLVER:-yes}" != "yes" ] &
--without-krb5 \
--without-gssapi \
--without-junit \
+ --without-system-libxml \
--with-help \
- --with-system-apr \
--with-system-bluez \
- --with-system-boost \
--with-system-bzip2 \
--with-system-cairo \
--with-system-clucene \
@@ -209,30 +256,30 @@ extnlpsolver="--enable-ext-nlpsolver"; [ "${EXTNLPSOLVER:-yes}" != "yes" ] &
--with-system-epoxy \
--with-system-expat \
--with-system-hunspell \
- --with-system-icu \
--with-system-jpeg \
--with-system-lcms2 \
--with-system-libodfgen \
--with-system-libpng \
--with-system-librevenge \
+ --with-system-libtiff \
--with-system-libvisio \
+ --with-system-libwebp \
--with-system-libwpd \
--with-system-libwpg \
- --with-system-libxml \
--with-system-mariadb \
- --with-system-neon \
--with-system-nss \
--with-system-openldap \
--with-system-openssl \
--with-system-poppler \
- --with-system-redland \
--with-system-sane \
--with-system-zlib \
+ $boost \
$coinmp \
$cppunit \
$glm \
$libabw \
$libcdr \
+ $liblangtag \
$libcmis \
$libebook \
$libeot \
@@ -254,7 +301,6 @@ extnlpsolver="--enable-ext-nlpsolver"; [ "${EXTNLPSOLVER:-yes}" != "yes" ] &
$lpsolve \
$mythes \
$postgresql \
- $qt5 \
$valgrind \
$ucpp \
$odbc \
@@ -273,18 +319,17 @@ fi
patch -p0 < $CWD/no-check-if-root.diff
-export LDFLAGS="-lboost_system"
-make build-nocheck
+# GCC10 requirements (Tx alienBOB)
+sed -i external/libebook/ExternalProject_libebook.mk \
+ -e '/configure /i \\t\t&& sed -i "s/TRUE/true/g" src/lib/EBOOKCharsetConverter.cpp \\'
+
+
+make build
make distro-pack-install DESTDIR=$PKG
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
-# Prefer GTK2 toolkit
-cd $PKG/usr/lib$LIBDIRSUFFIX/$SRCNAM/program
-sed -i -e '/^#\ restore/i# Prefer GTK2\nexport SAL_USE_VCLPLUGIN=${SAL_USE_VCLPLUGIN:-gtk}\n' soffice
-cd -
-
cd $PKG/usr/lib$LIBDIRSUFFIX
mv $SRCNAM $SRCNAM-$VERSION
ln -s $SRCNAM-$VERSION $SRCNAM
@@ -294,14 +339,17 @@ for df in $PKG/usr/lib$LIBDIRSUFFIX/$SRCNAM-$VERSION/share/xdg/*.desktop ; do
sed -i -e "s/libreofficedev$SHORT_VERSION/libreoffice/g" $df
done
-# Use the system python if we have it, else use the python just built with LibreOffice
-PYTHONEXE=$(which python3) || PYTHONEXE=$PKG/usr/lib$LIBDIRSUFFIX/$SRCNAM/program/python
-PYSITEDIR=$($PYTHONEXE -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
-mkdir -p $PKG/$PYSITEDIR
-cat <<EOF >$PKG/$PYSITEDIR/pyuno.pth
+# Only enable pyuno if requested
+if [ "${PYUNO:-no}" == "yes" ]; then
+ # Use the system python if we have it, else use the python just built with LibreOffice
+ PYTHONEXE=$(which python3) || PYTHONEXE=$PKG/usr/lib$LIBDIRSUFFIX/$SRCNAM/program/python
+ PYSITEDIR=$($PYTHONEXE -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
+ mkdir -p $PKG/$PYSITEDIR
+ cat <<EOF >$PKG/$PYSITEDIR/pyuno.pth
import sys; sys.path.insert(0,'/usr/lib$LIBDIRSUFFIX/libreoffice/program')
EOF
-chmod 0644 $PKG/$PYSITEDIR/pyuno.pth
+ chmod 0644 $PKG/$PYSITEDIR/pyuno.pth
+fi
mkdir -p $PKG/etc/profile.d
sd_prog=/usr/lib$LIBDIRSUFFIX/libreoffice/program
@@ -326,4 +374,4 @@ cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE