Gentoo Archives: gentoo-commits

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