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