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