Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-office/libreoffice/
Date: Tue, 18 Aug 2020 23:08:24
Message-Id: 1597792060.7e9dc414f75767acbd0e297979c6cfec53f6ddef.asturm@gentoo
1 commit: 7e9dc414f75767acbd0e297979c6cfec53f6ddef
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Tue Aug 18 23:04:50 2020 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 18 23:07:40 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7e9dc414
7
8 app-office/libreoffice: Link python bridge in site-packages, drop patch
9
10 Essentially syncing with openSUSE changes.
11 - Obsolete patching of officehelper.py, uno.py not to break tests, use heredoc
12 - Fix finding pyuno by reshuffling imports
13 - Obsolete patching of soffice.sh by symlinking py files to site-packages
14 - Symlink byte-compiled files too
15
16 Reported-by: gerion <gerion.entrup <AT> flump.de>
17 Bug: https://bugs.gentoo.org/667802
18 Package-Manager: Portage-3.0.3, Repoman-3.0.0
19 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
20
21 app-office/libreoffice/libreoffice-6.4.6.2.ebuild | 34 ++++++++++++++++++-----
22 1 file changed, 27 insertions(+), 7 deletions(-)
23
24 diff --git a/app-office/libreoffice/libreoffice-6.4.6.2.ebuild b/app-office/libreoffice/libreoffice-6.4.6.2.ebuild
25 index 6f4a72b4e47..291eb07b6f0 100644
26 --- a/app-office/libreoffice/libreoffice-6.4.6.2.ebuild
27 +++ b/app-office/libreoffice/libreoffice-6.4.6.2.ebuild
28 @@ -265,7 +265,6 @@ PATCHES=(
29 # "${WORKDIR}"/${PATCHSET/.tar.xz/}
30
31 # not upstreamable stuff
32 - "${FILESDIR}/${PN}-5.4-system-pyuno.patch"
33 "${FILESDIR}/${PN}-5.3.4.2-kioclient5.patch"
34 "${FILESDIR}/${PN}-6.1-nomancompress.patch"
35
36 @@ -333,12 +332,6 @@ src_prepare() {
37 # hack in the autogen.sh
38 touch autogen.lastrun
39
40 - # system pyuno mess
41 - sed -i \
42 - -e "s:%eprefix%:${EPREFIX}:g" \
43 - -e "s:%libdir%:$(get_libdir):g" \
44 - pyuno/source/module/uno.py \
45 - pyuno/source/officehelper.py || die
46 # sed in the tests
47 sed -i \
48 -e "s#all : build unitcheck#all : build#g" \
49 @@ -555,6 +548,33 @@ src_install() {
50 # bug 703474
51 insinto /usr/include
52 doins -r include/LibreOfficeKit
53 +
54 + local lodir=/usr/$(get_libdir)/libreoffice
55 + # patching this would break tests
56 + cat <<-EOF > "${T}"/uno.py
57 +import sys, os
58 +sys.path.append('${EPREFIX}${lodir}/program')
59 +os.putenv('URE_BOOTSTRAP', 'vnd.sun.star.pathname:${EPREFIX}${lodir}/libreoffice/program/fundamentalrc')
60 +EOF
61 + sed -e "/^import sys/d" -e "/^import os/d" \
62 + -i "${D}"${lodir}/program/uno.py || die "cleanup dupl imports failed"
63 + cat "${D}"${lodir}/program/uno.py >> "${T}"/uno.py || die
64 + cp "${T}"/uno.py "${D}"${lodir}/program/uno.py || die
65 +
66 + # more system pyuno mess
67 + sed -e "/sOffice = \"\" # lets hope for the best/s:\"\":\"${EPREFIX}${lodir}/program\":" \
68 + -i "${D}"${lodir}/program/officehelper.py || die
69 +
70 + python_optimize "${D}"${lodir}/program
71 + # link python bridge in site-packages, bug 667802
72 + local py pyc loprogdir=$(get_libdir)/libreoffice/program
73 + for py in uno.py unohelper.py officehelper.py; do
74 + dosym ../../../${loprogdir}/${py} $(python_get_sitedir)/${py}
75 + while IFS="" read -d $'\0' -r pyc; do
76 + pyc=${pyc//*\/}
77 + dosym ../../../../${loprogdir}/__pycache__/${pyc} $(python_get_sitedir)/__pycache__/${pyc}
78 + done < <(find "${D}"${lodir}/program -type f -name ${py/.py/*.pyc} -print0)
79 + done
80 }
81
82 pkg_postinst() {