diff options
Diffstat (limited to 'office/LibreOffice/LibreOffice.SlackBuild')
-rw-r--r-- | office/LibreOffice/LibreOffice.SlackBuild | 130 |
1 files changed, 80 insertions, 50 deletions
diff --git a/office/LibreOffice/LibreOffice.SlackBuild b/office/LibreOffice/LibreOffice.SlackBuild index 92193f6e70..b3b349606f 100644 --- a/office/LibreOffice/LibreOffice.SlackBuild +++ b/office/LibreOffice/LibreOffice.SlackBuild @@ -4,7 +4,7 @@ # Slackware build script for LibreOffice -# Copyright 2015-2021 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 @@ -28,13 +28,15 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=LibreOffice SRCNAM=libreoffice -VERSION=${VERSION:-7.1.5.2} +VERSION=${VERSION:-24.2.2.2} SHORT_VERSION=${VERSION%.*.*} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} HAVE_SRCS_TARBALL=${HAVE_SRCS_TARBALL:-1} +unset UNO_PATH +unset URE_BOOTSTRAP if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -44,9 +46,6 @@ 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 echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -70,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 @@ -79,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 . @@ -100,24 +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:-jdk11} -if [ "$JAVA" = "jdk11" ]; then - . /etc/profile.d/jdk11.sh - use_java="--with-jdk-home=$JAVA_HOME" -elif [ "$JAVA" = "jdk12" ]; then - . /etc/profile.d/jdk12.sh - use_java="--with-jdk-home=$JAVA_HOME" -elif [ "$JAVA" = "jdk13" ]; then - . /etc/profile.d/jdk13.sh - use_java="--with-jdk-home=$JAVA_HOME" -elif [ "$JAVA" = "jdk14" ]; then - . /etc/profile.d/jdk14.sh - use_java="--with-jdk-home=$JAVA_HOME" -elif [ "$JAVA" = "jdk15" ]; then - . /etc/profile.d/jdk15.sh - use_java="--with-jdk-home=$JAVA_HOME" -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 @@ -151,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 @@ -158,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. @@ -165,8 +191,6 @@ 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 use_ccache="--disable-ccache" ; [ "${USE_CCACHE:-no}" != "no" ] && use_ccache="" @@ -179,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 \ @@ -192,6 +227,8 @@ extnlpsolver="--enable-ext-nlpsolver"; [ "${EXTNLPSOLVER:-yes}" != "yes" ] & --with-vendor="Just Another Slacker" \ --with-lang="$LOLANGS" \ --enable-release-build=yes \ + --enable-qt5 \ + --enable-python=system \ --enable-gio \ $extct2n \ $extnumbertext \ @@ -199,7 +236,6 @@ extnlpsolver="--enable-ext-nlpsolver"; [ "${EXTNLPSOLVER:-yes}" != "yes" ] & $extlanguagetool \ $extwikipub \ $avahi \ - $Python3 \ $vlc \ $use_ccache \ $use_java \ @@ -209,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 \ @@ -221,29 +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-sane \ --with-system-zlib \ + $boost \ $coinmp \ $cppunit \ $glm \ $libabw \ $libcdr \ + $liblangtag \ $libcmis \ $libebook \ $libeot \ @@ -265,7 +301,6 @@ extnlpsolver="--enable-ext-nlpsolver"; [ "${EXTNLPSOLVER:-yes}" != "yes" ] & $lpsolve \ $mythes \ $postgresql \ - $qt5 \ $valgrind \ $ucpp \ $odbc \ @@ -285,24 +320,16 @@ fi patch -p0 < $CWD/no-check-if-root.diff # GCC10 requirements (Tx alienBOB) -sed -i external/libcdr/ExternalProject_libcdr.mk \ - -e '/configure /i \\t\t&& sed -i "s/TRUE/true/g" src/lib/libcdr_utils.cpp \\' sed -i external/libebook/ExternalProject_libebook.mk \ -e '/configure /i \\t\t&& sed -i "s/TRUE/true/g" src/lib/EBOOKCharsetConverter.cpp \\' -sed -i i18npool/source/calendar/calendar_gregorian.cxx -e 's/TRUE/true/' -export LDFLAGS="-lboost_system" -make build-nocheck + +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 @@ -312,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 |