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/files/, app-office/libreoffice/
Date: Sat, 14 Jul 2018 08:20:54
Message-Id: 1531556424.e50b4bcc829521e384529251d85af59e0a0a1b1a.asturm@gentoo
1 commit: e50b4bcc829521e384529251d85af59e0a0a1b1a
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jul 13 19:16:54 2018 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sat Jul 14 08:20:24 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e50b4bcc
7
8 app-office/libreoffice: Fix gio support with USE=gtk3
9
10 Thanks-to: Christian Becke <christianbecke <AT> gmail.com>
11 Closes: https://bugs.gentoo.org/661062
12 Package-Manager: Portage-2.3.42, Repoman-2.3.9
13
14 .../libreoffice-6.0.5.2-enable-gio-w-gtk3.patch | 46 ++
15 .../libreoffice/libreoffice-6.0.5.2-r1.ebuild | 575 +++++++++++++++++++++
16 2 files changed, 621 insertions(+)
17
18 diff --git a/app-office/libreoffice/files/libreoffice-6.0.5.2-enable-gio-w-gtk3.patch b/app-office/libreoffice/files/libreoffice-6.0.5.2-enable-gio-w-gtk3.patch
19 new file mode 100644
20 index 00000000000..4a018711ca2
21 --- /dev/null
22 +++ b/app-office/libreoffice/files/libreoffice-6.0.5.2-enable-gio-w-gtk3.patch
23 @@ -0,0 +1,46 @@
24 +From a560bcbea943cb317e96c15c608c5e2f66e5698f Mon Sep 17 00:00:00 2001
25 +From: Stephan Bergmann <sbergman@××××××.com>
26 +Date: Thu, 31 May 2018 14:14:48 +0200
27 +Subject: --enable-gio also for --disable-gtk --enable-gtk3
28 +MIME-Version: 1.0
29 +Content-Type: text/plain; charset=UTF-8
30 +Content-Transfer-Encoding: 8bit
31 +
32 +...as is used by the Flatpak build. Other settings only checked in that block
33 +controlled by ENABLE_GTK, and thus potentially erronously left empty for
34 +--disable-gtk --enable-gtk3 builds, are GTHREAD- and GTK_PRINT-related settings.
35 +GTHREAD_LIBS is explicitly used in vcl/Library_vclplug_gtk3.mk even, but it
36 +being empty apparently has no negative effects, so leave it at that for now.
37 +On the GTK_PRINT-related settings, Caolan commented on IRC: "ENABLE_GTK_PRINT
38 +is probably best removed entirely I guess, it didn't work out and they're
39 +redoing the dialog in upstream gtk again I'm told."
40 +
41 +Change-Id: I7e026c0ac9b23e7ace2c2e92390bdcc3be7d39a3
42 +Reviewed-on: https://gerrit.libreoffice.org/55127
43 +Tested-by: Jenkins <ci@×××××××××××.org>
44 +Reviewed-by: Stephan Bergmann <sbergman@××××××.com>
45 +(cherry picked from commit b5dd045bf533a2ba4d1c98debe5a2acba4c8b486)
46 +Reviewed-on: https://gerrit.libreoffice.org/55164
47 +Reviewed-by: Caolán McNamara <caolanm@××××××.com>
48 +Tested-by: Caolán McNamara <caolanm@××××××.com>
49 +---
50 + configure.ac | 2 ++
51 + 1 file changed, 2 insertions(+)
52 +
53 +diff --git a/configure.ac b/configure.ac
54 +index e35db48..9da61d9 100644
55 +--- a/configure.ac
56 ++++ b/configure.ac
57 +@@ -9875,7 +9875,9 @@ if test "$test_gtk" = "yes"; then
58 + GTK_PRINT_CFLAGS=$(printf '%s' "$GTK_PRINT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
59 + FilterLibs "${GTK_PRINT_LIBS}"
60 + GTK_PRINT_LIBS="${filteredlibs}"
61 ++ fi
62 +
63 ++ if test "$ENABLE_GTK" = "TRUE" || test "$ENABLE_GTK3" = "TRUE"; then
64 + AC_MSG_CHECKING([whether to enable GIO support])
65 + if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
66 + dnl Need at least 2.26 for the dbus support.
67 +--
68 +cgit v1.1
69 +
70
71 diff --git a/app-office/libreoffice/libreoffice-6.0.5.2-r1.ebuild b/app-office/libreoffice/libreoffice-6.0.5.2-r1.ebuild
72 new file mode 100644
73 index 00000000000..1ed29b9c997
74 --- /dev/null
75 +++ b/app-office/libreoffice/libreoffice-6.0.5.2-r1.ebuild
76 @@ -0,0 +1,575 @@
77 +# Copyright 1999-2018 Gentoo Foundation
78 +# Distributed under the terms of the GNU General Public License v2
79 +
80 +EAPI=6
81 +
82 +PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
83 +PYTHON_REQ_USE="threads,xml"
84 +
85 +MY_PV="${PV/_alpha/.alpha}"
86 +MY_PV="${MY_PV/_beta/.beta}"
87 +# experimental ; release ; old
88 +# Usually the tarballs are moved a lot so this should make everyone happy.
89 +DEV_URI="
90 + https://dev-builds.libreoffice.org/pre-releases/src
91 + https://download.documentfoundation.org/libreoffice/src/${MY_PV:0:5}/
92 + https://downloadarchive.documentfoundation.org/libreoffice/old/${MY_PV}/src
93 +"
94 +ADDONS_URI="https://dev-www.libreoffice.org/src/"
95 +
96 +BRANDING="${PN}-branding-gentoo-0.8.tar.xz"
97 +PATCHSET="${P}-patchset-02.tar.xz"
98 +
99 +[[ ${MY_PV} == *9999* ]] && SCM_ECLASS="git-r3"
100 +inherit autotools bash-completion-r1 check-reqs eapi7-ver flag-o-matic gnome2-utils java-pkg-opt-2 multiprocessing pax-utils python-single-r1 qmake-utils toolchain-funcs xdg-utils ${SCM_ECLASS}
101 +unset SCM_ECLASS
102 +
103 +DESCRIPTION="A full office productivity suite"
104 +HOMEPAGE="https://www.libreoffice.org"
105 +SRC_URI="branding? ( https://dev.gentoo.org/~dilfridge/distfiles/${BRANDING} )"
106 +[[ -n ${PATCHSET} ]] && SRC_URI+=" https://dev.gentoo.org/~asturm/distfiles/${PATCHSET}"
107 +
108 +# Split modules following git/tarballs; Core MUST be first!
109 +# Help is used for the image generator
110 +# Only release has the tarballs
111 +if [[ ${MY_PV} != *9999* ]]; then
112 + for i in ${DEV_URI}; do
113 + SRC_URI+=" ${i}/${PN}-${MY_PV}.tar.xz"
114 + SRC_URI+=" ${i}/${PN}-help-${MY_PV}.tar.xz"
115 + done
116 + unset i
117 +fi
118 +unset DEV_URI
119 +
120 +# Really required addons
121 +# These are bundles that can't be removed for now due to huge patchsets.
122 +# If you want them gone, patches are welcome.
123 +ADDONS_SRC=(
124 + "java? ( ${ADDONS_URI}/17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip )"
125 + # no release for 8 years, should we package it?
126 + "libreoffice_extensions_wiki-publisher? ( ${ADDONS_URI}/a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip )"
127 + # Does not build with 1.6 rhino at all
128 + "libreoffice_extensions_scripting-javascript? ( ${ADDONS_URI}/798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip )"
129 + # requirement of rhino
130 + "libreoffice_extensions_scripting-javascript? ( ${ADDONS_URI}/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip )"
131 + # not packageable
132 + "odk? ( http://download.go-oo.org/extern/185d60944ea767075d27247c3162b3bc-unowinreg.dll )"
133 +)
134 +SRC_URI+=" ${ADDONS_SRC[*]}"
135 +
136 +unset ADDONS_URI
137 +unset ADDONS_SRC
138 +
139 +# Extensions that need extra work:
140 +LO_EXTS="nlpsolver scripting-beanshell scripting-javascript wiki-publisher"
141 +
142 +IUSE="bluetooth +branding coinmp +cups dbus debug eds firebird googledrive
143 +gstreamer +gtk gtk2 jemalloc kde libressl mysql odk pdfimport postgres test vlc
144 +$(printf 'libreoffice_extensions_%s ' ${LO_EXTS})"
145 +
146 +REQUIRED_USE="${PYTHON_REQUIRED_USE}
147 + bluetooth? ( dbus )
148 + kde? ( gtk )
149 + libreoffice_extensions_nlpsolver? ( java )
150 + libreoffice_extensions_scripting-beanshell? ( java )
151 + libreoffice_extensions_scripting-javascript? ( java )
152 + libreoffice_extensions_wiki-publisher? ( java )
153 +"
154 +
155 +LICENSE="|| ( LGPL-3 MPL-1.1 )"
156 +SLOT="0"
157 +[[ ${MY_PV} == *9999* ]] || \
158 +KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~amd64-linux ~x86-linux"
159 +
160 +COMMON_DEPEND="${PYTHON_DEPS}
161 + app-arch/unzip
162 + app-arch/zip
163 + app-crypt/gpgme[cxx]
164 + app-text/hunspell:=
165 + >=app-text/libabw-0.1.0
166 + >=app-text/libebook-0.1
167 + app-text/libepubgen
168 + >=app-text/libetonyek-0.1
169 + app-text/libexttextcat
170 + app-text/liblangtag
171 + >=app-text/libmspub-0.1.0
172 + >=app-text/libmwaw-0.3.1
173 + >=app-text/libodfgen-0.1.0
174 + app-text/libqxp
175 + app-text/libstaroffice
176 + app-text/libwpd:0.10[tools]
177 + app-text/libwpg:0.3
178 + >=app-text/libwps-0.4
179 + app-text/mythes
180 + >=dev-cpp/clucene-2.3.3.4-r2
181 + =dev-cpp/libcmis-0.5*
182 + dev-db/unixODBC
183 + dev-lang/perl
184 + dev-libs/boost:=[nls]
185 + dev-libs/expat
186 + dev-libs/hyphen
187 + dev-libs/icu:=
188 + dev-libs/libassuan
189 + dev-libs/libgpg-error
190 + >=dev-libs/liborcus-0.13.3
191 + dev-libs/librevenge
192 + dev-libs/nspr
193 + dev-libs/nss
194 + !libressl? ( >=dev-libs/openssl-1.0.0d:0 )
195 + libressl? ( dev-libs/libressl )
196 + >=dev-libs/redland-1.0.16
197 + >=dev-libs/xmlsec-1.2.24[nss]
198 + media-gfx/graphite2
199 + media-libs/fontconfig
200 + media-libs/freetype:2
201 + >=media-libs/harfbuzz-0.9.42:=[graphite,icu]
202 + media-libs/lcms:2
203 + >=media-libs/libcdr-0.1.0
204 + >=media-libs/libepoxy-1.3.1[X]
205 + >=media-libs/libfreehand-0.1.0
206 + media-libs/libpagemaker
207 + >=media-libs/libpng-1.4:0=
208 + >=media-libs/libvisio-0.1.0
209 + media-libs/libzmf
210 + net-libs/neon
211 + net-misc/curl
212 + net-nds/openldap
213 + sci-mathematics/lpsolve
214 + virtual/glu
215 + virtual/jpeg:0
216 + virtual/opengl
217 + x11-libs/cairo[X]
218 + x11-libs/libXinerama
219 + x11-libs/libXrandr
220 + x11-libs/libXrender
221 + bluetooth? ( net-wireless/bluez )
222 + coinmp? ( sci-libs/coinor-mp )
223 + cups? ( net-print/cups )
224 + dbus? ( dev-libs/dbus-glib )
225 + eds? (
226 + dev-libs/glib:2
227 + gnome-base/dconf
228 + gnome-extra/evolution-data-server
229 + )
230 + firebird? ( >=dev-db/firebird-3.0.2.32703.0-r1[server] )
231 + gstreamer? (
232 + media-libs/gstreamer:1.0
233 + media-libs/gst-plugins-base:1.0
234 + )
235 + gtk? (
236 + dev-libs/glib:2
237 + dev-libs/gobject-introspection
238 + gnome-base/dconf
239 + media-libs/mesa[egl]
240 + x11-libs/gtk+:3
241 + )
242 + gtk2? (
243 + x11-libs/gdk-pixbuf
244 + >=x11-libs/gtk+-2.24:2
245 + )
246 + jemalloc? ( dev-libs/jemalloc )
247 + kde? (
248 + dev-qt/qtcore:5
249 + dev-qt/qtgui:5
250 + dev-qt/qtx11extras:5
251 + dev-qt/qtwidgets:5
252 + kde-frameworks/kconfig:5
253 + kde-frameworks/kcoreaddons:5
254 + kde-frameworks/ki18n:5
255 + kde-frameworks/kio:5
256 + kde-frameworks/kwindowsystem:5
257 + )
258 + libreoffice_extensions_scripting-beanshell? ( dev-java/bsh )
259 + libreoffice_extensions_scripting-javascript? ( dev-java/rhino:1.6 )
260 + mysql? ( dev-db/mysql-connector-c++ )
261 + pdfimport? ( app-text/poppler:=[cxx] )
262 + postgres? ( >=dev-db/postgresql-9.0:*[kerberos] )
263 +"
264 +
265 +RDEPEND="${COMMON_DEPEND}
266 + !app-office/libreoffice-bin
267 + !app-office/libreoffice-bin-debug
268 + !app-office/openoffice
269 + media-fonts/dejavu
270 + media-fonts/liberation-fonts
271 + media-fonts/libertine
272 + || ( x11-misc/xdg-utils kde-plasma/kde-cli-tools )
273 + java? ( >=virtual/jre-1.6 )
274 + kde? ( kde-frameworks/breeze-icons:* )
275 + vlc? ( media-video/vlc )
276 +"
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 +# FIXME: cppunit should be moved to test conditional
287 +# after everything upstream is under gbuild
288 +# as dmake execute tests right away
289 +DEPEND="${COMMON_DEPEND}
290 + !<sys-devel/make-3.82
291 + >=dev-libs/libatomic_ops-7.2d
292 + >=dev-libs/libxml2-2.7.8
293 + dev-libs/libxslt
294 + dev-perl/Archive-Zip
295 + >=dev-util/cppunit-1.14.0
296 + >=dev-util/gperf-3
297 + dev-util/intltool
298 + >=dev-util/mdds-1.2.3:1=
299 + media-libs/glm
300 + sys-devel/bison
301 + sys-devel/flex
302 + sys-devel/gettext
303 + sys-devel/ucpp
304 + sys-libs/zlib
305 + virtual/pkgconfig
306 + x11-base/xorg-proto
307 + x11-libs/libXt
308 + x11-libs/libXtst
309 + java? (
310 + dev-java/ant-core
311 + >=virtual/jdk-1.6
312 + )
313 + odk? ( >=app-doc/doxygen-1.8.4 )
314 + test? (
315 + app-crypt/gnupg
316 + dev-util/cppunit
317 + media-fonts/dejavu
318 + )
319 +"
320 +
321 +PATCHES=(
322 + # not upstreamable stuff
323 + "${FILESDIR}/${PN}-5.4-system-pyuno.patch"
324 + "${FILESDIR}/${PN}-5.3.4.2-kioclient5.patch"
325 + "${FILESDIR}/${PN}-6.0.3.2-disable-flaky-tests-1.patch" #bug 656676
326 +
327 + # TODO: upstream
328 + "${FILESDIR}/${PN}-5.2.5.1-glibc-2.24.patch"
329 + "${FILESDIR}/${PN}-6.0.3.2-testTdf108947.patch" #bug 656600
330 +
331 + # 6.0 branch
332 + "${FILESDIR}/${P}-enable-gio-w-gtk3.patch" #bug 661062
333 +
334 + # gtk3-kde5 vcl plugin backported from master
335 + "${WORKDIR}"/${PATCHSET/.tar.xz/}
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 +}
348 +
349 +pkg_pretend() {
350 + use java || \
351 + ewarn "If you plan to use Base application you should enable java or you will get various crashes."
352 +
353 + if has_version "<app-office/libreoffice-5.3.0[firebird]"; then
354 + ewarn "Firebird has been upgraded to version 3. It is unable to read back Firebird 2.5 data, so"
355 + ewarn "embedded firebird odb files created in LibreOffice pre-5.3 can't be opened with this version."
356 + ewarn "See also: https://wiki.documentfoundation.org/ReleaseNotes/5.3#Base"
357 + fi
358 +
359 + if [[ ${MERGE_TYPE} != binary ]]; then
360 + _check_reqs
361 + check-reqs_pkg_pretend
362 + fi
363 +}
364 +
365 +pkg_setup() {
366 + java-pkg-opt-2_pkg_setup
367 + python-single-r1_pkg_setup
368 + xdg_environment_reset
369 +
370 + if [[ ${MERGE_TYPE} != binary ]]; then
371 + _check_reqs
372 + check-reqs_pkg_setup
373 + fi
374 +}
375 +
376 +src_unpack() {
377 + default
378 +
379 + if [[ ${MY_PV} = *9999* ]]; then
380 + local base_uri branch mypv
381 + base_uri="https://anongit.freedesktop.org/git"
382 + branch="master"
383 + mypv=${MY_PV/.9999}
384 + [[ ${mypv} != ${MY_PV} ]] && branch="${PN}-${mypv/./-}"
385 + git-r3_fetch "${base_uri}/${PN}/core" "refs/heads/${branch}"
386 + git-r3_checkout "${base_uri}/${PN}/core"
387 +
388 + git-r3_fetch "${base_uri}/${PN}/help" "refs/heads/master"
389 + git-r3_checkout "${base_uri}/${PN}/help" "helpcontent2" # doesn't match on help
390 + fi
391 +}
392 +
393 +src_prepare() {
394 + default
395 +
396 + # sandbox violations on many systems, we don't need it. Bug #646406
397 + sed -i \
398 + -e "/KF5_CONFIG/s/kf5-config/no/" \
399 + configure.ac || die "Failed to disable kf5-config"
400 +
401 + AT_M4DIR="m4" eautoreconf
402 + # hack in the autogen.sh
403 + touch autogen.lastrun
404 +
405 + # system pyuno mess
406 + sed -i \
407 + -e "s:%eprefix%:${EPREFIX}:g" \
408 + -e "s:%libdir%:$(get_libdir):g" \
409 + pyuno/source/module/uno.py \
410 + pyuno/source/officehelper.py || die
411 + # sed in the tests
412 + sed -i \
413 + -e "s#all : build unitcheck#all : build#g" \
414 + solenv/gbuild/Module.mk || die
415 + sed -i \
416 + -e "s#check: dev-install subsequentcheck#check: unitcheck slowcheck dev-install subsequentcheck#g" \
417 + -e "s#Makefile.gbuild all slowcheck#Makefile.gbuild all#g" \
418 + Makefile.in || die
419 +
420 + sed -i \
421 + -e "s,/usr/share/bash-completion/completions,$(get_bashcompdir)," \
422 + -e "s,\$INSTALLDIRNAME.sh,${PN}," \
423 + bin/distro-install-desktop-integration || die
424 +
425 + if use branding; then
426 + # hack...
427 + mv -v "${WORKDIR}/branding-intro.png" "icon-themes/galaxy/brand/intro.png" || die
428 + fi
429 +
430 + # Don't list pdfimport support in desktop when built with none, bug # 605464
431 + if ! use pdfimport; then
432 + sed -i \
433 + -e ":MimeType: s:application/pdf;::" \
434 + -e ":Keywords: s:pdf;::" \
435 + sysui/desktop/menus/draw.desktop || die
436 + fi
437 +}
438 +
439 +src_configure() {
440 + # Set up Google API keys, see https://www.chromium.org/developers/how-tos/api-keys
441 + # Note: these are for Gentoo use ONLY. For your own distribution, please get
442 + # your own set of keys. Feel free to contact chromium@g.o for more info.
443 + local google_default_client_id="329227923882.apps.googleusercontent.com"
444 + local google_default_client_secret="vgKG0NNv7GoDpbtoFNLxCUXu"
445 +
446 + # optimization flags
447 + export GMAKE_OPTIONS="${MAKEOPTS}"
448 + # System python enablement:
449 + export PYTHON_CFLAGS=$(python_get_CFLAGS)
450 + export PYTHON_LIBS=$(python_get_LIBS)
451 +
452 + if use kde; then
453 + export QT_SELECT=5 # bug 639620 needs proper fix though
454 + export QT5DIR="$(qt5_get_bindir)/../"
455 + export MOC5="$(qt5_get_bindir)/moc"
456 + fi
457 +
458 + # system headers/libs/...: enforce using system packages
459 + # --disable-breakpad: requires not-yet-in-tree dev-utils/breakpad
460 + # --enable-cairo: ensure that cairo is always required
461 + # --enable-*-link: link to the library rather than just dlopen on runtime
462 + # --enable-release-build: build the libreoffice as release
463 + # --disable-fetch-external: prevent dowloading during compile phase
464 + # --enable-extension-integration: enable any extension integration support
465 + # --without-{fonts,myspell-dicts,ppsd}: prevent install of sys pkgs
466 + # --disable-report-builder: too much java packages pulled in without pkgs
467 + # --without-system-sane: just sane.h header that is used for scan in writer,
468 + # not linked or anything else, worthless to depend on
469 + # --disable-pdfium: not yet packaged
470 + local myeconfargs=(
471 + --with-system-dicts
472 + --with-system-epoxy
473 + --with-system-headers
474 + --with-system-jars
475 + --with-system-libs
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-ccache
485 + --disable-dependency-tracking
486 + --disable-epm
487 + --disable-fetch-external
488 + --disable-gstreamer-0-10
489 + --disable-online-update
490 + --disable-pdfium
491 + --disable-report-builder
492 + --with-alloc=$(use jemalloc && echo "jemalloc" || echo "system")
493 + --with-build-version="Gentoo official package"
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-vendor="Gentoo Foundation"
503 + --with-x
504 + --without-fonts
505 + --without-myspell-dicts
506 + --without-help
507 + --with-helppack-integration
508 + --with-system-gpgmepp
509 + --without-system-sane
510 + $(use_enable bluetooth sdremote-bluetooth)
511 + $(use_enable coinmp)
512 + $(use_enable cups)
513 + $(use_enable dbus)
514 + $(use_enable debug)
515 + $(use_enable eds evolution2)
516 + $(use_enable firebird firebird-sdbc)
517 + $(use_enable gstreamer gstreamer-1-0)
518 + $(use_enable gtk gtk3)
519 + $(use_enable gtk2 gtk)
520 + $(use_enable kde gtk3-kde5)
521 + $(use_enable kde qt5)
522 + $(use_enable mysql ext-mariadb-connector)
523 + $(use_enable odk)
524 + $(use_enable pdfimport)
525 + $(use_enable postgres postgresql-sdbc)
526 + $(use_enable vlc)
527 + $(use_with coinmp system-coinmp)
528 + $(use_with googledrive gdrive-client-id ${google_default_client_id})
529 + $(use_with googledrive gdrive-client-secret ${google_default_client_secret})
530 + $(use_with java)
531 + $(use_with mysql system-mysql-cppconn)
532 + $(use_with odk doxygen)
533 + )
534 +
535 + if use eds || use gtk; then
536 + myeconfargs+=( --enable-dconf --enable-gio )
537 + else
538 + myeconfargs+=( --disable-dconf --disable-gio )
539 + fi
540 +
541 + # libreoffice extensions handling
542 + for lo_xt in ${LO_EXTS}; do
543 + if [[ "${lo_xt}" == "scripting-beanshell" || "${lo_xt}" == "scripting-javascript" ]]; then
544 + myeconfargs+=( $(use_enable libreoffice_extensions_${lo_xt} ${lo_xt}) )
545 + else
546 + myeconfargs+=( $(use_enable libreoffice_extensions_${lo_xt} ext-${lo_xt}) )
547 + fi
548 + done
549 +
550 + if use java; then
551 + # hsqldb: system one is too new
552 + myeconfargs+=(
553 + --without-junit
554 + --without-system-hsqldb
555 + --with-ant-home="${ANT_HOME}"
556 + --with-jdk-home=$(java-config --jdk-home 2>/dev/null)
557 + --with-jvm-path="${EPREFIX}/usr/lib/"
558 + )
559 +
560 + use libreoffice_extensions_scripting-beanshell && \
561 + myeconfargs+=( --with-beanshell-jar=$(java-pkg_getjar bsh bsh.jar) )
562 +
563 + use libreoffice_extensions_scripting-javascript && \
564 + myeconfargs+=( --with-rhino-jar=$(java-pkg_getjar rhino-1.6 js.jar) )
565 + fi
566 +
567 + is-flagq "-flto*" && myeconfargs+=( --enable-lto )
568 +
569 + econf "${myeconfargs[@]}"
570 +}
571 +
572 +src_compile() {
573 + # more and more LO stuff tries to use OpenGL, including tests during build
574 + # bug 501508, bug 540624, bug 545974 and probably more
575 + addpredict /dev/dri
576 + addpredict /dev/ati
577 + addpredict /dev/nvidiactl
578 +
579 + # hack for offlinehelp, this needs fixing upstream at some point
580 + # it is broken because we send --without-help
581 + # https://bugs.freedesktop.org/show_bug.cgi?id=46506
582 + (
583 + grep "^export" "${S}/config_host.mk" > "${T}/config_host.mk" || die
584 + source "${T}/config_host.mk" 2&> /dev/null
585 +
586 + local path="${WORKDIR}/helpcontent2/source/auxiliary/"
587 + mkdir -p "${path}" || die
588 +
589 + echo "perl \"${S}/helpcontent2/helpers/create_ilst.pl\" -dir=helpcontent2/source/media/helpimg > \"${path}/helpimg.ilst\""
590 + perl "${S}/helpcontent2/helpers/create_ilst.pl" \
591 + -dir=helpcontent2/source/media/helpimg \
592 + > "${path}/helpimg.ilst"
593 + [[ -s "${path}/helpimg.ilst" ]] || \
594 + ewarn "The help images list is empty, something is fishy, report a bug."
595 + )
596 +
597 + local target
598 + use test && target="build" || target="build-nocheck"
599 +
600 + # this is not a proper make script
601 + make ${target} || die
602 +}
603 +
604 +src_test() {
605 + make unitcheck || die
606 + make slowcheck || die
607 +}
608 +
609 +src_install() {
610 + # This is not Makefile so no buildserver
611 + make DESTDIR="${D}" distro-pack-install -o build -o check || die
612 +
613 + # bug 593514
614 + if use gtk; then
615 + dosym libreoffice/program/liblibreofficekitgtk.so \
616 + /usr/$(get_libdir)/liblibreofficekitgtk.so
617 + fi
618 +
619 + # bash completion aliases
620 + bashcomp_alias \
621 + libreoffice \
622 + unopkg loimpress lobase localc lodraw lomath lowriter lofromtemplate loweb loffice
623 +
624 + if use branding; then
625 + insinto /usr/$(get_libdir)/${PN}/program
626 + newins "${WORKDIR}/branding-sofficerc" sofficerc
627 + dodir /etc/env.d
628 + echo "CONFIG_PROTECT=/usr/$(get_libdir)/${PN}/program/sofficerc" > "${ED}"etc/env.d/99${PN} || die
629 + fi
630 +
631 + # Hack for offlinehelp, this needs fixing upstream at some point.
632 + # It is broken because we send --without-help
633 + # https://bugs.freedesktop.org/show_bug.cgi?id=46506
634 + insinto /usr/$(get_libdir)/libreoffice/help
635 + doins xmlhelp/util/*.xsl
636 +
637 + pax-mark -m "${ED}"usr/$(get_libdir)/libreoffice/program/soffice.bin
638 + pax-mark -m "${ED}"usr/$(get_libdir)/libreoffice/program/unopkg.bin
639 +}
640 +
641 +pkg_postinst() {
642 + gnome2_icon_cache_update
643 + xdg_desktop_database_update
644 + xdg_mimeinfo_database_update
645 +}
646 +
647 +pkg_postrm() {
648 + gnome2_icon_cache_update
649 + xdg_desktop_database_update
650 + xdg_mimeinfo_database_update
651 +}