1 |
commit: 5b335dc89970d19a8539a7d5eaa5dcdc1a51b7cb |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Aug 6 21:39:59 2020 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Sep 27 17:34:35 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5b335dc8 |
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 |
- Obsolete patching of soffice.sh by symlinking py files to site-packages |
13 |
- Fix finding pyuno by reshuffling imports |
14 |
- Fix URE_BOOTSTRAP path (bug in v1 of this patch), thanks to dilfridge |
15 |
|
16 |
Reported-by: Jan Psota <jasiupsota <AT> gmail.com> |
17 |
Closes: https://bugs.gentoo.org/667802 |
18 |
Package-Manager: Portage-3.0.1, Repoman-2.3.23 |
19 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
20 |
|
21 |
app-office/libreoffice/libreoffice-6.4.9999.ebuild | 34 +++++++++++++++++----- |
22 |
app-office/libreoffice/libreoffice-9999.ebuild | 34 +++++++++++++++++----- |
23 |
2 files changed, 54 insertions(+), 14 deletions(-) |
24 |
|
25 |
diff --git a/app-office/libreoffice/libreoffice-6.4.9999.ebuild b/app-office/libreoffice/libreoffice-6.4.9999.ebuild |
26 |
index 6f4a72b4e47..52876b5d2f1 100644 |
27 |
--- a/app-office/libreoffice/libreoffice-6.4.9999.ebuild |
28 |
+++ b/app-office/libreoffice/libreoffice-6.4.9999.ebuild |
29 |
@@ -265,7 +265,6 @@ PATCHES=( |
30 |
# "${WORKDIR}"/${PATCHSET/.tar.xz/} |
31 |
|
32 |
# not upstreamable stuff |
33 |
- "${FILESDIR}/${PN}-5.4-system-pyuno.patch" |
34 |
"${FILESDIR}/${PN}-5.3.4.2-kioclient5.patch" |
35 |
"${FILESDIR}/${PN}-6.1-nomancompress.patch" |
36 |
|
37 |
@@ -333,12 +332,6 @@ src_prepare() { |
38 |
# hack in the autogen.sh |
39 |
touch autogen.lastrun |
40 |
|
41 |
- # system pyuno mess |
42 |
- sed -i \ |
43 |
- -e "s:%eprefix%:${EPREFIX}:g" \ |
44 |
- -e "s:%libdir%:$(get_libdir):g" \ |
45 |
- pyuno/source/module/uno.py \ |
46 |
- pyuno/source/officehelper.py || die |
47 |
# sed in the tests |
48 |
sed -i \ |
49 |
-e "s#all : build unitcheck#all : build#g" \ |
50 |
@@ -555,6 +548,33 @@ src_install() { |
51 |
# bug 703474 |
52 |
insinto /usr/include |
53 |
doins -r include/LibreOfficeKit |
54 |
+ |
55 |
+ local lodir=/usr/$(get_libdir)/libreoffice |
56 |
+ # patching this would break tests |
57 |
+ cat <<-EOF > "${T}"/uno.py |
58 |
+import sys, os |
59 |
+sys.path.append('${EPREFIX}${lodir}/program') |
60 |
+os.putenv('URE_BOOTSTRAP', 'vnd.sun.star.pathname:${EPREFIX}${lodir}/program/fundamentalrc') |
61 |
+EOF |
62 |
+ sed -e "/^import sys/d" -e "/^import os/d" \ |
63 |
+ -i "${D}"${lodir}/program/uno.py || die "cleanup dupl imports failed" |
64 |
+ cat "${D}"${lodir}/program/uno.py >> "${T}"/uno.py || die |
65 |
+ cp "${T}"/uno.py "${D}"${lodir}/program/uno.py || die |
66 |
+ |
67 |
+ # more system pyuno mess |
68 |
+ sed -e "/sOffice = \"\" # lets hope for the best/s:\"\":\"${EPREFIX}${lodir}/program\":" \ |
69 |
+ -i "${D}"${lodir}/program/officehelper.py || die |
70 |
+ |
71 |
+ python_optimize "${D}"${lodir}/program |
72 |
+ # link python bridge in site-packages, bug 667802 |
73 |
+ local py pyc loprogdir=$(get_libdir)/libreoffice/program |
74 |
+ for py in uno.py unohelper.py officehelper.py; do |
75 |
+ dosym ../../../${loprogdir}/${py} $(python_get_sitedir)/${py} |
76 |
+ while IFS="" read -d $'\0' -r pyc; do |
77 |
+ pyc=${pyc//*\/} |
78 |
+ dosym ../../../../${loprogdir}/__pycache__/${pyc} $(python_get_sitedir)/__pycache__/${pyc} |
79 |
+ done < <(find "${D}"${lodir}/program -type f -name ${py/.py/*.pyc} -print0) |
80 |
+ done |
81 |
} |
82 |
|
83 |
pkg_postinst() { |
84 |
|
85 |
diff --git a/app-office/libreoffice/libreoffice-9999.ebuild b/app-office/libreoffice/libreoffice-9999.ebuild |
86 |
index 3cd82d82602..a4e55bc7595 100644 |
87 |
--- a/app-office/libreoffice/libreoffice-9999.ebuild |
88 |
+++ b/app-office/libreoffice/libreoffice-9999.ebuild |
89 |
@@ -269,7 +269,6 @@ PATCHES=( |
90 |
# "${WORKDIR}"/${PATCHSET/.tar.xz/} |
91 |
|
92 |
# not upstreamable stuff |
93 |
- "${FILESDIR}/${PN}-5.4-system-pyuno.patch" |
94 |
"${FILESDIR}/${PN}-5.3.4.2-kioclient5.patch" |
95 |
"${FILESDIR}/${PN}-6.1-nomancompress.patch" |
96 |
) |
97 |
@@ -333,12 +332,6 @@ src_prepare() { |
98 |
# hack in the autogen.sh |
99 |
touch autogen.lastrun |
100 |
|
101 |
- # system pyuno mess |
102 |
- sed -i \ |
103 |
- -e "s:%eprefix%:${EPREFIX}:g" \ |
104 |
- -e "s:%libdir%:$(get_libdir):g" \ |
105 |
- pyuno/source/module/uno.py \ |
106 |
- pyuno/source/officehelper.py || die |
107 |
# sed in the tests |
108 |
sed -i \ |
109 |
-e "s#all : build unitcheck#all : build#g" \ |
110 |
@@ -555,6 +548,33 @@ src_install() { |
111 |
# bug 703474 |
112 |
insinto /usr/include |
113 |
doins -r include/LibreOfficeKit |
114 |
+ |
115 |
+ local lodir=/usr/$(get_libdir)/libreoffice |
116 |
+ # patching this would break tests |
117 |
+ cat <<-EOF > "${T}"/uno.py |
118 |
+import sys, os |
119 |
+sys.path.append('${EPREFIX}${lodir}/program') |
120 |
+os.putenv('URE_BOOTSTRAP', 'vnd.sun.star.pathname:${EPREFIX}${lodir}/program/fundamentalrc') |
121 |
+EOF |
122 |
+ sed -e "/^import sys/d" -e "/^import os/d" \ |
123 |
+ -i "${D}"${lodir}/program/uno.py || die "cleanup dupl imports failed" |
124 |
+ cat "${D}"${lodir}/program/uno.py >> "${T}"/uno.py || die |
125 |
+ cp "${T}"/uno.py "${D}"${lodir}/program/uno.py || die |
126 |
+ |
127 |
+ # more system pyuno mess |
128 |
+ sed -e "/sOffice = \"\" # lets hope for the best/s:\"\":\"${EPREFIX}${lodir}/program\":" \ |
129 |
+ -i "${D}"${lodir}/program/officehelper.py || die |
130 |
+ |
131 |
+ python_optimize "${D}"${lodir}/program |
132 |
+ # link python bridge in site-packages, bug 667802 |
133 |
+ local py pyc loprogdir=$(get_libdir)/libreoffice/program |
134 |
+ for py in uno.py unohelper.py officehelper.py; do |
135 |
+ dosym ../../../${loprogdir}/${py} $(python_get_sitedir)/${py} |
136 |
+ while IFS="" read -d $'\0' -r pyc; do |
137 |
+ pyc=${pyc//*\/} |
138 |
+ dosym ../../../../${loprogdir}/__pycache__/${pyc} $(python_get_sitedir)/__pycache__/${pyc} |
139 |
+ done < <(find "${D}"${lodir}/program -type f -name ${py/.py/*.pyc} -print0) |
140 |
+ done |
141 |
} |
142 |
|
143 |
pkg_postinst() { |