Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#54250 - [libreoffice-fresh] Loading the python uno module fails

Attached to Project: Arch Linux
Opened by Tomas Groth (tgc) - Thursday, 01 June 2017, 06:56 GMT
Last edited by Andreas Radke (AndyRTR) - Tuesday, 06 June 2017, 19:01 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Andreas Radke (AndyRTR)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
LibreOffice comes with a python uno module, but loading it fails in libreoffice-fresh. It works in libreoffice-still.
The reason seems to be that the libreoffice-fresh PKGBUILD does not apply a patch that the libreoffice-still PKGBUILD does. The patch in question is make-pyuno-work-with-system-wide-module-install.diff

Additional info:
* package version(s): libreoffice-fresh 5.3.3-1


Steps to reproduce:
$ python3
>>> import uno
This task depends upon

Closed by  Andreas Radke (AndyRTR)
Tuesday, 06 June 2017, 19:01 GMT
Reason for closing:  Fixed
Additional comments about closing:  5.3.3-2
Comment by Andreas Radke (AndyRTR) - Monday, 05 June 2017, 11:38 GMT
pyuno module had some changes in 5.3 branch:
https://cgit.freedesktop.org/libreoffice/core/commit/pyuno/source/module/uno.py?h=libreoffice-5-3&id=deb989dd6d1f86e74864131be50ed92d8d43768c

Modifying sys.path.append and os.putenv pointing to our install location seems to be required though. Fedora does something similar in their spec file:

# move python bits into site-packages
install -m 0755 -d %{buildroot}%{libo_python_sitearch}
pushd %{buildroot}%{libo_python_sitearch}
echo "import sys, os" > uno.py
echo "sys.path.append('%{baseinstdir}/program')" >> uno.py
echo "os.putenv('URE_BOOTSTRAP', 'vnd.sun.star.pathname:%{baseinstdir}/program/fundamentalrc')" >> uno.py
cat %{buildroot}%{baseinstdir}/program/uno.py >> uno.py
rm -f %{buildroot}%{baseinstdir}/program/uno.py*
mv -f %{buildroot}%{baseinstdir}/program/unohelper.py* .
mv -f %{buildroot}%{baseinstdir}/program/officehelper.py* .
popd

Debian removed the make-pyuno-work-with-system-wide-module-install.diff patch with their 5.3.x. update as well. No idea where they do necessary modifications now.

Please test modifying uno.py directly in your installation to make it load again.
Comment by Tomas Groth (tgc) - Tuesday, 06 June 2017, 07:40 GMT
I made the changes shown in the attached patch, based on the fedora example, and it works.

Loading...