1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 # this could be a multiple python package
7 # but the way it is packaged makes it very time consuming.
9 PYTHON_COMPAT=( python2_7 )
11 inherit eutils toolchain-funcs python-single-r1
15 DESCRIPTION="Automated astrometric calibration programs and service"
16 HOMEPAGE="http://astrometry.net/"
17 SRC_URI="https://github.com/dstndstn/astrometry.net/releases/download/${PV}/${MYP}.tar.gz"
19 LICENSE="BSD GPL-2 GPL-3"
21 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
23 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
26 dev-python/astropy[${PYTHON_USEDEP}]
27 dev-python/fitsio[${PYTHON_USEDEP}]
28 dev-python/numpy[${PYTHON_USEDEP}]
31 sci-astronomy/wcslib:0=
45 "${FILESDIR}"/${PN}-0.67-soname.patch
46 "${FILESDIR}"/${PN}-0.67-qsortr.patch
48 # "${FILESDIR}"/${PN}-0.72-dynlink.patch
52 # respect user compilation flags
54 -e '/-fomit-frame-pointer/d' \
55 -i util/makefile.common || die
57 sed -e "s|-lm|-lm $($(tc-getPKG_CONFIG) --libs wcslib gsl)|" \
58 -i util/Makefile || die
63 tc-export CC RANLIB AR
64 # fragile makefiles, build targets sequentially
74 for d in util blind libkd; do
75 pushd ${d} > /dev/null
76 ./test || die "failed tests in ${d}"
83 INSTALL_DIR="${ED%/}/usr" \
84 DATA_INSTALL_DIR="${ED%/}/usr/share/astrometry" \
85 LIB_INSTALL_DIR="${ED%/}/usr/$(get_libdir)" \
86 ETC_INSTALL_DIR="${ED%/}/etc" \
87 MAN1_INSTALL_DIR="${ED%/}/usr/share/man/man1" \
88 DOC_INSTALL_DIR="${ED%/}/usr/share/doc/${PF}" \
89 EXAMPLE_INSTALL_DIR="${ED%/}/usr/share/doc/${PF}/examples" \
90 PY_BASE_INSTALL_DIR="${ED%/}$(python_get_sitedir)/astrometry" \
91 PY_BASE_LINK_DIR="../$(python_get_sitedir | sed -e 's|/usr/||')/astrometry" \
92 FINAL_DIR="${EPREFIX%/}/usr" \
93 DATA_FINAL_DIR="${EPREFIX%/}/usr/share/astrometry" \
99 ap_make -C util install
100 ap_make -C blind install-extra
102 # remove duplicates and non installable libraries
104 rm "${ED}"/usr/bin/{fitscopy,imcopy,listhead} || die
106 rm "${ED}"/usr/bin/{fitsverify,imarith,imstat,liststruc,modhead,tablist,tabmerge} || die
107 rm "${ED}"/usr/$(get_libdir)/lib*.a || die
108 rm "${ED}"/usr/share/doc/${PF}/LICENSE || die
110 if use examples; then
111 docompress -x /usr/share/doc/${PF}/examples
113 rm -r "${ED}"/usr/share/doc/${PF}/examples || die