Merge remote-tracking branch 'github/pr/917'
[gentoo.git] / sci-astronomy / cpl / cpl-6.6.1.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=6
6
7 JAVA_PKG_OPT_USE=gasgano
8
9 inherit autotools java-pkg-opt-2
10
11 DESCRIPTION="ESO common pipeline library for astronomical data reduction"
12 HOMEPAGE="http://www.eso.org/sci/software/cpl/"
13 SRC_URI="ftp://ftp.eso.org/pub/dfs/pipelines/libraries/${PN}/${P}.tar.gz"
14
15 LICENSE="GPL-2"
16 SLOT="0/20"
17 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
18
19 IUSE="doc gasgano static-libs threads"
20
21 RDEPEND="
22         sci-astronomy/wcslib:0=
23         sci-libs/cfitsio:0=
24         sci-libs/fftw:3.0=
25         gasgano? ( sci-astronomy/gasgano )"
26 DEPEND="${RDEPEND}
27         doc? ( app-doc/doxygen )"
28
29 PATCHES=(
30         "${FILESDIR}"/${PN}-6.6.1-use-system-ltdl.patch
31 )
32
33 src_prepare() {
34         default
35         # remove cpu chcking
36         sed -e '/CPL_CHECK_CPU/d' \
37                 -i configure.ac libcext/configure.ac || die
38         # search for shared libs, not static
39         sed -e 's/\.a/\.so/g' \
40                 -i m4/cpl.m4 || die
41         eautoreconf
42 }
43
44 src_configure() {
45         local myeconfargs=(
46                 --htmldir="${EPREFIX}/usr/share/doc/${PF}/html"
47                 --disable-ltdl-install
48                 --without-included-ltdl
49                 --with-cfitsio="${EPREFIX}/usr"
50                 --with-wcs="${EPREFIX}/usr"
51                 --with-fftw="${EPREFIX}/usr"
52                 $(use_enable doc maintainer-mode)
53                 $(use_enable static-libs static)
54                 $(use_enable threads)
55         )
56         if use gasgano; then
57                 myeconfargs+=(
58                         --enable-gasgano
59                         --with-gasgano="${EPREFIX}/usr"
60                         --with-gasgano-classpath="${EPREFIX}/usr/share/gasgano/lib"
61                         --with-java="$(java-config -O)"
62                 )
63         else
64                 myeconfargs+=( --disable-gasgano )
65         fi
66         econf ${myeconfargs[@]}
67 }
68
69 src_compile() {
70         default
71         use doc && emake html
72 }
73
74 src_install() {
75         default
76         prune_libtool_files --all
77         use doc && emake install-html
78 }