Use https by default
[gentoo.git] / app-office / libreoffice / libreoffice-9999.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 KDE_REQUIRED="optional"
8 QT_MINIMAL="4.7.4"
9 KDE_SCM="git"
10 CMAKE_REQUIRED="never"
11
12 PYTHON_COMPAT=( python2_7 python3_3 python3_4 )
13 PYTHON_REQ_USE="threads,xml"
14
15 # experimental ; release ; old
16 # Usually the tarballs are moved a lot so this should make
17 # everyone happy.
18 DEV_URI="
19         http://dev-builds.libreoffice.org/pre-releases/src
20         http://download.documentfoundation.org/libreoffice/src/${PV:0:5}/
21         http://download.documentfoundation.org/libreoffice/old/${PV}/
22 "
23 EXT_URI="http://ooo.itc.hu/oxygenoffice/download/libreoffice"
24 ADDONS_URI="http://dev-www.libreoffice.org/src/"
25
26 BRANDING="${PN}-branding-gentoo-0.8.tar.xz"
27 # PATCHSET="${P}-patchset-01.tar.xz"
28
29 [[ ${PV} == *9999* ]] && SCM_ECLASS="git-r3"
30 inherit base multiprocessing autotools bash-completion-r1 check-reqs eutils java-pkg-opt-2 kde4-base pax-utils python-single-r1 multilib toolchain-funcs flag-o-matic versionator ${SCM_ECLASS}
31 unset SCM_ECLASS
32
33 DESCRIPTION="LibreOffice, a full office productivity suite"
34 HOMEPAGE="http://www.libreoffice.org"
35 SRC_URI="branding? ( https://dev.gentoo.org/~dilfridge/distfiles/${BRANDING} )"
36 [[ -n ${PATCHSET} ]] && SRC_URI+=" http://dev.gentooexperimental.org/~scarabeus/${PATCHSET}"
37
38 # Split modules following git/tarballs
39 # Core MUST be first!
40 # Help is used for the image generator
41 MODULES="core help"
42 # Only release has the tarballs
43 if [[ ${PV} != *9999* ]]; then
44         for i in ${DEV_URI}; do
45                 for mod in ${MODULES}; do
46                         if [[ ${mod} == core ]]; then
47                                 SRC_URI+=" ${i}/${P}.tar.xz"
48                         else
49                                 SRC_URI+=" ${i}/${PN}-${mod}-${PV}.tar.xz"
50                         fi
51                 done
52                 unset mod
53         done
54         unset i
55 fi
56 unset DEV_URI
57
58 # Really required addons
59 # These are bundles that can't be removed for now due to huge patchsets.
60 # If you want them gone, patches are welcome.
61 ADDONS_SRC+=" ${ADDONS_URI}/d62650a6f908e85643e557a236ea989c-vigra1.6.0.tar.gz"
62 ADDONS_SRC+=" ${ADDONS_URI}/1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz" # modifies source code
63 ADDONS_SRC+=" collada? ( ${ADDONS_URI}/4b87018f7fff1d054939d19920b751a0-collada2gltf-master-cb1d97788a.tar.bz2 )"
64 ADDONS_SRC+=" java? ( ${ADDONS_URI}/17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip )"
65 ADDONS_SRC+=" libreoffice_extensions_wiki-publisher? ( ${ADDONS_URI}/a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip )" # no release for 8 years, should we package it?
66 ADDONS_SRC+=" libreoffice_extensions_scripting-javascript? ( ${ADDONS_URI}/798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip )" # Does not build with 1.6 rhino at all
67 ADDONS_SRC+=" libreoffice_extensions_scripting-javascript? ( ${ADDONS_URI}/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip )" # requirement of rhino
68 ADDONS_SRC+=" odk? ( http://download.go-oo.org/extern/185d60944ea767075d27247c3162b3bc-unowinreg.dll )" # not packageable
69 SRC_URI+=" ${ADDONS_SRC}"
70
71 unset ADDONS_URI
72 unset EXT_URI
73 unset ADDONS_SRC
74
75 IUSE="bluetooth +branding coinmp collada +cups dbus debug eds firebird gltf gnome gstreamer
76 +gtk gtk3 jemalloc kde mysql odk postgres telepathy test vlc"
77
78 LO_EXTS="nlpsolver scripting-beanshell scripting-javascript wiki-publisher"
79 # Unpackaged separate extensions:
80 # diagram: lo has 0.9.5 upstream is weirdly patched 0.9.4 -> wtf?
81 # hunart: only on ooo extensions -> fubared download path somewhere on sf
82 # numbertext, typo, validator, watch-window: ^^
83 # oooblogger: no homepage or anything
84 # Extensions that need extra work:
85 for lo_xt in ${LO_EXTS}; do
86         IUSE+=" libreoffice_extensions_${lo_xt}"
87 done
88 unset lo_xt
89
90 LICENSE="|| ( LGPL-3 MPL-1.1 )"
91 SLOT="0"
92 [[ ${PV} == *9999* ]] || \
93 KEYWORDS="~amd64 ~arm ~x86 ~amd64-linux ~x86-linux"
94
95 COMMON_DEPEND="
96         ${PYTHON_DEPS}
97         app-arch/zip
98         app-arch/unzip
99         >=app-text/hunspell-1.3.2-r3
100         app-text/mythes
101         >=app-text/libabw-0.1.0
102         >=app-text/libexttextcat-3.4.4
103         >=app-text/libebook-0.1.1
104         >=app-text/libetonyek-0.1.2
105         app-text/liblangtag
106         >=app-text/libmspub-0.1.0
107         >=app-text/libmwaw-0.3.5
108         >=app-text/libodfgen-0.1.0
109         app-text/libwpd:0.10[tools]
110         app-text/libwpg:0.3
111         =app-text/libwps-0.4*
112         >=app-text/poppler-0.16:=[xpdf-headers(+),cxx]
113         >=dev-cpp/clucene-2.3.3.4-r2
114         =dev-cpp/libcmis-0.5*
115         dev-db/unixODBC
116         >=dev-libs/boost-1.55:=
117         dev-libs/expat
118         >=dev-libs/hyphen-2.7.1
119         >=dev-libs/icu-4.8.1.1:=
120         >=dev-libs/liborcus-0.9.0
121         >=dev-libs/librevenge-0.0.1
122         >=dev-libs/nspr-4.8.8
123         >=dev-libs/nss-3.12.9
124         >=dev-lang/perl-5.0
125         >=dev-libs/openssl-1.0.0d:0
126         >=dev-libs/redland-1.0.16
127         media-gfx/graphite2
128         >=media-libs/fontconfig-2.8.0
129         media-libs/freetype:2
130         >=media-libs/glew-1.10
131         >=media-libs/harfbuzz-0.9.18:=[icu(+)]
132         media-libs/lcms:2
133         >=media-libs/libpng-1.4:0=
134         >=media-libs/libcdr-0.1.0
135         >=media-libs/libfreehand-0.1.0
136         media-libs/libpagemaker
137         >=media-libs/libvisio-0.1.0
138         >=net-misc/curl-7.21.4
139         net-libs/neon
140         net-nds/openldap
141         sci-mathematics/lpsolve
142         virtual/jpeg:0
143         >=x11-libs/cairo-1.10.0[X]
144         x11-libs/libXinerama
145         x11-libs/libXrandr
146         x11-libs/libXrender
147         virtual/glu
148         virtual/opengl
149         bluetooth? ( net-wireless/bluez )
150         coinmp? ( sci-libs/coinor-mp )
151         collada? ( >=media-libs/opencollada-1.2.2_p20150207 )
152         cups? ( net-print/cups )
153         dbus? ( >=dev-libs/dbus-glib-0.92 )
154         eds? ( gnome-extra/evolution-data-server )
155         firebird? ( >=dev-db/firebird-2.5 )
156         gltf? ( media-libs/libgltf )
157         gnome? ( gnome-base/gconf:2 )
158         gtk? (
159                 x11-libs/gdk-pixbuf[X]
160                 >=x11-libs/gtk+-2.24:2
161         )
162         gtk3? (
163                 dev-libs/glib:2
164                 >=x11-libs/gtk+-3.2:3
165         )
166         gstreamer? (
167                 media-libs/gstreamer:1.0
168                 media-libs/gst-plugins-base:1.0
169         )
170         jemalloc? ( dev-libs/jemalloc )
171         libreoffice_extensions_scripting-beanshell? ( >=dev-java/bsh-2.0_beta4 )
172         libreoffice_extensions_scripting-javascript? ( dev-java/rhino:1.6 )
173         libreoffice_extensions_wiki-publisher? (
174                 dev-java/commons-codec:0
175                 dev-java/commons-httpclient:3
176                 dev-java/commons-lang:2.1
177                 dev-java/commons-logging:0
178                 dev-java/tomcat-servlet-api:3.0
179         )
180         mysql? ( >=dev-db/mysql-connector-c++-1.1.0 )
181         postgres? ( >=dev-db/postgresql-9.0:*[kerberos] )
182         telepathy? (
183                 dev-libs/glib:2
184                 >=net-libs/telepathy-glib-0.18.0
185                 >=x11-libs/gtk+-2.24:2
186         )
187 "
188
189 RDEPEND="${COMMON_DEPEND}
190         !app-office/libreoffice-bin
191         !app-office/libreoffice-bin-debug
192         !<app-office/openoffice-bin-3.4.0-r1
193         !app-office/openoffice
194         media-fonts/libertine
195         media-fonts/liberation-fonts
196         media-fonts/urw-fonts
197         java? ( >=virtual/jre-1.6 )
198         kde? ( $(add_kdeapps_dep kioclient) )
199         vlc? ( media-video/vlc )
200 "
201
202 if [[ ${PV} != *9999* ]]; then
203         PDEPEND="=app-office/libreoffice-l10n-$(get_version_component_range 1-2)*"
204 else
205         # Translations are not reliable on live ebuilds
206         # rather force people to use english only.
207         PDEPEND="!app-office/libreoffice-l10n"
208 fi
209
210 # FIXME: cppunit should be moved to test conditional
211 #        after everything upstream is under gbuild
212 #        as dmake execute tests right away
213 DEPEND="${COMMON_DEPEND}
214         >=dev-libs/libatomic_ops-7.2d
215         >=dev-libs/libxml2-2.7.8
216         dev-libs/libxslt
217         dev-perl/Archive-Zip
218         dev-util/cppunit
219         >=dev-util/gperf-3
220         dev-util/intltool
221         >=dev-util/mdds-0.12.0:=
222         media-libs/glm
223         net-misc/npapi-sdk
224         >=sys-apps/findutils-4.4.2
225         sys-devel/bison
226         sys-apps/coreutils
227         sys-devel/flex
228         sys-devel/gettext
229         >=sys-devel/make-3.82
230         sys-devel/ucpp
231         sys-libs/zlib
232         virtual/pkgconfig
233         x11-libs/libXt
234         x11-libs/libXtst
235         x11-proto/randrproto
236         x11-proto/xextproto
237         x11-proto/xineramaproto
238         x11-proto/xproto
239         java? (
240                 >=virtual/jdk-1.6
241                 >=dev-java/ant-core-1.7
242         )
243         odk? ( >=app-doc/doxygen-1.8.4 )
244         test? ( dev-util/cppunit )
245 "
246
247 PATCHES=(
248         # not upstreamable stuff
249         "${FILESDIR}/${PN}-4.4-system-pyuno.patch"
250 )
251
252 REQUIRED_USE="
253         ${PYTHON_REQUIRED_USE}
254         bluetooth? ( dbus )
255         collada? ( gltf )
256         gnome? ( gtk )
257         eds? ( gnome )
258         telepathy? ( gtk )
259         libreoffice_extensions_nlpsolver? ( java )
260         libreoffice_extensions_scripting-beanshell? ( java )
261         libreoffice_extensions_scripting-javascript? ( java )
262         libreoffice_extensions_wiki-publisher? ( java )
263 "
264
265 CHECKREQS_MEMORY="512M"
266 CHECKREQS_DISK_BUILD="6G"
267
268 pkg_pretend() {
269         local pgslot
270
271         if [[ ${MERGE_TYPE} != binary ]]; then
272                 check-reqs_pkg_pretend
273
274                 if [[ $(gcc-major-version) -lt 4 ]] || \
275                                  ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 6 ]] ) \
276                                 ; then
277                         eerror "Compilation with gcc older than 4.6 is not supported"
278                         die "Too old gcc found."
279                 fi
280         fi
281
282         # Ensure pg version but we have to be sure the pg is installed (first
283         # install on clean system)
284         if use postgres && has_version dev-db/postgresql; then
285                  pgslot=$(postgresql-config show)
286                  if [[ ${pgslot//.} < 90 ]] ; then
287                         eerror "PostgreSQL slot must be set to 9.0 or higher."
288                         eerror "    postgresql-config set 9.0"
289                         die "PostgreSQL slot is not set to 9.0 or higher."
290                  fi
291         fi
292 }
293
294 pkg_setup() {
295         java-pkg-opt-2_pkg_setup
296         kde4-base_pkg_setup
297         python-single-r1_pkg_setup
298
299         [[ ${MERGE_TYPE} != binary ]] && check-reqs_pkg_setup
300 }
301
302 src_unpack() {
303         local mod mod2 dest tmplfile tmplname mypv
304
305         [[ -n ${PATCHSET} ]] && unpack ${PATCHSET}
306         use branding && unpack "${BRANDING}"
307
308         if [[ ${PV} != *9999* ]]; then
309                 unpack "${P}.tar.xz"
310                 for mod in ${MODULES}; do
311                         [[ ${mod} == core ]] && continue
312                         unpack "${PN}-${mod}-${PV}.tar.xz"
313                 done
314         else
315                 for mod in ${MODULES}; do
316                         mypv=${PV/.9999}
317                         [[ ${mypv} != ${PV} ]] && EGIT_BRANCH="${PN}-${mypv/./-}"
318                         EGIT_CHECKOUT_DIR="${WORKDIR}/${P}"
319                         [[ ${mod} != core ]] && EGIT_CHECKOUT_DIR="${WORKDIR}/${PN}-${mod}-${PV}"
320                         EGIT_REPO_URI="git://anongit.freedesktop.org/${PN}/${mod}"
321                         git-r3_src_unpack
322                         if [[ ${mod} != core ]]; then
323                                 mod2=${mod}
324                                 # mapping does not match on help
325                                 [[ ${mod} == help ]] && mod2="helpcontent2"
326                                 mkdir -p "${S}/${mod2}/" || die
327                                 mv -n "${WORKDIR}/${PN}-${mod}-${PV}"/* "${S}/${mod2}" || die
328                                 rm -rf "${WORKDIR}/${PN}-${mod}-${PV}"
329                         fi
330                 done
331                 unset EGIT_CHECKOUT_DIR EGIT_REPO_URI EGIT_BRANCH
332         fi
333 }
334
335 src_prepare() {
336         # optimization flags
337         export GMAKE_OPTIONS="${MAKEOPTS}"
338         # System python 2.7 enablement:
339         export PYTHON_CFLAGS=$(python_get_CFLAGS)
340         export PYTHON_LIBS=$(python_get_LIBS)
341
342         if use collada; then
343                 export OPENCOLLADA_CFLAGS="-I/usr/include/opencollada/COLLADABaseUtils -I/usr/include/opencollada/COLLADAFramework -I/usr/include/opencollada/COLLADASaxFrameworkLoader -I/usr/include/opencollada/GeneratedSaxParser"
344                 export OPENCOLLADA_LIBS="-L /usr/$(get_libdir)/opencollada -lOpenCOLLADABaseUtils -lOpenCOLLADAFramework -lOpenCOLLADASaxFrameworkLoader -lGeneratedSaxParser"
345         fi
346
347         # patchset
348         if [[ -n ${PATCHSET} ]]; then
349                 EPATCH_FORCE="yes" \
350                 EPATCH_SOURCE="${WORKDIR}/${PATCHSET/.tar.xz/}" \
351                 EPATCH_SUFFIX="patch" \
352                 epatch
353         fi
354
355         base_src_prepare
356
357         AT_M4DIR="m4" eautoreconf
358         # hack in the autogen.sh
359         touch autogen.lastrun
360
361         # system pyuno mess
362         sed \
363                 -e "s:%eprefix%:${EPREFIX}:g" \
364                 -e "s:%libdir%:$(get_libdir):g" \
365                 -i pyuno/source/module/uno.py \
366                 -i pyuno/source/officehelper.py || die
367         # sed in the tests
368         sed -i \
369                 -e 's#all : build unitcheck#all : build#g' \
370                 solenv/gbuild/Module.mk || die
371         sed -i \
372                 -e 's#check: dev-install subsequentcheck#check: unitcheck slowcheck dev-install subsequentcheck#g' \
373                 -e 's#Makefile.gbuild all slowcheck#Makefile.gbuild all#g' \
374                 Makefile.in || die
375
376         if use branding; then
377                 # hack...
378                 mv -v "${WORKDIR}/branding-intro.png" "${S}/icon-themes/galaxy/brand/intro.png" || die
379         fi
380 }
381
382 src_configure() {
383         local java_opts
384         local internal_libs
385         local lo_ext
386         local ext_opts
387
388         # sane: just sane.h header that is used for scan in writer, not
389         #       linked or anything else, worthless to depend on
390         # vigra: just uses templates from there
391         #        it is serious pain in the ass for packaging
392         #        should be replaced by boost::gil if someone interested
393         internal_libs+="
394                 --without-system-sane
395                 --without-system-vigra
396         "
397
398         # libreoffice extensions handling
399         for lo_xt in ${LO_EXTS}; do
400                 if [[ "${lo_xt}" == "scripting-beanshell" || "${lo_xt}" == "scripting-javascript" ]]; then
401                         ext_opts+=" $(use_enable libreoffice_extensions_${lo_xt} ${lo_xt})"
402                 else
403                         ext_opts+=" $(use_enable libreoffice_extensions_${lo_xt} ext-${lo_xt})"
404                 fi
405         done
406
407         if use java; then
408                 # hsqldb: system one is too new
409                 java_opts="
410                         --without-junit
411                         --without-system-hsqldb
412                         --with-ant-home="${ANT_HOME}"
413                         --with-jdk-home=$(java-config --jdk-home 2>/dev/null)
414                         --with-jvm-path="${EPREFIX}/usr/lib/"
415                 "
416
417                 use libreoffice_extensions_scripting-beanshell && \
418                         java_opts+=" --with-beanshell-jar=$(java-pkg_getjar bsh bsh.jar)"
419
420                 use libreoffice_extensions_scripting-javascript && \
421                         java_opts+=" --with-rhino-jar=$(java-pkg_getjar rhino-1.6 js.jar)"
422
423                 if use libreoffice_extensions_wiki-publisher; then
424                         java_opts+="
425                                 --with-commons-codec-jar=$(java-pkg_getjar commons-codec commons-codec.jar)
426                                 --with-commons-httpclient-jar=$(java-pkg_getjar commons-httpclient-3 commons-httpclient.jar)
427                                 --with-commons-lang-jar=$(java-pkg_getjar commons-lang-2.1 commons-lang.jar)
428                                 --with-commons-logging-jar=$(java-pkg_getjar commons-logging commons-logging.jar)
429                                 --with-servlet-api-jar=$(java-pkg_getjar tomcat-servlet-api-3.0 servlet-api.jar)
430                         "
431                 fi
432         fi
433
434         # system headers/libs/...: enforce using system packages
435         # --enable-cairo: ensure that cairo is always required
436         # --enable-graphite: disabling causes build breakages
437         # --enable-*-link: link to the library rather than just dlopen on runtime
438         # --enable-release-build: build the libreoffice as release
439         # --disable-fetch-external: prevent dowloading during compile phase
440         # --disable-gnome-vfs: old gnome virtual fs support
441         # --disable-kdeab: kde3 adressbook
442         # --disable-kde: kde3 support
443         # --disable-systray: quickstarter does not actually work at all so do not
444         #   promote it
445         # --enable-extension-integration: enable any extension integration support
446         # --without-{fonts,myspell-dicts,ppsd}: prevent install of sys pkgs
447         # --disable-report-builder: too much java packages pulled in without pkgs
448         econf \
449                 --docdir="${EPREFIX}/usr/share/doc/${PF}/" \
450                 --with-system-headers \
451                 --with-system-libs \
452                 --with-system-jars \
453                 --with-system-dicts \
454                 --enable-cairo-canvas \
455                 --enable-graphite \
456                 --enable-largefile \
457                 --enable-mergelibs \
458                 --enable-neon \
459                 --enable-python=system \
460                 --enable-randr \
461                 --enable-randr-link \
462                 --enable-release-build \
463                 --disable-hardlink-deliver \
464                 --disable-ccache \
465                 --disable-crashdump \
466                 --disable-dependency-tracking \
467                 --disable-epm \
468                 --disable-fetch-external \
469                 --disable-gnome-vfs \
470                 --disable-gstreamer-0-10 \
471                 --disable-report-builder \
472                 --disable-kdeab \
473                 --disable-kde \
474                 --disable-online-update \
475                 --disable-systray \
476                 --with-alloc=$(use jemalloc && echo "jemalloc" || echo "system") \
477                 --with-build-version="Gentoo official package" \
478                 --enable-extension-integration \
479                 --with-external-dict-dir="${EPREFIX}/usr/share/myspell" \
480                 --with-external-hyph-dir="${EPREFIX}/usr/share/myspell" \
481                 --with-external-thes-dir="${EPREFIX}/usr/share/myspell" \
482                 --with-external-tar="${DISTDIR}" \
483                 --with-lang="" \
484                 --with-parallelism=$(makeopts_jobs) \
485                 --with-system-ucpp \
486                 --with-vendor="Gentoo Foundation" \
487                 --with-x \
488                 --without-fonts \
489                 --without-myspell-dicts \
490                 --without-help \
491                 --with-helppack-integration \
492                 --without-sun-templates \
493                 $(use_enable bluetooth sdremote-bluetooth) \
494                 $(use_enable coinmp) \
495                 $(use_enable collada) \
496                 $(use_enable cups) \
497                 $(use_enable debug) \
498                 $(use_enable dbus) \
499                 $(use_enable eds evolution2) \
500                 $(use_enable firebird firebird-sdbc) \
501                 $(use_enable gltf) \
502                 $(use_enable gnome gconf) \
503                 $(use_enable gnome gio) \
504                 $(use_enable gnome lockdown) \
505                 $(use_enable gstreamer gstreamer-1-0) \
506                 $(use_enable gtk) \
507                 $(use_enable gtk3) \
508                 $(use_enable kde kde4) \
509                 $(use_enable mysql ext-mariadb-connector) \
510                 $(use_enable odk) \
511                 $(use_enable postgres postgresql-sdbc) \
512                 $(use_enable telepathy) \
513                 $(use_enable vlc) \
514                 $(use_with coinmp system-coinmp) \
515                 $(use_with collada system-opencollada) \
516                 $(use_with gltf system-libgltf) \
517                 $(use_with java) \
518                 $(use_with mysql system-mysql-cppconn) \
519                 $(use_with odk doxygen) \
520                 ${internal_libs} \
521                 ${java_opts} \
522                 ${ext_opts}
523 }
524
525 src_compile() {
526         # more and more LO stuff tries to use OpenGL, including tests during build
527         # bug 501508, bug 540624, bug 545974 and probably more
528         addpredict /dev/dri
529         addpredict /dev/ati
530         addpredict /dev/nvidiactl
531
532         # hack for offlinehelp, this needs fixing upstream at some point
533         # it is broken because we send --without-help
534         # https://bugs.freedesktop.org/show_bug.cgi?id=46506
535         (
536                 grep "^export" "${S}/config_host.mk" > "${T}/config_host.mk"
537                 source "${T}/config_host.mk" 2&> /dev/null
538
539                 local path="${WORKDIR}/helpcontent2/source/auxiliary/"
540                 mkdir -p "${path}" || die
541
542                 echo "perl \"${S}/helpcontent2/helpers/create_ilst.pl\" -dir=icon-themes/galaxy/res/helpimg > \"${path}/helpimg.ilst\""
543                 perl "${S}/helpcontent2/helpers/create_ilst.pl" \
544                         -dir=icon-themes/galaxy/res/helpimg \
545                         > "${path}/helpimg.ilst"
546                 [[ -s "${path}/helpimg.ilst" ]] || ewarn "The help images list is empty, something is fishy, report a bug."
547         )
548
549         local target
550         use test && target="build" || target="build-nocheck"
551
552         # this is not a proper make script
553         make ${target} || die
554 }
555
556 src_test() {
557         make unitcheck || die
558         make slowcheck || die
559 }
560
561 src_install() {
562         # This is not Makefile so no buildserver
563         make DESTDIR="${D}" distro-pack-install -o build -o check || die
564
565         # Fix bash completion placement
566         newbashcomp "${ED}"/etc/bash_completion.d/libreoffice.sh ${PN}
567         bashcomp_alias \
568                 libreoffice \
569                 unopkg loimpress lobase localc lodraw lomath lowriter lofromtemplate loweb loffice
570         rm -rf "${ED}"/etc/ || die
571
572         if use branding; then
573                 insinto /usr/$(get_libdir)/${PN}/program
574                 newins "${WORKDIR}/branding-sofficerc" sofficerc
575                 dodir /etc/env.d
576                 echo "CONFIG_PROTECT=/usr/$(get_libdir)/${PN}/program/sofficerc" > "${ED}"/etc/env.d/99${PN}
577         fi
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         insinto /usr/$(get_libdir)/libreoffice/help
583         doins xmlhelp/util/*.xsl
584
585         # Remove desktop files for support to old installs that can't parse mime
586         rm -rf "${ED}"/usr/share/mimelnk/
587
588         # FIXME: Hack add missing file
589         insinto /usr/$(get_libdir)/${PN}/program
590         doins "${S}"/instdir/program/libsaxlo.so
591
592         pax-mark -m "${ED}"/usr/$(get_libdir)/libreoffice/program/soffice.bin
593         pax-mark -m "${ED}"/usr/$(get_libdir)/libreoffice/program/unopkg.bin
594 }
595
596 pkg_preinst() {
597         # Cache updates - all handled by kde eclass for all environments
598         kde4-base_pkg_preinst
599 }
600
601 pkg_postinst() {
602         kde4-base_pkg_postinst
603
604         use java || \
605                 ewarn 'If you plan to use lbase application you should enable java or you will get various crashes.'
606 }
607
608 pkg_postrm() {
609         kde4-base_pkg_postrm
610 }