/[gentoo-x86]/app-office/libreoffice/libreoffice-3.5.7.2.ebuild
Gentoo

Contents of /app-office/libreoffice/libreoffice-3.5.7.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Wed Nov 7 21:10:10 2012 UTC (2 years, 1 month ago) by tetromino
Branch: MAIN
Changes since 1.1: +3 -3 lines
Slot gstreamer dependencies in preparation for gstreamer-1.0.

(Portage version: 2.2.0_alpha142/cvs/Linux x86_64, signed Manifest commit with key CF0ADD61)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-office/libreoffice/libreoffice-3.5.7.2.ebuild,v 1.1 2012/11/02 12:22:25 scarabeus Exp $
4
5 EAPI=4
6
7 KDE_REQUIRED="optional"
8 QT_MINIMAL="4.7.4"
9 KDE_SCM="git"
10 CMAKE_REQUIRED="never"
11
12 PYTHON_DEPEND="2"
13 PYTHON_USE_WITH="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/3.5.7/
21 http://download.documentfoundation.org/libreoffice/old/src
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.5.tar.xz"
27 # PATCHSET="${P}-patchset-01.tar.xz"
28
29 [[ ${PV} == *9999* ]] && SCM_ECLASS="git-2"
30 inherit base autotools bash-completion-r1 check-reqs eutils java-pkg-opt-2 kde4-base pax-utils python multilib toolchain-funcs flag-o-matic nsplugins ${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? ( http://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 MODULES="core binfilter help"
41 # Only release has the tarballs
42 if [[ ${PV} != *9999* ]]; then
43 for i in ${DEV_URI}; do
44 for mod in ${MODULES}; do
45 if [[ ${mod} == binfilter ]]; then
46 SRC_URI+=" binfilter? ( ${i}/${PN}-${mod}-${PV}.tar.xz )"
47 else
48 SRC_URI+=" ${i}/${PN}-${mod}-${PV}.tar.xz"
49 fi
50 done
51 unset mod
52 done
53 unset i
54 fi
55 unset DEV_URI
56
57 # Really required addons
58 # These are bundles that can't be removed for now due to huge patchsets.
59 # If you want them gone, patches are welcome.
60 ADDONS_SRC+=" ${ADDONS_URI}/ea91f2fb4212a21d708aced277e6e85a-vigra1.4.0.tar.gz"
61 ADDONS_SRC+=" xmlsec? ( ${ADDONS_URI}/1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz )"
62 ADDONS_SRC+=" java? ( ${ADDONS_URI}/17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip )"
63 ADDONS_SRC+=" java? ( ${ADDONS_URI}/798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip )"
64 ADDONS_SRC+=" java? ( ${ADDONS_URI}/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip )"
65 ADDONS_SRC+=" java? ( ${ADDONS_URI}/ada24d37d8d638b3d8a9985e80bc2978-source-9.0.0.7-bj.zip )"
66 ADDONS_SRC+=" odk? ( http://download.go-oo.org/extern/185d60944ea767075d27247c3162b3bc-unowinreg.dll )"
67 SRC_URI+=" ${ADDONS_SRC}"
68
69 unset ADDONS_URI
70 unset EXT_URI
71 unset ADDONS_SRC
72
73 IUSE="binfilter binfilterdebug +branding +cups dbus eds gnome +graphite gstreamer +gtk
74 jemalloc kde mysql nlpsolver +nsplugin odk opengl pdfimport postgres svg test
75 +vba +webdav +xmlsec"
76 LICENSE="LGPL-3"
77 SLOT="0"
78 [[ ${PV} == *9999* ]] || KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux"
79
80 NSS_DEPEND="
81 >=dev-libs/nspr-4.8.8
82 >=dev-libs/nss-3.12.9
83 "
84
85 COMMON_DEPEND="
86 app-arch/zip
87 app-arch/unzip
88 >=app-text/hunspell-1.3.2-r3
89 app-text/mythes
90 >=app-text/libexttextcat-3.2
91 app-text/libwpd:0.9[tools]
92 app-text/libwpg:0.2
93 >=app-text/libwps-0.2.2
94 <dev-cpp/libcmis-0.2
95 dev-db/unixODBC
96 dev-libs/expat
97 >=dev-libs/glib-2.28
98 >=dev-libs/hyphen-2.7.1
99 >=dev-libs/icu-49
100 >=dev-lang/perl-5.0
101 >=dev-libs/openssl-1.0.0d
102 >=dev-libs/redland-1.0.14[ssl]
103 >=media-libs/fontconfig-2.8.0
104 media-libs/freetype:2
105 >=media-libs/libpng-1.4
106 media-libs/libvisio
107 >=net-misc/curl-7.21.4
108 sci-mathematics/lpsolve
109 >=sys-libs/db-4.8
110 virtual/jpeg
111 >=x11-libs/cairo-1.10.0[X]
112 x11-libs/libXinerama
113 x11-libs/libXrandr
114 x11-libs/libXrender
115 dbus? ( >=dev-libs/dbus-glib-0.92 )
116 eds? ( gnome-extra/evolution-data-server )
117 gnome? ( gnome-base/gconf:2 )
118 gtk? ( >=x11-libs/gtk+-2.24:2 )
119 graphite? ( media-gfx/graphite2 )
120 gstreamer? (
121 >=media-libs/gstreamer-0.10:0.10
122 >=media-libs/gst-plugins-base-0.10:0.10
123 )
124 java? (
125 >=dev-java/bsh-2.0_beta4
126 dev-java/lucene:2.9
127 dev-java/lucene-analyzers:2.3
128 )
129 jemalloc? ( dev-libs/jemalloc )
130 mysql? ( >=dev-db/mysql-connector-c++-1.1.0 )
131 opengl? ( virtual/opengl )
132 pdfimport? ( >=app-text/poppler-0.16[xpdf-headers(+),cxx] )
133 postgres? ( >=dev-db/postgresql-base-8.4.0 )
134 svg? ( gnome-base/librsvg )
135 webdav? ( net-libs/neon )
136 xmlsec? ( ${NSS_DEPEND} )
137 "
138
139 RDEPEND="${COMMON_DEPEND}
140 !app-office/libreoffice-bin
141 !app-office/libreoffice-bin-debug
142 !<app-openoffice/openoffice-bin-3.4.0-r1
143 !app-office/openoffice
144 media-fonts/libertine-ttf
145 media-fonts/liberation-fonts
146 media-fonts/urw-fonts
147 cups? ( net-print/cups )
148 java? ( >=virtual/jre-1.6 )
149 "
150
151 PDEPEND="
152 >=app-office/libreoffice-l10n-3.5.0
153 "
154
155 # FIXME: cppunit should be moved to test conditional
156 # after everything upstream is under gbuild
157 # as dmake execute tests right away
158 DEPEND="${COMMON_DEPEND}
159 >=dev-libs/boost-1.46
160 >=dev-libs/libxml2-2.7.8
161 dev-libs/libxslt
162 dev-perl/Archive-Zip
163 dev-util/cppunit
164 >=dev-util/gperf-3
165 dev-util/intltool
166 dev-util/mdds
167 virtual/pkgconfig
168 media-libs/sampleicc
169 net-misc/npapi-sdk
170 net-print/cups
171 >=sys-apps/findutils-4.4.2
172 sys-devel/bison
173 sys-apps/coreutils
174 sys-devel/flex
175 sys-devel/gettext
176 >=sys-devel/make-3.82
177 sys-libs/zlib
178 x11-libs/libXt
179 x11-libs/libXtst
180 x11-proto/randrproto
181 x11-proto/xextproto
182 x11-proto/xineramaproto
183 x11-proto/xproto
184 java? (
185 >=virtual/jdk-1.6
186 >=dev-java/ant-core-1.7
187 test? ( dev-java/junit:4 )
188 )
189 "
190
191 PATCHES=(
192 "${FILESDIR}/${PN}-system-pyuno.patch"
193 "${FILESDIR}/${PN}-3.5-propagate-gb_FULLDEPS.patch"
194 "${FILESDIR}/${PN}-3.5-doublebuild.patch"
195 "${FILESDIR}/${PN}-3.5-hebrew-icu49.patch"
196 )
197
198 REQUIRED_USE="
199 nsplugin? ( gtk )
200 gnome? ( gtk )
201 eds? ( gnome )
202 nlpsolver? ( java )
203 "
204
205 S="${WORKDIR}/${PN}-core-${PV}"
206
207 RESTRICT="test"
208
209 pkg_pretend() {
210 local pgslot
211
212 if [[ ${MERGE_TYPE} != binary ]]; then
213 CHECKREQS_MEMORY="512M"
214 CHECKREQS_DISK_BUILD="6G"
215 check-reqs_pkg_pretend
216
217 if [[ $(gcc-major-version) -lt 4 ]] || \
218 ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 5 ]] ) \
219 ; then
220 eerror "Compilation with gcc older than 4.5 is not supported"
221 die "Too old gcc found."
222 fi
223 fi
224
225 # ensure pg version
226 if use postgres; then
227 pgslot=$(postgresql-config show)
228 if [[ ${pgslot//.} < 90 ]] ; then
229 eerror "PostgreSQL slot must be set to 9.0 or higher."
230 eerror " postgresql-config set 9.0"
231 die "PostgreSQL slot is not set to 9.0 or higher."
232 fi
233 fi
234 }
235
236 pkg_setup() {
237 java-pkg-opt-2_pkg_setup
238 kde4-base_pkg_setup
239
240 python_set_active_version 2
241 python_pkg_setup
242
243 if [[ ${MERGE_TYPE} != binary ]]; then
244 CHECKREQS_MEMORY="512M"
245 CHECKREQS_DISK_BUILD="6G"
246 check-reqs_pkg_pretend
247 fi
248 }
249
250 src_unpack() {
251 local mod dest tmplfile tmplname mypv
252
253 [[ -n ${PATCHSET} ]] && unpack ${PATCHSET}
254 if use branding; then
255 unpack "${BRANDING}"
256 fi
257
258 if [[ ${PV} != *9999* ]]; then
259 for mod in ${MODULES}; do
260 if [[ ${mod} == binfilter ]] && ! use binfilter; then
261 continue
262 fi
263 unpack "${PN}-${mod}-${PV}.tar.xz"
264 if [[ ${mod} != core ]]; then
265 mv -n "${WORKDIR}/${PN}-${mod}-${PV}"/* "${S}"
266 rm -rf "${WORKDIR}/${PN}-${mod}-${PV}"
267 fi
268 done
269 else
270 for mod in ${MODULES}; do
271 if [[ ${mod} == binfilter ]] && ! use binfilter; then
272 continue
273 fi
274 mypv=${PV/.9999}
275 [[ ${mypv} != ${PV} ]] && EGIT_BRANCH="${PN}-${mypv/./-}"
276 EGIT_PROJECT="${PN}/${mod}"
277 EGIT_SOURCEDIR="${WORKDIR}/${PN}-${mod}-${PV}"
278 EGIT_REPO_URI="git://anongit.freedesktop.org/${PN}/${mod}"
279 EGIT_NOUNPACK="true"
280 git-2_src_unpack
281 if [[ ${mod} != core ]]; then
282 mv -n "${WORKDIR}/${PN}-${mod}-${PV}"/* "${S}"
283 rm -rf "${WORKDIR}/${PN}-${mod}-${PV}"
284 fi
285 done
286 unset EGIT_PROJECT EGIT_SOURCEDIR EGIT_REPO_URI EGIT_BRANCH
287 fi
288 }
289
290 src_prepare() {
291 # optimization flags
292 export ARCH_FLAGS="${CXXFLAGS}"
293 export LINKFLAGSOPTIMIZE="${LDFLAGS}"
294
295 # patchset
296 if [[ -n ${PATCHSET} ]]; then
297 EPATCH_FORCE="yes" \
298 EPATCH_SOURCE="${WORKDIR}/${PATCHSET/.tar.xz/}" \
299 EPATCH_SUFFIX="patch" \
300 epatch
301 fi
302
303 base_src_prepare
304
305 # please no debug in binfilter, it blows up things insanely
306 if use binfilter && ! use binfilterdebug ; then
307 for name in $(find "${S}/binfilter" -name makefile.mk) ; do
308 sed -i -e '1i\CFLAGS+= -g0' $name || die
309 done
310 fi
311
312 eautoreconf
313 # hack in the autogen.sh
314 touch autogen.lastrun
315 # system pyuno mess
316 sed \
317 -e "s:%eprefix%:${EPREFIX}:g" \
318 -e "s:%libdir%:$(get_libdir):g" \
319 -i pyuno/source/module/uno.py \
320 -i scripting/source/pyprov/officehelper.py || die
321
322 }
323
324 src_configure() {
325 local java_opts
326 local internal_libs
327 local jbs=$(sed -ne 's/.*\(-j[[:space:]]*\|--jobs=\)\([[:digit:]]\+\).*/\2/;T;p' <<< "${MAKEOPTS}")
328
329 # recheck that there is some value in jobs
330 [[ -z ${jbs} ]] && jbs="1"
331
332 # sane: just sane.h header that is used for scan in writer, not
333 # linked or anything else, worthless to depend on
334 # vigra: just uses templates from there
335 # it is serious pain in the ass for packaging
336 # should be replaced by boost::gil if someone interested
337 internal_libs+="
338 --without-system-sane
339 --without-system-vigra
340 "
341
342 if use java; then
343 # hsqldb: system one is too new
344 # saxon: system one does not work properly
345 java_opts="
346 --without-system-hsqldb
347 --without-system-saxon
348 --with-ant-home="${ANT_HOME}"
349 --with-jdk-home=$(java-config --jdk-home 2>/dev/null)
350 --with-java-target-version=$(java-pkg_get-target)
351 --with-jvm-path="${EPREFIX}/usr/$(get_libdir)/"
352 --with-beanshell-jar=$(java-pkg_getjar bsh bsh.jar)
353 --with-lucene-core-jar=$(java-pkg_getjar lucene-2.9 lucene-core.jar)
354 --with-lucene-analyzers-jar=$(java-pkg_getjar lucene-analyzers-2.3 lucene-analyzers.jar)
355 "
356 if use test; then
357 java_opts+=" --with-junit=$(java-pkg_getjar junit-4 junit.jar)"
358 else
359 java_opts+=" --without-junit"
360 fi
361 fi
362
363 if use branding; then
364 internal_libs+="
365 --with-about-bitmap="${WORKDIR}/branding-about.png"
366 --with-intro-bitmap="${WORKDIR}/branding-intro.png"
367 "
368 fi
369
370 # system headers/libs/...: enforce using system packages
371 # --enable-unix-qstart-libpng: use libpng splashscreen that is faster
372 # --enable-cairo: ensure that cairo is always required
373 # --enable-*-link: link to the library rather than just dlopen on runtime
374 # --enable-release-build: build the libreoffice as release
375 # --disable-fetch-external: prevent dowloading during compile phase
376 # --disable-gnome-vfs: old gnome virtual fs support
377 # --disable-kdeab: kde3 adressbook
378 # --disable-kde: kde3 support
379 # --disable-ldap: ldap requires internal mozilla stuff, same like mozab
380 # --disable-mozilla: disable mozilla build that is used for adresbook, not
381 # affecting the nsplugin that is always ON
382 # --disable-pch: precompiled headers cause build crashes
383 # --disable-rpath: relative runtime path is not desired
384 # --disable-static-gtk: ensure that gtk is linked dynamically
385 # --disable-ugly: disable ugly pieces of code
386 # --disable-zenity: disable build icon
387 # --enable-extension-integration: enable any extension integration support
388 # --with-{max-jobs,num-cpus}: ensuring parallel building
389 # --without-{afms,fonts,myspell-dicts,ppsd}: prevent install of sys pkgs
390 # --without-stlport: disable deprecated extensions framework
391 # --disable-ext-report-builder: too much java packages pulled in
392 econf \
393 --docdir="${EPREFIX}/usr/share/doc/${PF}/" \
394 --with-system-headers \
395 --with-system-libs \
396 --with-system-jars \
397 --with-system-dicts \
398 --enable-cairo-canvas \
399 --enable-largefile \
400 --enable-python=system \
401 --enable-randr \
402 --enable-randr-link \
403 --enable-release-build \
404 --enable-unix-qstart-libpng \
405 --enable-mergelibs \
406 --disable-ccache \
407 --disable-crashdump \
408 --disable-dependency-tracking \
409 --disable-epm \
410 --disable-fetch-external \
411 --disable-gnome-vfs \
412 --disable-ext-report-builder \
413 --disable-kdeab \
414 --disable-kde \
415 --disable-ldap \
416 --disable-mozilla \
417 --disable-online-update \
418 --disable-pch \
419 --disable-rpath \
420 --disable-systray \
421 --disable-static-gtk \
422 --disable-strip-solver \
423 --disable-ugly \
424 --disable-zenity \
425 --with-alloc=$(use jemalloc && echo "jemalloc" || echo "system") \
426 --with-build-version="Gentoo official package" \
427 --enable-extension-integration \
428 --with-external-dict-dir="${EPREFIX}/usr/share/myspell" \
429 --with-external-hyph-dir="${EPREFIX}/usr/share/myspell" \
430 --with-external-thes-dir="${EPREFIX}/usr/share/myspell" \
431 --with-external-tar="${DISTDIR}" \
432 --with-lang="" \
433 --with-max-jobs=${jbs} \
434 --with-num-cpus=2 \
435 --with-unix-wrapper=libreoffice \
436 --with-vendor="Gentoo Foundation" \
437 --with-x \
438 --without-afms \
439 --without-fonts \
440 --without-myspell-dicts \
441 --without-stlport \
442 --without-system-mozilla \
443 --without-help \
444 --with-helppack-integration \
445 --without-sun-templates \
446 $(use_enable binfilter) \
447 $(use_enable dbus) \
448 $(use_enable eds evolution2) \
449 $(use_enable gnome gconf) \
450 $(use_enable gnome gio) \
451 $(use_enable gnome lockdown) \
452 $(use_enable graphite) \
453 $(use_enable gstreamer) \
454 $(use_enable gtk) \
455 --disable-gtk3 \
456 $(use_enable java ext-scripting-beanshell) \
457 $(use_enable kde kde4) \
458 $(use_enable mysql ext-mysql-connector) \
459 $(use_enable nlpsolver ext-nlpsolver) \
460 $(use_enable nsplugin) \
461 $(use_enable odk) \
462 $(use_enable opengl) \
463 $(use_enable pdfimport ext-pdfimport) \
464 $(use_enable postgres postgresql-sdbc) \
465 $(use_enable svg librsvg system) \
466 $(use_enable test linkoo) \
467 $(use_enable vba) \
468 $(use_enable vba activex-component) \
469 $(use_enable webdav neon) \
470 $(use_enable xmlsec) \
471 $(use_with java) \
472 $(use_with mysql system-mysql-cppconn) \
473 ${internal_libs} \
474 ${java_opts}
475 }
476
477 src_compile() {
478 # hack for offlinehelp, this needs fixing upstream at some point
479 # it is broken because we send --without-help
480 # https://bugs.freedesktop.org/show_bug.cgi?id=46506
481 (
482 source "${S}/Env.Host.sh" 2&> /dev/null
483
484 local path="${SOLARVER}/${INPATH}/res/img"
485 mkdir -p "${path}" || die
486
487 echo "perl \"${S}/helpcontent2/helpers/create_ilst.pl\" -dir=default_images/res/helpimg > \"${path}/helpimg.ilst\""
488 perl "${S}/helpcontent2/helpers/create_ilst.pl" \
489 -dir=default_images/res/helpimg \
490 > "${path}/helpimg.ilst"
491 [[ -s "${path}/helpimg.ilst" ]] || ewarn "The help images list is empty, something is fishy, report a bug."
492 )
493
494 # not a proper make script
495 make build || die
496 }
497
498 src_test() {
499 make check || die
500 }
501
502 src_install() {
503 # This is not Makefile so no buildserver
504 make DESTDIR="${D}" distro-pack-install -o build -o check || die
505
506 # Fix bash completion placement
507 newbashcomp "${ED}"/etc/bash_completion.d/libreoffice.sh ${PN}
508 rm -rf "${ED}"/etc/
509
510 # symlink the nsplugin to system location
511 if use nsplugin; then
512 inst_plugin /usr/$(get_libdir)/libreoffice/program/libnpsoplugin.so
513 fi
514
515 if use branding; then
516 insinto /usr/$(get_libdir)/${PN}/program
517 newins "${WORKDIR}/branding-sofficerc" sofficerc
518 fi
519
520 # Hack for offlinehelp, this needs fixing upstream at some point.
521 # It is broken because we send --without-help
522 # https://bugs.freedesktop.org/show_bug.cgi?id=46506
523 insinto /usr/$(get_libdir)/libreoffice/help
524 doins xmlhelp/util/*.xsl
525 }
526
527 pkg_preinst() {
528 # Cache updates - all handled by kde eclass for all environments
529 kde4-base_pkg_preinst
530 }
531
532 pkg_postinst() {
533 kde4-base_pkg_postinst
534
535 pax-mark -m "${EPREFIX}"/usr/$(get_libdir)/libreoffice/program/soffice.bin
536 pax-mark -m "${EPREFIX}"/usr/$(get_libdir)/libreoffice/program/unopkg.bin
537
538 use cups || \
539 ewarn 'You will need net-print/cups to be able to print and export to PDF with libreoffice.'
540
541 use java || \
542 ewarn 'If you plan to use lbase aplication you should enable java or you will get various crashes.'
543 }
544
545 pkg_postrm() {
546 kde4-base_pkg_postrm
547 }

  ViewVC Help
Powered by ViewVC 1.1.20