dev-qt/qtx11extras: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / sci-astronomy / sextractor / sextractor-2.19.5-r1.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         !games-misc/sex
23         modelfit? ( sci-libs/atlas[lapack,threads=] sci-libs/fftw:3.0 )"
24 DEPEND="${RDEPEND}
25         modelfit? ( ${AUTOTOOLS_DEPEND} )"
26
27 REQUIRED_USE="test? ( modelfit )"
28
29 PATCHES=(
30         "${FILESDIR}/${P}-fix-format-errors.patch"
31         "${FILESDIR}/${P}-have-malloc.patch"
32         "${FILESDIR}/${P}-have-mmap.patch"
33         "${FILESDIR}/${P}-sigbus.patch"
34 )
35
36 src_prepare() {
37         default
38         if use modelfit; then
39         local mycblas=atlcblas myclapack=atlclapack
40         if use threads; then
41                 [[ -e "${EPREFIX}"/usr/$(get_libdir)/libptcblas.so ]] && \
42                         mycblas=ptcblas
43                 [[ -e "${EPREFIX}"/usr/$(get_libdir)/libptclapack.so ]] && \
44                         myclapack=ptclapack
45         fi
46         sed -i \
47                 -e "s/-lcblas/-l${mycblas}/g" \
48                 -e "s/AC_CHECK_LIB(cblas/AC_CHECK_LIB(${mycblas}/g" \
49                 -e "s/-llapack/-l${myclapack}/g" \
50                 -e "s/AC_CHECK_LIB(lapack/AC_CHECK_LIB(${myclapack}/g" \
51                 acx_atlas.m4 || die
52         eautoreconf
53         fi
54 }
55
56 src_configure() {
57         econf \
58                 --with-atlas-incdir="${EPREFIX}/usr/include/atlas" \
59                 $(use_enable modelfit model-fitting) \
60                 $(use_enable threads)
61 }
62
63 src_install() {
64         default
65         CONFDIR=/usr/share/sextractor
66         insinto ${CONFDIR}
67         doins config/*
68         use doc && dodoc doc/*
69 }
70
71 pkg_postinst() {
72         elog "SExtractor examples configuration files are located in"
73         elog "${EROOT%/}/${CONFDIR} and are not loaded anymore by default."
74 }