dev-qt/qtx11extras: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / sci-astronomy / sextractor / sextractor-2.19.5.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 AUTOTOOLS_AUTO_DEPEND=no
7
8 inherit autotools
9
10 DESCRIPTION="Extract catalogs of sources from astronomical FITS images"
11 HOMEPAGE="http://www.astromatic.net/software/sextractor"
12 SRC_URI="http://www.astromatic.net/download/${PN}/${P}.tar.gz"
13 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
14
15 LICENSE="GPL-3"
16 SLOT="0"
17
18 IUSE="doc modelfit test threads"
19 RESTRICT="!test? ( test )"
20
21 RDEPEND="
22         modelfit? ( sci-libs/atlas[lapack,threads=] sci-libs/fftw:3.0 )"
23 DEPEND="${RDEPEND}
24         modelfit? ( ${AUTOTOOLS_DEPEND} )"
25
26 REQUIRED_USE="test? ( modelfit )"
27
28 PATCHES=(
29         "${FILESDIR}/${P}-fix-format-errors.patch"
30         "${FILESDIR}/${P}-have-malloc.patch"
31         "${FILESDIR}/${P}-have-mmap.patch"
32         "${FILESDIR}/${P}-sigbus.patch"
33 )
34
35 src_prepare() {
36         default
37         if use modelfit; then
38         local mycblas=atlcblas myclapack=atlclapack
39         if use threads; then
40                 [[ -e "${EPREFIX}"/usr/$(get_libdir)/libptcblas.so ]] && \
41                         mycblas=ptcblas
42                 [[ -e "${EPREFIX}"/usr/$(get_libdir)/libptclapack.so ]] && \
43                         myclapack=ptclapack
44         fi
45         sed -i \
46                 -e "s/-lcblas/-l${mycblas}/g" \
47                 -e "s/AC_CHECK_LIB(cblas/AC_CHECK_LIB(${mycblas}/g" \
48                 -e "s/-llapack/-l${myclapack}/g" \
49                 -e "s/AC_CHECK_LIB(lapack/AC_CHECK_LIB(${myclapack}/g" \
50                 acx_atlas.m4 || die
51         eautoreconf
52         fi
53 }
54
55 src_configure() {
56         econf \
57                 --with-atlas-incdir="${EPREFIX}/usr/include/atlas" \
58                 $(use_enable modelfit model-fitting) \
59                 $(use_enable threads)
60 }
61
62 src_install() {
63         default
64         CONFDIR=/usr/share/sextractor
65         insinto ${CONFDIR}
66         doins config/*
67         use doc && dodoc doc/*
68 }
69
70 pkg_postinst() {
71         elog "SExtractor examples configuration files are located in"
72         elog "${EROOT%/}/${CONFDIR} and are not loaded anymore by default."
73 }