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