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