From 5a9fd1a9e0e35fd2f72a39bf6cb9dc5a40508813 Mon Sep 17 00:00:00 2001 From: Christoph Willing Date: Fri, 3 Jun 2022 08:53:20 +1000 Subject: office/LibreOffice: Make PyUNO build time optional Signed-off-by: Christoph Willing Signed-off-by: Willy Sudiarto Raharjo --- office/LibreOffice/LibreOffice.SlackBuild | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'office/LibreOffice/LibreOffice.SlackBuild') diff --git a/office/LibreOffice/LibreOffice.SlackBuild b/office/LibreOffice/LibreOffice.SlackBuild index 4161ba47be..a33b8a57c0 100644 --- a/office/LibreOffice/LibreOffice.SlackBuild +++ b/office/LibreOffice/LibreOffice.SlackBuild @@ -30,7 +30,7 @@ PRGNAM=LibreOffice SRCNAM=libreoffice VERSION=${VERSION:-7.3.3.2} SHORT_VERSION=${VERSION%.*.*} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -308,11 +308,6 @@ 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 @@ -322,14 +317,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 <$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 <$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 -- cgit v1.2.3