Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-office/libreoffice/
Date: Mon, 01 Nov 2021 10:03:21
Message-Id: 1635760966.be35efa3defa75a1593364a0804a839bb47417f6.sam@gentoo
1 commit: be35efa3defa75a1593364a0804a839bb47417f6
2 Author: James Beddek <telans <AT> posteo <DOT> de>
3 AuthorDate: Sun Oct 31 10:46:19 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Mon Nov 1 10:02:46 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=be35efa3
7
8 app-office/libreoffice: add 7.2.2.2
9
10 Bug: https://bugs.gentoo.org/811741
11 Closes: https://bugs.gentoo.org/793773
12 Closes: https://bugs.gentoo.org/793776
13 Closes: https://bugs.gentoo.org/816075
14 Closes: https://bugs.gentoo.org/820308
15 Closes: https://github.com/gentoo/gentoo/pull/22235
16 Closes: https://github.com/gentoo/gentoo/pull/22683
17 Signed-off-by: James Beddek <telans <AT> posteo.de>
18 Signed-off-by: Sam James <sam <AT> gentoo.org>
19
20 app-office/libreoffice/Manifest | 4 +
21 app-office/libreoffice/libreoffice-7.2.2.2.ebuild | 662 ++++++++++++++++++++++
22 2 files changed, 666 insertions(+)
23
24 diff --git a/app-office/libreoffice/Manifest b/app-office/libreoffice/Manifest
25 index 9a257640902..b4e52bd7a5d 100644
26 --- a/app-office/libreoffice/Manifest
27 +++ b/app-office/libreoffice/Manifest
28 @@ -18,10 +18,14 @@ DIST dtoa-20180411.tgz 48893 BLAKE2B 4a03dc67e44353ae1c0653c8305d2df9bcfef16b48d
29 DIST eeb2c7ddf0d302fba4bfc6e97eac9624-libbase-1.1.6.zip 427800 BLAKE2B d3ac085a39ee9798182b70ba650fa954234b964e33278ac4fe3f84f8c3218ad49f12d139079328036b4f9d80cde967888c0a66393c34dedf27af69dac02c5aff SHA512 9091d3628d9c75c068507537afc9e10bfb79c1abfd36ad697af3d592a1cc049ba6640f665bfc53cc520b6a26c21d70b0275106843444b441484c2178f2784743
30 DIST f94d9870737518e3b597f9265f4e9803-libserializer-1.1.6.zip 211919 BLAKE2B 2c72493e44d3ad1714d294fb7baaa85d33fef2eb4ce75bf507b65f78f1d9d399bb5eb72cee188a8abc4b234eb2845a26755791fb3ac104ffe6e55013ab41ca8b SHA512 c1a15ebbfe817ec79d4b3f1c97d096bf8511737d7d35d97302856ccfb3de14a1cd16bd31000415d9ab24bbd9ef770d37855cee4b819ff0e8fca2f2766920a114
31 DIST libcmis-0.5.2.tar.xz 484404 BLAKE2B 7de242393c28fc8289bb598b34e704eb2affaaa8b9e470e10044dbfd3812391f29e1421df8d7ac3869955698ddbc9575feebcfbac27bb074a60ccc0527dca1c3 SHA512 295ab15115e75b1f6074f17d3538afe0de9b2b77ab454f5c63cb05e8df11886d82942fbf21ba01486052e3f6c75b0636b99d8e660cd3472dc4b87c31d3cd557b
32 +DIST libcuckoo-93217f8d391718380c508a722ab9acd5e9081233.tar.gz 5005888 BLAKE2B 836ec268c19c27ac079ea1084587c3e999f39ad2188be1a5cf8337ad0473ffda6c32d0695254d3797d1607707329befa88da6043f424544487238e550eda8590 SHA512 4159dfb4d08e359feb23127e12db590260913e70774161ac9513abb5183ad6ed6d2bdfbe56fc8aa68e2fc57ee29eae67aa0180e1a7d955016884ecba2ca60ff8
33 DIST libreoffice-7.1.5.2.tar.xz 244350068 BLAKE2B ac3c7f5cabcb27ce3ed31febb04ce54b93bc8b4fa716259d1b93d5364e75b85af3352ad70a023b56271e769f5537b3f3151e837ee13498e08f1871e5b47d778c SHA512 dad5ffd344a7bad88ed8e77df4fb17b42237715e7b1feb7a7de164f2fbf6698feefedeb57974d8275067a06c0da60e9b07a333ccc1bb2f6d55a6b52408bd9b5f
34 DIST libreoffice-7.1.6.2.tar.xz 244535588 BLAKE2B 79d4980b5842b37e7fdc328e832e3b672225e1903676d5c63ab68d7a993caf000bdb763837f98b4dd8156a95224ce22f501ec66dc315ca801a9c748e203e9170 SHA512 13f8e0a45614c75861b6262bcf845c1dc63baef044dc434319f739b6180f61a740f945e99663d76b1c51ce5226b9765431aa34b49d8a7f017c966bf5d4694257
35 +DIST libreoffice-7.2.2.2.tar.xz 252478892 BLAKE2B e2e4ce76fc91ef0725f105ee87e480ede51610de7cabbc2bee1e32a9822f457ff9c21b0b13636447751727f42917dbdc9e24e20457ee9e5f1e4054d742337b5f SHA512 9adc14aa2aa24e1e91b32f0663d3fed8421baf78c3d310e8cc52ae70ea338b9d58406344d22d2c2fa6f91f10ae91945ef2d5713036f9144705bdb4c19ad69ca7
36 DIST libreoffice-branding-gentoo-0.8.tar.xz 151568 BLAKE2B f03c7ddeb53c5ca3fd23401679601fcf2c4037ba17be4eb7b784c7ce7ebb71a24b8ab4aac8b7da8c6b1f14dd23bc1294ba85ff4f70ad271fb4ee3c5372e10883 SHA512 785031a699b1d1895ce4b50ffc3ddf645f3a0ef9acdf37facfd18cf75db9484cb8f53a50abb63d6006ead76a80b6ff5aa99661063245ebb84bd64013d713de7f
37 DIST libreoffice-help-7.1.5.2.tar.xz 111785852 BLAKE2B 18962fe9260f6cf8ec7b1676f077b9f43e0277769b31b8e2c22cf83ac2963f3e92448901bc12f56dfb579da8a8a1ce20d6bd34c4bc3449f7e0972c03d22f63be SHA512 c669b6c4bfc3c6f46e4ee0bf86b158054f7178b9785273d9aba8183236b2ff6dbaf5584d5e4fb09bba3a8d010373599e7473a4ba15c229087c689198ceeee1c7
38 DIST libreoffice-help-7.1.6.2.tar.xz 111785436 BLAKE2B 810de348ca8fc297a75608bf4def1b4fe68dae976c727ceb157937de8029e9d30b52929c4a4fa6521b3391be27943bfe30b76466b9c415b4f78f0b68a28377ca SHA512 1b0f7fe4bc9bf2e16e3b3ddf49d4a70ef1d7369d9fd4d4835618007a230fb6e36e81fa1bde42d38dba1068147b285148dbff6c336aff52872e8794b594d309ad
39 +DIST libreoffice-help-7.2.2.2.tar.xz 111988404 BLAKE2B a0caafa4685c7356c8f1e592c104cd6e403283eb5b86580665637c3319eac4b651805ca6d7c45c5a0522e882ca1a28b6ae08f73c71b0417612c6fc084e194c1d SHA512 1e3a250b68f591c0dc0cd5d57843baa370ed009faabc9446826e8207043af5d193a263b85b9443a2baf1cb64366d90d08b763adf9ec9865d256f760f847ea638
40 DIST skia-m88-59bafeeaa7de9eb753e3778c414e01dcf013dcd8.tar.xz 10420480 BLAKE2B 83bcc9ff3a3a916ccb92f49ef69f99386e89b636d37679ab17735625c56c4bb31ca89a7034d9282c905b405e0b31215de5fd3734061d323d48db440e4ad52643 SHA512 8e5c37b895d7f5fe15f491005ac46b39efe3bfb3af5dc805bf1226b2112496bdb9e433cc3b313f8fc185fe1f898d126b8a557d23485615cdbe917f0b76855f3d
41 +DIST skia-m90-45c57e116ee0ce214bdf78405a4762722e4507d9.tar.xz 10630696 BLAKE2B a3d42d08a0622de591d177184b6225cf62e3048d02d8f2012b6b02aae186b644c899c4e73b528b3528a4acec6cec07e3576dd6d97b130fedf3b2ec5b2ddf4ed7 SHA512 625ed461d85ce5c5c73ffd20bc3f2c9b5fe6ba557693b793b387ffb434d4f0d9056bd9befe6760c55e9e47f09c02373a49b8ac106162a40d940ea351e8c873c0
42 DIST skia-m94-975fcdd755dfc5d57cddbb25857e0c4ac29abe98.tar.xz 11672176 BLAKE2B 64d7821656002d23be839079dedffe1132497992aaef97ec734d6e430f2eda69f5344ca7fe75dd68fee847fa4c6638b4fc28194a951b91498ece5c6d4bcf3e44 SHA512 ae66fa7caeb5a328d96cd1c35eb8700080be5d3e3764e35b8056b03948e44b8bb8266284c87b44f9200accb95dbb8a2771a6e5ba067d34a7fbd33b1ababf19f8
43
44 diff --git a/app-office/libreoffice/libreoffice-7.2.2.2.ebuild b/app-office/libreoffice/libreoffice-7.2.2.2.ebuild
45 new file mode 100644
46 index 00000000000..d8ad94e8fca
47 --- /dev/null
48 +++ b/app-office/libreoffice/libreoffice-7.2.2.2.ebuild
49 @@ -0,0 +1,662 @@
50 +# Copyright 1999-2021 Gentoo Authors
51 +# Distributed under the terms of the GNU General Public License v2
52 +
53 +EAPI=7
54 +
55 +PYTHON_COMPAT=( python3_{8..10} )
56 +PYTHON_REQ_USE="threads(+),xml"
57 +
58 +MY_PV="${PV/_alpha/.alpha}"
59 +MY_PV="${MY_PV/_beta/.beta}"
60 +# experimental ; release ; old
61 +# Usually the tarballs are moved a lot so this should make everyone happy.
62 +DEV_URI="
63 + https://dev-builds.libreoffice.org/pre-releases/src
64 + https://download.documentfoundation.org/libreoffice/src/${MY_PV:0:5}/
65 + https://downloadarchive.documentfoundation.org/libreoffice/old/${MY_PV}/src
66 +"
67 +ADDONS_URI="https://dev-www.libreoffice.org/src/"
68 +
69 +BRANDING="${PN}-branding-gentoo-0.8.tar.xz"
70 +# PATCHSET="${P}-patchset-01.tar.xz"
71 +
72 +[[ ${MY_PV} == *9999* ]] && inherit git-r3
73 +inherit autotools bash-completion-r1 check-reqs eapi8-dosym flag-o-matic java-pkg-opt-2 multiprocessing python-single-r1 qmake-utils toolchain-funcs xdg-utils
74 +
75 +DESCRIPTION="A full office productivity suite"
76 +HOMEPAGE="https://www.libreoffice.org"
77 +SRC_URI="branding? ( https://dev.gentoo.org/~dilfridge/distfiles/${BRANDING} )"
78 +[[ -n ${PATCHSET} ]] && SRC_URI+=" https://dev.gentoo.org/~asturm/distfiles/${PATCHSET}"
79 +
80 +# Split modules following git/tarballs; Core MUST be first!
81 +# Help is used for the image generator
82 +# Only release has the tarballs
83 +if [[ ${MY_PV} != *9999* ]]; then
84 + for i in ${DEV_URI}; do
85 + SRC_URI+=" ${i}/${PN}-${MY_PV}.tar.xz"
86 + SRC_URI+=" ${i}/${PN}-help-${MY_PV}.tar.xz"
87 + done
88 + unset i
89 +fi
90 +unset DEV_URI
91 +
92 +# Really required addons
93 +# These are bundles that can't be removed for now due to huge patchsets.
94 +# If you want them gone, patches are welcome.
95 +ADDONS_SRC=(
96 + # broken against latest upstream release, too many patches on top:
97 + # https://github.com/tdf/libcmis/pull/43
98 + "${ADDONS_URI}/libcmis-0.5.2.tar.xz"
99 + # not packaged in Gentoo, https://www.netlib.org/fp/dtoa.c
100 + "${ADDONS_URI}/dtoa-20180411.tgz"
101 + # not packaged in Gentoo, https://skia.org/
102 + "${ADDONS_URI}/skia-m90-45c57e116ee0ce214bdf78405a4762722e4507d9.tar.xz"
103 + "base? (
104 + ${ADDONS_URI}/commons-logging-1.2-src.tar.gz
105 + ${ADDONS_URI}/ba2930200c9f019c2d93a8c88c651a0f-flow-engine-0.9.4.zip
106 + ${ADDONS_URI}/d8bd5eed178db6e2b18eeed243f85aa8-flute-1.1.6.zip
107 + ${ADDONS_URI}/eeb2c7ddf0d302fba4bfc6e97eac9624-libbase-1.1.6.zip
108 + ${ADDONS_URI}/3bdf40c0d199af31923e900d082ca2dd-libfonts-1.1.6.zip
109 + ${ADDONS_URI}/3404ab6b1792ae5f16bbd603bd1e1d03-libformula-1.1.7.zip
110 + ${ADDONS_URI}/db60e4fde8dd6d6807523deb71ee34dc-liblayout-0.2.10.zip
111 + ${ADDONS_URI}/97b2d4dba862397f446b217e2b623e71-libloader-1.1.6.zip
112 + ${ADDONS_URI}/8ce2fcd72becf06c41f7201d15373ed9-librepository-1.1.6.zip
113 + ${ADDONS_URI}/f94d9870737518e3b597f9265f4e9803-libserializer-1.1.6.zip
114 + ${ADDONS_URI}/ace6ab49184e329db254e454a010f56d-libxml-1.1.7.zip
115 + ${ADDONS_URI}/39bb3fcea1514f1369fcfc87542390fd-sacjava-1.3.zip
116 + )"
117 + "java? ( ${ADDONS_URI}/17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip )"
118 + # no release for 8 years, should we package it?
119 + "libreoffice_extensions_wiki-publisher? ( ${ADDONS_URI}/a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip )"
120 + # Does not build with 1.6 rhino at all
121 + "libreoffice_extensions_scripting-javascript? ( ${ADDONS_URI}/798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip )"
122 + # requirement of rhino
123 + "libreoffice_extensions_scripting-javascript? ( ${ADDONS_URI}/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip )"
124 + # not packageable
125 + "odk? ( http://download.go-oo.org/extern/185d60944ea767075d27247c3162b3bc-unowinreg.dll )"
126 +)
127 +SRC_URI+=" ${ADDONS_SRC[*]}"
128 +
129 +unset ADDONS_URI
130 +unset ADDONS_SRC
131 +
132 +# Extensions that need extra work:
133 +LO_EXTS="nlpsolver scripting-beanshell scripting-javascript wiki-publisher"
134 +
135 +IUSE="accessibility base bluetooth +branding clang coinmp +cups custom-cflags +dbus debug eds firebird
136 +googledrive gstreamer +gtk kde ldap +mariadb odk pdfimport postgres test vulkan
137 +$(printf 'libreoffice_extensions_%s ' ${LO_EXTS})"
138 +
139 +REQUIRED_USE="${PYTHON_REQUIRED_USE}
140 + base? ( firebird java )
141 + bluetooth? ( dbus )
142 + gtk? ( dbus )
143 + libreoffice_extensions_nlpsolver? ( java )
144 + libreoffice_extensions_scripting-beanshell? ( java )
145 + libreoffice_extensions_scripting-javascript? ( java )
146 + libreoffice_extensions_wiki-publisher? ( java )
147 +"
148 +
149 +RESTRICT="!test? ( test )"
150 +
151 +LICENSE="|| ( LGPL-3 MPL-1.1 )"
152 +SLOT="0"
153 +
154 +[[ ${MY_PV} == *9999* ]] || \
155 +KEYWORDS="~amd64 ~amd64-linux ~arm64 ~ppc64 ~x86"
156 +
157 +BDEPEND="
158 + dev-util/intltool
159 + sys-devel/bison
160 + sys-devel/flex
161 + sys-devel/gettext
162 + virtual/pkgconfig
163 + clang? (
164 + || (
165 + ( sys-devel/clang:13
166 + sys-devel/llvm:13
167 + =sys-devel/lld-13* )
168 + ( sys-devel/clang:12
169 + sys-devel/llvm:12
170 + =sys-devel/lld-12* )
171 + ( sys-devel/clang:11
172 + sys-devel/llvm:11
173 + =sys-devel/lld-11* )
174 + ( sys-devel/clang:10
175 + sys-devel/llvm:10
176 + =sys-devel/lld-10* )
177 + )
178 + )
179 + odk? ( >=app-doc/doxygen-1.8.4 )
180 +"
181 +COMMON_DEPEND="${PYTHON_DEPS}
182 + app-arch/unzip
183 + app-arch/zip
184 + app-crypt/gpgme[cxx]
185 + app-text/hunspell:=
186 + >=app-text/libabw-0.1.0
187 + >=app-text/libebook-0.1
188 + app-text/libepubgen
189 + >=app-text/libetonyek-0.1
190 + app-text/libexttextcat
191 + app-text/liblangtag
192 + >=app-text/libmspub-0.1.0
193 + >=app-text/libmwaw-0.3.1
194 + >=app-text/libnumbertext-1.0.6
195 + >=app-text/libodfgen-0.1.0
196 + app-text/libqxp
197 + app-text/libstaroffice
198 + app-text/libwpd:0.10[tools]
199 + app-text/libwpg:0.3
200 + >=app-text/libwps-0.4
201 + app-text/mythes
202 + >=dev-cpp/clucene-2.3.3.4-r2
203 + >=dev-cpp/libcmis-0.5.2
204 + dev-db/unixODBC
205 + dev-lang/perl
206 + >=dev-libs/boost-1.72.0:=[nls]
207 + dev-libs/expat
208 + dev-libs/hyphen
209 + dev-libs/icu:=
210 + dev-libs/libassuan
211 + dev-libs/libgpg-error
212 + dev-libs/liborcus:0/0.16
213 + dev-libs/librevenge
214 + dev-libs/libxml2
215 + dev-libs/libxslt
216 + dev-libs/nspr
217 + dev-libs/nss
218 + >=dev-libs/redland-1.0.16
219 + >=dev-libs/xmlsec-1.2.28[nss]
220 + >=games-engines/box2d-2.4.1:0
221 + media-gfx/fontforge
222 + media-gfx/graphite2
223 + media-libs/fontconfig
224 + >=media-libs/freetype-2.11.0-r1:2
225 + >=media-libs/harfbuzz-0.9.42:=[graphite,icu]
226 + media-libs/lcms:2
227 + >=media-libs/libcdr-0.1.0
228 + >=media-libs/libepoxy-1.3.1[X]
229 + >=media-libs/libfreehand-0.1.0
230 + media-libs/libpagemaker
231 + >=media-libs/libpng-1.4:0=
232 + >=media-libs/libvisio-0.1.0
233 + media-libs/libzmf
234 + media-libs/zxing-cpp
235 + >=net-libs/neon-0.31.1:=
236 + net-misc/curl
237 + sci-mathematics/lpsolve
238 + sys-libs/zlib
239 + virtual/jpeg:0
240 + virtual/opengl
241 + x11-libs/cairo[X]
242 + x11-libs/libXinerama
243 + x11-libs/libXrandr
244 + x11-libs/libXrender
245 + accessibility? (
246 + $(python_gen_cond_dep 'dev-python/lxml[${PYTHON_USEDEP}]')
247 + )
248 + bluetooth? (
249 + dev-libs/glib:2
250 + net-wireless/bluez
251 + )
252 + coinmp? ( sci-libs/coinor-mp )
253 + cups? ( net-print/cups )
254 + dbus? ( sys-apps/dbus[X] )
255 + eds? (
256 + dev-libs/glib:2
257 + gnome-base/dconf
258 + gnome-extra/evolution-data-server
259 + )
260 + firebird? ( >=dev-db/firebird-3.0.2.32703.0-r1[server] )
261 + gstreamer? (
262 + media-libs/gstreamer:1.0
263 + media-libs/gst-plugins-base:1.0
264 + )
265 + gtk? (
266 + dev-libs/glib:2
267 + dev-libs/gobject-introspection
268 + gnome-base/dconf
269 + media-libs/mesa[egl(+)]
270 + x11-libs/gtk+:3[X]
271 + x11-libs/pango
272 + )
273 + kde? (
274 + dev-qt/qtcore:5
275 + dev-qt/qtgui:5
276 + dev-qt/qtwidgets:5
277 + dev-qt/qtx11extras:5
278 + kde-frameworks/kconfig:5
279 + kde-frameworks/kcoreaddons:5
280 + kde-frameworks/ki18n:5
281 + kde-frameworks/kio:5
282 + kde-frameworks/kwindowsystem:5
283 + )
284 + ldap? ( net-nds/openldap )
285 + libreoffice_extensions_scripting-beanshell? ( dev-java/bsh )
286 + libreoffice_extensions_scripting-javascript? ( dev-java/rhino:1.6 )
287 + mariadb? ( dev-db/mariadb-connector-c )
288 + !mariadb? ( dev-db/mysql-connector-c )
289 + pdfimport? ( app-text/poppler:=[cxx] )
290 + postgres? ( >=dev-db/postgresql-9.0:*[kerberos] )
291 +"
292 +# FIXME: cppunit should be moved to test conditional
293 +# after everything upstream is under gbuild
294 +# as dmake execute tests right away
295 +# tests apparently also need google-carlito-fonts (not packaged)
296 +DEPEND="${COMMON_DEPEND}
297 + >=dev-libs/libatomic_ops-7.2d
298 + dev-perl/Archive-Zip
299 + >=dev-util/cppunit-1.14.0
300 + >=dev-util/gperf-3.1
301 + dev-util/mdds:1/1.5
302 + media-libs/glm
303 + sys-devel/ucpp
304 + x11-base/xorg-proto
305 + x11-libs/libXt
306 + x11-libs/libXtst
307 + java? (
308 + dev-java/ant-core
309 + || (
310 + dev-java/openjdk:11
311 + dev-java/openjdk-bin:11
312 + )
313 + )
314 + test? (
315 + app-crypt/gnupg
316 + dev-util/cppunit
317 + media-fonts/dejavu
318 + media-fonts/liberation-fonts
319 + )
320 +"
321 +RDEPEND="${COMMON_DEPEND}
322 + !app-office/libreoffice-bin
323 + !app-office/libreoffice-bin-debug
324 + media-fonts/liberation-fonts
325 + || ( x11-misc/xdg-utils kde-plasma/kde-cli-tools )
326 + java? ( || (
327 + dev-java/openjdk:11
328 + dev-java/openjdk-jre-bin:11
329 + >=virtual/jre-1.8
330 + ) )
331 + kde? ( kde-frameworks/breeze-icons:* )
332 +"
333 +if [[ ${MY_PV} != *9999* ]] && [[ ${PV} != *_* ]]; then
334 + PDEPEND="=app-office/libreoffice-l10n-$(ver_cut 1-2)*"
335 +else
336 + # Translations are not reliable on live ebuilds
337 + # rather force people to use english only.
338 + PDEPEND="!app-office/libreoffice-l10n"
339 +fi
340 +
341 +PATCHES=(
342 + # "${WORKDIR}"/${PATCHSET/.tar.xz/}
343 +
344 + # not upstreamable stuff
345 + "${FILESDIR}/${PN}-5.3.4.2-kioclient5.patch"
346 + "${FILESDIR}/${PN}-6.1-nomancompress.patch"
347 + "${FILESDIR}/${PN}-7.2.0.4-qt5detect.patch"
348 +)
349 +
350 +S="${WORKDIR}/${PN}-${MY_PV}"
351 +
352 +_check_reqs() {
353 + CHECKREQS_MEMORY="512M"
354 + if is-flagq "-g*" && ! is-flagq "-g*0" ; then
355 + CHECKREQS_DISK_BUILD="22G"
356 + else
357 + CHECKREQS_DISK_BUILD="6G"
358 + fi
359 + check-reqs_$1
360 +}
361 +
362 +pkg_pretend() {
363 + if use x86; then
364 + elog "Unfortunately for packaging reasons on x86, various Java-based wizards,"
365 + elog "most notably Report Builder in LibreOffice Base, will not be available."
366 + elog "See also: https://bugs.gentoo.org/785640"
367 + else
368 + use base ||
369 + ewarn "If you plan to use Base application you must enable USE base."
370 + use java ||
371 + ewarn "Without USE java, several wizards are not going to be available."
372 + fi
373 +
374 + [[ ${MERGE_TYPE} != binary ]] && _check_reqs pkg_pretend
375 +}
376 +
377 +pkg_setup() {
378 + java-pkg-opt-2_pkg_setup
379 + python-single-r1_pkg_setup
380 + xdg_environment_reset
381 +
382 + [[ ${MERGE_TYPE} != binary ]] && _check_reqs pkg_setup
383 +}
384 +
385 +src_unpack() {
386 + default
387 +
388 + if [[ ${MY_PV} = *9999* ]]; then
389 + local base_uri branch mypv
390 + base_uri="https://anongit.freedesktop.org/git"
391 + branch="master"
392 + mypv=${MY_PV/.9999}
393 + [[ ${mypv} != ${MY_PV} ]] && branch="${PN}-${mypv/./-}"
394 + git-r3_fetch "${base_uri}/${PN}/core" "refs/heads/${branch}"
395 + git-r3_checkout "${base_uri}/${PN}/core"
396 + LOCOREGIT_VERSION=${EGIT_VERSION}
397 +
398 + git-r3_fetch "${base_uri}/${PN}/help" "refs/heads/master"
399 + git-r3_checkout "${base_uri}/${PN}/help" "helpcontent2" # doesn't match on help
400 + fi
401 +}
402 +
403 +src_prepare() {
404 + default
405 +
406 + # sandbox violations on many systems, we don't need it. Bug #646406
407 + sed -i \
408 + -e "/KF5_CONFIG/s/kf5-config/no/" \
409 + configure.ac || die "Failed to disable kf5-config"
410 +
411 + AT_M4DIR="m4" eautoreconf
412 + # hack in the autogen.sh
413 + touch autogen.lastrun
414 +
415 + # sed in the tests
416 + sed -i \
417 + -e "s#all : build unitcheck#all : build#g" \
418 + solenv/gbuild/Module.mk || die
419 + sed -i \
420 + -e "s#check: dev-install subsequentcheck#check: unitcheck slowcheck dev-install subsequentcheck#g" \
421 + -e "s#Makefile.gbuild all slowcheck#Makefile.gbuild all#g" \
422 + Makefile.in || die
423 +
424 + sed -i \
425 + -e "s,/usr/share/bash-completion/completions,$(get_bashcompdir)," \
426 + -e "s,\$INSTALLDIRNAME.sh,${PN}," \
427 + bin/distro-install-desktop-integration || die
428 +
429 + if use branding; then
430 + # hack...
431 + mv -v "${WORKDIR}/branding-intro.png" "icon-themes/colibre/brand/intro.png" || die
432 + fi
433 +
434 + # Don't list pdfimport support in desktop when built with none, bug # 605464
435 + if ! use pdfimport; then
436 + sed -i \
437 + -e ":MimeType: s:application/pdf;::" \
438 + -e ":Keywords: s:pdf;::" \
439 + sysui/desktop/menus/draw.desktop || die
440 + fi
441 +}
442 +
443 +src_configure() {
444 + # Set up Google API keys, see https://www.chromium.org/developers/how-tos/api-keys
445 + # Note: these are for Gentoo use ONLY. For your own distribution, please get
446 + # your own set of keys. Feel free to contact chromium@g.o for more info.
447 + local google_default_client_id="329227923882.apps.googleusercontent.com"
448 + local google_default_client_secret="vgKG0NNv7GoDpbtoFNLxCUXu"
449 +
450 + # Show flags set at the beginning
451 + einfo "Preset CFLAGS: ${CFLAGS}"
452 + einfo "Preset LDFLAGS: ${LDFLAGS}"
453 +
454 + if use clang ; then
455 + # Force clang
456 + einfo "Enforcing the use of clang due to USE=clang ..."
457 + AR=llvm-ar
458 + CC=${CHOST}-clang
459 + CXX=${CHOST}-clang++
460 + NM=llvm-nm
461 + RANLIB=llvm-ranlib
462 + LDFLAGS+=" -fuse-ld=lld"
463 + else
464 + # Force gcc
465 + einfo "Enforcing the use of gcc due to USE=-clang ..."
466 + AR=gcc-ar
467 + CC=${CHOST}-gcc
468 + CXX=${CHOST}-g++
469 + NM=gcc-nm
470 + RANLIB=gcc-ranlib
471 + fi
472 +
473 + if use custom-cflags ; then
474 + elog "USE=custom-cflags has been selected. You are on your own to make sure that"
475 + elog "the build succeeds. Good luck!"
476 + else
477 + strip-flags
478 + fi
479 +
480 + export LO_CLANG_CC=${CC}
481 + export LO_CLANG_CXX=${CXX}
482 +
483 + # Show flags set at the end
484 + einfo " Used CFLAGS: ${CFLAGS}"
485 + einfo " Used LDFLAGS: ${LDFLAGS}"
486 +
487 + # Ensure we use correct toolchain
488 + tc-export CC CXX LD AR NM OBJDUMP RANLIB PKG_CONFIG
489 +
490 + if use vulkan && ! use clang ; then
491 + ewarn "Building skia with gcc may lead to performance issues. Disable vulkan or enable clang."
492 + fi
493 +
494 + # optimization flags
495 + export GMAKE_OPTIONS="${MAKEOPTS}"
496 + # System python enablement:
497 + export PYTHON_CFLAGS=$(python_get_CFLAGS)
498 + export PYTHON_LIBS=$(python_get_LIBS)
499 +
500 + use kde && export QT5DIR="$(qt5_get_bindir)/.."
501 +
502 + local gentoo_buildid="Gentoo official package"
503 + if [[ -n ${LOCOREGIT_VERSION} ]]; then
504 + gentoo_buildid+=" (from git: ${LOCOREGIT_VERSION})"
505 + fi
506 +
507 + # system headers/libs/...: enforce using system packages
508 + # --disable-breakpad: requires not-yet-in-tree dev-utils/breakpad
509 + # --enable-cairo: ensure that cairo is always required
510 + # --enable-*-link: link to the library rather than just dlopen on runtime
511 + # --enable-release-build: build the libreoffice as release
512 + # --disable-fetch-external: prevent dowloading during compile phase
513 + # --enable-extension-integration: enable any extension integration support
514 + # --without-{fonts,myspell-dicts,ppsd}: prevent install of sys pkgs
515 + # --disable-report-builder: too much java packages pulled in without pkgs
516 + # --without-system-sane: just sane.h header that is used for scan in writer,
517 + # not linked or anything else, worthless to depend on
518 + # --disable-pdfium: not yet packaged
519 + local myeconfargs=(
520 + --with-system-dicts
521 + --with-system-epoxy
522 + --with-system-headers
523 + --with-system-jars
524 + --with-system-libs
525 + --enable-build-opensymbol
526 + --enable-cairo-canvas
527 + --enable-largefile
528 + --enable-mergelibs
529 + --enable-python=system
530 + --enable-randr
531 + --enable-release-build
532 + --disable-breakpad
533 + --disable-bundle-mariadb
534 + --disable-ccache
535 + --disable-epm
536 + --disable-fetch-external
537 + --disable-gtk3-kde5
538 + --disable-online-update
539 + --disable-openssl
540 + --disable-pdfium
541 + --with-extra-buildid="${gentoo_buildid}"
542 + --enable-extension-integration
543 + --with-external-dict-dir="${EPREFIX}/usr/share/myspell"
544 + --with-external-hyph-dir="${EPREFIX}/usr/share/myspell"
545 + --with-external-thes-dir="${EPREFIX}/usr/share/myspell"
546 + --with-external-tar="${DISTDIR}"
547 + --with-lang=""
548 + --with-parallelism=$(makeopts_jobs)
549 + --with-system-ucpp
550 + --with-tls=nss
551 + --with-vendor="Gentoo Foundation"
552 + --with-webdav
553 + --with-x
554 + --without-fonts
555 + --without-myspell-dicts
556 + --with-help="html"
557 + --without-helppack-integration
558 + --with-system-gpgmepp
559 + --without-system-jfreereport
560 + --without-system-libcmis
561 + --without-system-sane
562 + $(use_enable base report-builder)
563 + $(use_enable bluetooth sdremote-bluetooth)
564 + $(use_enable coinmp)
565 + $(use_enable cups)
566 + $(use_enable dbus)
567 + $(use_enable debug)
568 + $(use_enable eds evolution2)
569 + $(use_enable firebird firebird-sdbc)
570 + $(use_enable gstreamer gstreamer-1-0)
571 + $(use_enable gtk gtk3)
572 + $(use_enable kde kf5)
573 + $(use_enable kde qt5)
574 + $(use_enable ldap)
575 + $(use_enable odk)
576 + $(use_enable pdfimport)
577 + $(use_enable postgres postgresql-sdbc)
578 + $(use_enable vulkan skia)
579 + $(use_with accessibility lxml)
580 + $(use_with coinmp system-coinmp)
581 + $(use_with googledrive gdrive-client-id ${google_default_client_id})
582 + $(use_with googledrive gdrive-client-secret ${google_default_client_secret})
583 + $(use_with java)
584 + $(use_with odk doxygen)
585 + )
586 +
587 + if use eds || use gtk; then
588 + myeconfargs+=( --enable-dconf --enable-gio )
589 + else
590 + myeconfargs+=( --disable-dconf --disable-gio )
591 + fi
592 +
593 + # libreoffice extensions handling
594 + for lo_xt in ${LO_EXTS}; do
595 + if [[ "${lo_xt}" == "scripting-beanshell" || "${lo_xt}" == "scripting-javascript" ]]; then
596 + myeconfargs+=( $(use_enable libreoffice_extensions_${lo_xt} ${lo_xt}) )
597 + else
598 + myeconfargs+=( $(use_enable libreoffice_extensions_${lo_xt} ext-${lo_xt}) )
599 + fi
600 + done
601 +
602 + if use java; then
603 + # hsqldb: system one is too new
604 + myeconfargs+=(
605 + --without-junit
606 + --without-system-hsqldb
607 + --with-ant-home="${ANT_HOME}"
608 + )
609 + if has_version "dev-java/openjdk:11"; then
610 + myeconfargs+=( -with-jdk-home="${EPREFIX}/usr/$(get_libdir)/openjdk-11" )
611 + elif has_version "dev-java/openjdk-bin:11"; then
612 + myeconfargs+=( --with-jdk-home="/opt/openjdk-bin-11" )
613 + fi
614 +
615 + use libreoffice_extensions_scripting-beanshell && \
616 + myeconfargs+=( --with-beanshell-jar=$(java-pkg_getjar bsh bsh.jar) )
617 +
618 + use libreoffice_extensions_scripting-javascript && \
619 + myeconfargs+=( --with-rhino-jar=$(java-pkg_getjar rhino-1.6 js.jar) )
620 + fi
621 +
622 + is-flagq "-flto*" && myeconfargs+=( --enable-lto )
623 +
624 + MARIADBCONFIG="$(type -p $(usex mariadb mariadb mysql)_config)" \
625 + econf "${myeconfargs[@]}"
626 +}
627 +
628 +src_compile() {
629 + # more and more LO stuff tries to use OpenGL, including tests during build
630 + # bug 501508, bug 540624, bug 545974 and probably more
631 + addpredict /dev/dri
632 + addpredict /dev/ati
633 + addpredict /dev/nvidiactl
634 +
635 + local target
636 + use test && target="build" || target="build-nocheck"
637 +
638 + # this is not a proper make script
639 + make ${target} || die
640 +}
641 +
642 +src_test() {
643 + make unitcheck || die
644 + make slowcheck || die
645 +}
646 +
647 +src_install() {
648 + # This is not Makefile so no buildserver
649 + emake DESTDIR="${D}" distro-pack-install -o build -o check
650 +
651 + # bug 593514
652 + if use gtk; then
653 + dosym libreoffice/program/liblibreofficekitgtk.so \
654 + /usr/$(get_libdir)/liblibreofficekitgtk.so
655 + fi
656 +
657 + # bash completion aliases
658 + bashcomp_alias \
659 + libreoffice \
660 + unopkg loimpress lobase localc lodraw lomath lowriter lofromtemplate loweb loffice
661 +
662 + if use branding; then
663 + insinto /usr/$(get_libdir)/${PN}/program
664 + newins "${WORKDIR}/branding-sofficerc" sofficerc
665 + dodir /etc/env.d
666 + echo "CONFIG_PROTECT=/usr/$(get_libdir)/${PN}/program/sofficerc" > "${ED}"/etc/env.d/99${PN} || die
667 + fi
668 +
669 + # bug 703474
670 + insinto /usr/include
671 + doins -r include/LibreOfficeKit
672 +
673 + local lodir=/usr/$(get_libdir)/libreoffice
674 + # patching this would break tests
675 + cat <<-EOF > "${T}"/uno.py
676 +import sys, os
677 +sys.path.append('${EPREFIX}${lodir}/program')
678 +os.putenv('URE_BOOTSTRAP', 'vnd.sun.star.pathname:${EPREFIX}${lodir}/program/fundamentalrc')
679 +EOF
680 + sed -e "/^import sys/d" -e "/^import os/d" \
681 + -i "${D}"${lodir}/program/uno.py || die "cleanup dupl imports failed"
682 + cat "${D}"${lodir}/program/uno.py >> "${T}"/uno.py || die
683 + cp "${T}"/uno.py "${D}"${lodir}/program/uno.py || die
684 +
685 + # more system pyuno mess
686 + sed -e "/sOffice = \"\" # lets hope for the best/s:\"\":\"${EPREFIX}${lodir}/program\":" \
687 + -i "${D}"${lodir}/program/officehelper.py || die
688 +
689 + python_optimize "${D}"${lodir}/program
690 + # link python bridge in site-packages, bug 667802
691 + local py pyc loprogdir=/usr/$(get_libdir)/libreoffice/program
692 + for py in uno.py unohelper.py officehelper.py; do
693 + dosym8 -r ${loprogdir}/${py} $(python_get_sitedir)/${py}
694 + while IFS="" read -d $'\0' -r pyc; do
695 + pyc=${pyc//*\/}
696 + dosym8 -r ${loprogdir}/__pycache__/${pyc} $(python_get_sitedir)/__pycache__/${pyc}
697 + done < <(find "${D}"${lodir}/program -type f -name ${py/.py/*.pyc} -print0)
698 + done
699 +}
700 +
701 +pkg_postinst() {
702 + xdg_icon_cache_update
703 + xdg_desktop_database_update
704 + xdg_mimeinfo_database_update
705 +}
706 +
707 +pkg_postrm() {
708 + xdg_icon_cache_update
709 + xdg_desktop_database_update
710 + xdg_mimeinfo_database_update
711 +}