diff options
author | Christoph Willing <chris.willing@linux.com> | 2022-06-03 08:53:20 +1000 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2022-06-04 10:37:05 +0700 |
commit | 5a9fd1a9e0e35fd2f72a39bf6cb9dc5a40508813 (patch) | |
tree | 35822101a39c20456bbf83a9848c86811f96ac19 /office/LibreOffice | |
parent | 1a15b65355dac33e3661bdb808c45d8029623bf8 (diff) |
office/LibreOffice: Make PyUNO build time optional
Signed-off-by: Christoph Willing <chris.willing@linux.com>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'office/LibreOffice')
-rw-r--r-- | office/LibreOffice/LibreOffice.SlackBuild | 22 | ||||
-rw-r--r-- | office/LibreOffice/README | 22 |
2 files changed, 26 insertions, 18 deletions
diff --git a/office/LibreOffice/LibreOffice.SlackBuild b/office/LibreOffice/LibreOffice.SlackBuild index 4161ba47beaa0..a33b8a57c0491 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 <<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 diff --git a/office/LibreOffice/README b/office/LibreOffice/README index bd978ab7b2ae3..2c7b43b3145ef 100644 --- a/office/LibreOffice/README +++ b/office/LibreOffice/README @@ -49,8 +49,8 @@ as follows: the JAVA_HOME environment variable is set appropriately in a file in /etc/profile.d/, where this SlackBuild will search. - It is also possible to build LibreOffice without any Java support, - with somewhat reduced capability in LO Base) by running: + It is also possible to build LibreOffice without any Java support + (with somewhat reduced capability in LO Base) by running: JAVA=no sh LibreOffice.SlackBuild 3. The number of parallel make jobs used by the LibreOffice build @@ -69,9 +69,17 @@ as follows: be reinstated by setting the USE_CCACHE environment to "yes" e.g. USE_CCACHE=yes sh LibreOffice.SlackBuild -For performance reasons, this Slackbuild sets GTK2 to be used at -runtime. Alternatives (gen, gtk3, kde4) may still be used by setting -SAL_USE_VCLPLUGIN in the user's runtime environment. +5. PyUNO is a Python interface to the LibreOffice API. It is disabled by + default due to interference with Openshot (therefore possibly other + packages). It may be enabled by setting the PYUNO environment + variable e.g. + PYUNO=yes sh LibreOffice.SlackBuild + + Even without PyUNO enabled in this way, PyUNO scripts may still be + executed by suitably extending the PYTHONPATH in the environment at + runtime e.g. + PYTHONPATH=/usr/lib64/libreoffice/program my_python_uno_script.py + Spell checking of documents at runtime requires installation of a suitable wordlist for the language concerned. This can be achieved in @@ -85,7 +93,7 @@ browser with which to locate and open the downloaded .oxt file. The new dictionary will now appear in the Extension Manager. Some people have experienced difficulties building LibreOffice while a -previoius version is still installed. It is therefore recommended that +previous version is still installed. It is therefore recommended that any previous version should be removed before building LibreOffice. As well as removing any LibreOffice installation, it is important to also clear environment variables that were set by the installation i.e. @@ -93,3 +101,5 @@ clear environment variables that were set by the installation i.e. unset UNO_PATH unset URE_BOOTSTRAP +Good luck! + |