summaryrefslogtreecommitdiff
path: root/sci-astronomy/astrometry/astrometry-0.52-r1.ebuild
diff options
context:
space:
mode:
Diffstat (limited to 'sci-astronomy/astrometry/astrometry-0.52-r1.ebuild')
-rw-r--r--sci-astronomy/astrometry/astrometry-0.52-r1.ebuild93
1 files changed, 93 insertions, 0 deletions
diff --git a/sci-astronomy/astrometry/astrometry-0.52-r1.ebuild b/sci-astronomy/astrometry/astrometry-0.52-r1.ebuild
new file mode 100644
index 0000000..92d1cc4
--- /dev/null
+++ b/sci-astronomy/astrometry/astrometry-0.52-r1.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils toolchain-funcs python-single-r1
+
+MYP=${PN}.net-${PV}
+
+DESCRIPTION="Automated astrometric calibration programs and service"
+HOMEPAGE="http://astrometry.net/"
+SRC_URI="${HOMEPAGE}/downloads/${MYP}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="examples extra python"
+
+RDEPEND="
+ dev-python/numpy[${PYTHON_USEDEP}]
+ sci-astronomy/wcslib
+ sci-libs/cfitsio
+ sci-libs/gsl
+ sys-libs/zlib
+ virtual/pyfits[${PYTHON_USEDEP}]
+ extra? (
+ media-libs/libpng:0
+ media-libs/netpbm
+ virtual/jpeg:0
+ x11-libs/cairo )"
+DEPEND="${RDEPEND}
+ dev-lang/swig:0
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${MYP}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/0.52-as-needed.patch
+ epatch "${FILESDIR}"/0.52-respect-user-flags.patch
+ epatch "${FILESDIR}"/0.52-fix_installation_paths.patch
+ python_fix_shebang "${S}"
+ sed "s|python setup-util.py|${EPYTHON} setup-util.py|" "${S}"/util/Makefile -i || die
+ sed "s|python setup.py|${EPYTHON} setup.py|" "${S}"/{libkd,sdss,blind}/Makefile -i || die
+ sed "s|python -c|${EPYTHON} -c|" "${S}"/blind/Makefile -i || die
+ sed "s|python -V|${EPYTHON} -V|" "${S}"/Makefile -i || die
+}
+
+src_compile() {
+ emake \
+ CC=$(tc-getCC) \
+ RANLIB=$(tc-getRANLIB) \
+ AR=$(tc-getAR) \
+ all report.txt
+ if use extra; then
+ emake \
+ CC=$(tc-getCC) \
+ RANLIB=$(tc-getRANLIB) \
+ AR=$(tc-getAR) \
+ extra
+ fi
+
+ if use python; then
+ emake \
+ CC=$(tc-getCC) \
+ RANLIB=$(tc-getRANLIB) \
+ AR=$(tc-getAR) \
+ py
+ fi
+}
+
+src_install() {
+ export INSTALL_DIR="${ED}"/usr
+ export DATA_INSTALL_DIR="${INSTALL_DIR}"/share/"${PN}"/data
+ export BIN_INSTALL_DIR="${INSTALL_DIR}"/bin
+ export INCLUDE_INSTALL_DIR="${INSTALL_DIR}"/include/"${PN}"
+ export LIB_INSTALL_DIR="${INSTALL_DIR}"/lib
+ python_export python2.7
+ export PY_BASE_INSTALL_DIR="${LIB_INSTALL_DIR}"/"${EPYTHON}"/"${PN}"
+ export PY_BASE_LINK_DIR=../lib/"${EPYTHON}"/"${PN}"
+ export ETC_INSTALL_DIR="${INSTALL_DIR}"/share/"${PN}"/etc
+ export DOC_INSTALL_DIR="${INSTALL_DIR}"/share/doc/"${PF}"
+ export UPS_INSTALL_DIR="${DOC_INSTALL_DIR}"/ups
+ export EXAMPLES_INSTALL_DIR="${DOC_INSTALL_DIR}"/examples
+
+ emake install-core
+ use extra && emake -C blind install-extra
+
+ # remove cfitsio duplicates
+ rm ${INSTALL_DIR}/bin/{fitscopy,imcopy,listhead} || die
+} \ No newline at end of file