summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2020-08-19 01:04:50 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2020-08-19 01:07:40 +0200
commit7e9dc414f75767acbd0e297979c6cfec53f6ddef (patch)
treea9b293834624c2d79c9f30fc2c0eb11c8aa642cf /app-office
parentapp-office/libreoffice-l10n: 6.4.6.2 version bump (diff)
downloadgentoo-7e9dc414f75767acbd0e297979c6cfec53f6ddef.tar.gz
gentoo-7e9dc414f75767acbd0e297979c6cfec53f6ddef.tar.bz2
gentoo-7e9dc414f75767acbd0e297979c6cfec53f6ddef.zip
app-office/libreoffice: Link python bridge in site-packages, drop patch
Essentially syncing with openSUSE changes. - Obsolete patching of officehelper.py, uno.py not to break tests, use heredoc - Fix finding pyuno by reshuffling imports - Obsolete patching of soffice.sh by symlinking py files to site-packages - Symlink byte-compiled files too Reported-by: gerion <gerion.entrup@flump.de> Bug: https://bugs.gentoo.org/667802 Package-Manager: Portage-3.0.3, Repoman-3.0.0 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'app-office')
-rw-r--r--app-office/libreoffice/libreoffice-6.4.6.2.ebuild34
1 files changed, 27 insertions, 7 deletions
diff --git a/app-office/libreoffice/libreoffice-6.4.6.2.ebuild b/app-office/libreoffice/libreoffice-6.4.6.2.ebuild
index 6f4a72b4e475..291eb07b6f02 100644
--- a/app-office/libreoffice/libreoffice-6.4.6.2.ebuild
+++ b/app-office/libreoffice/libreoffice-6.4.6.2.ebuild
@@ -265,7 +265,6 @@ PATCHES=(
# "${WORKDIR}"/${PATCHSET/.tar.xz/}
# not upstreamable stuff
- "${FILESDIR}/${PN}-5.4-system-pyuno.patch"
"${FILESDIR}/${PN}-5.3.4.2-kioclient5.patch"
"${FILESDIR}/${PN}-6.1-nomancompress.patch"
@@ -333,12 +332,6 @@ src_prepare() {
# hack in the autogen.sh
touch autogen.lastrun
- # system pyuno mess
- sed -i \
- -e "s:%eprefix%:${EPREFIX}:g" \
- -e "s:%libdir%:$(get_libdir):g" \
- pyuno/source/module/uno.py \
- pyuno/source/officehelper.py || die
# sed in the tests
sed -i \
-e "s#all : build unitcheck#all : build#g" \
@@ -555,6 +548,33 @@ src_install() {
# bug 703474
insinto /usr/include
doins -r include/LibreOfficeKit
+
+ local lodir=/usr/$(get_libdir)/libreoffice
+ # patching this would break tests
+ cat <<-EOF > "${T}"/uno.py
+import sys, os
+sys.path.append('${EPREFIX}${lodir}/program')
+os.putenv('URE_BOOTSTRAP', 'vnd.sun.star.pathname:${EPREFIX}${lodir}/libreoffice/program/fundamentalrc')
+EOF
+ sed -e "/^import sys/d" -e "/^import os/d" \
+ -i "${D}"${lodir}/program/uno.py || die "cleanup dupl imports failed"
+ cat "${D}"${lodir}/program/uno.py >> "${T}"/uno.py || die
+ cp "${T}"/uno.py "${D}"${lodir}/program/uno.py || die
+
+ # more system pyuno mess
+ sed -e "/sOffice = \"\" # lets hope for the best/s:\"\":\"${EPREFIX}${lodir}/program\":" \
+ -i "${D}"${lodir}/program/officehelper.py || die
+
+ python_optimize "${D}"${lodir}/program
+ # link python bridge in site-packages, bug 667802
+ local py pyc loprogdir=$(get_libdir)/libreoffice/program
+ for py in uno.py unohelper.py officehelper.py; do
+ dosym ../../../${loprogdir}/${py} $(python_get_sitedir)/${py}
+ while IFS="" read -d $'\0' -r pyc; do
+ pyc=${pyc//*\/}
+ dosym ../../../../${loprogdir}/__pycache__/${pyc} $(python_get_sitedir)/__pycache__/${pyc}
+ done < <(find "${D}"${lodir}/program -type f -name ${py/.py/*.pyc} -print0)
+ done
}
pkg_postinst() {