summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Fabbro <bicatali@gentoo.org>2016-03-01 23:07:49 +0000
committerSébastien Fabbro <bicatali@gentoo.org>2016-03-01 23:42:56 +0000
commit3190a49bb37f43eafde10e486a83f083ff1c1771 (patch)
tree9d35fe317e2903b8464801998c6e21f10c3ff5f7 /sci-astronomy
parentvirtual/jdk: icedtea-bin:8 now available for amd64, arm, x86 (diff)
downloadgentoo-3190a49bb37f43eafde10e486a83f083ff1c1771.tar.gz
gentoo-3190a49bb37f43eafde10e486a83f083ff1c1771.tar.bz2
gentoo-3190a49bb37f43eafde10e486a83f083ff1c1771.zip
sci-astronomy/astrometry: Initial import (major bump from science overlay)
Package-Manager: portage-2.2.27
Diffstat (limited to 'sci-astronomy')
-rw-r--r--sci-astronomy/astrometry/Manifest1
-rw-r--r--sci-astronomy/astrometry/astrometry-0.67.ebuild105
-rw-r--r--sci-astronomy/astrometry/files/astrometry-0.67-dynlink.patch78
-rw-r--r--sci-astronomy/astrometry/files/astrometry-0.67-soname.patch25
-rw-r--r--sci-astronomy/astrometry/metadata.xml18
5 files changed, 227 insertions, 0 deletions
diff --git a/sci-astronomy/astrometry/Manifest b/sci-astronomy/astrometry/Manifest
new file mode 100644
index 000000000000..e29b4f7e7755
--- /dev/null
+++ b/sci-astronomy/astrometry/Manifest
@@ -0,0 +1 @@
+DIST astrometry.net-0.67.tar.gz 10941863 SHA256 e351c81f7787550d42d45855db394a1702fd17c249ba934bdf4b6abf56281446 SHA512 f087e5a73a9881b1d4b1e4c205d45dc8b8663c304d8d1c1369a8427884df49fc8331fafeb5dc63648c2670b41a2626745568f6f11943bac56972db2d2bb11ddb WHIRLPOOL f4f71a54dd2694d0e98168e98e31846c7423c7cf593c0a629fa825e67b596ce3fa191719ef8cf3f52c1d0d641307e720176a977f28ffb1cffb0c60071f729af6
diff --git a/sci-astronomy/astrometry/astrometry-0.67.ebuild b/sci-astronomy/astrometry/astrometry-0.67.ebuild
new file mode 100644
index 000000000000..df51244787bb
--- /dev/null
+++ b/sci-astronomy/astrometry/astrometry-0.67.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+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.gz"
+
+LICENSE="BSD GPL-2 GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="examples extra"
+
+RDEPEND="
+ dev-python/numpy[${PYTHON_USEDEP}]
+ sci-astronomy/wcslib:0=
+ sci-libs/cfitsio:0=
+ sci-libs/gsl:0=
+ sys-libs/zlib:0=
+ 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}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-soname.patch"
+ "${FILESDIR}/${P}-dynlink.patch"
+)
+
+src_prepare() {
+ default
+ # fix python scripts
+ python_fix_shebang "${S}"
+ sed -e "s|python setup-util.py|${EPYTHON} setup-util.py|" -i util/Makefile || die
+ sed -e "s|python setup.py|${EPYTHON} setup.py|" -i {libkd,sdss,blind}/Makefile || die
+ sed -e "s|python -c|${EPYTHON} -c|" -i blind/Makefile || die
+ sed -e "s|python <<EOF|${EPYTHON} <<EOF|" -i util/simplexy.c || die
+ sed -e "s|python -V|${EPYTHON} -V|" -i Makefile || die
+ # respect use compilation flags
+ sed -e '/-O3/d' -e '/-fomit-frame-pointer/d' -i util/makefile.common || die
+ # as-needed
+ sed -e "s|-lm|$(pkg-config --libs wcslib gsl)|" -i util/Makefile || die
+ export SYSTEM_GSL=yes
+}
+
+src_compile() {
+ tc-export CC RANLIB AR
+ emake
+ emake py
+ use extra && emake extra
+ emake report.txt
+}
+
+src_test() {
+ emake test
+ local d
+ for d in util blind libkd; do
+ pushd ${d} > /dev/null
+ ./test || die "failed tests in ${d}"
+ popd ${d} > /dev/null
+ done
+}
+
+ap_make() {
+ emake \
+ INSTALL_DIR="${ED}usr" \
+ DATA_INSTALL_DIR="${ED}usr/share/astrometry" \
+ LIB_INSTALL_DIR="${ED}usr/$(get_libdir)" \
+ ETC_INSTALL_DIR="${ED}etc" \
+ MAN1_INSTALL_DIR="${ED}usr/share/man/man1" \
+ DOC_INSTALL_DIR="${ED}usr/share/doc/${PF}" \
+ EXAMPLE_INSTALL_DIR="${ED}usr/share/doc/${PF}/examples" \
+ PY_BASE_INSTALL_DIR="${ED}$(python_get_sitedir)/astrometry" \
+ FINAL_DIR="${EPREFIX}usr" \
+ DATA_FINAL_DIR="${EPREFIX}usr/share/astrometry" \
+ $@
+}
+
+src_install() {
+ ap_make install-core
+ ap_make -C util install
+ use extra && ap_make -C blind install-extra
+
+ # remove cfitsio duplicates and non installable libraries
+ rm "${ED}"/usr/bin/{fitscopy,imcopy,listhead} || die
+ rm "${ED}"/usr/$(get_libdir)/lib*.a || die
+
+ # remove license file
+ rm "${ED}"/usr/share/doc/${PF}/LICENSE || die
+ use examples || rm -r "${ED}"/usr/share/doc/${PF}/examples
+}
diff --git a/sci-astronomy/astrometry/files/astrometry-0.67-dynlink.patch b/sci-astronomy/astrometry/files/astrometry-0.67-dynlink.patch
new file mode 100644
index 000000000000..64b87c033ca5
--- /dev/null
+++ b/sci-astronomy/astrometry/files/astrometry-0.67-dynlink.patch
@@ -0,0 +1,78 @@
+Author: Ole Streicher <olebole@debian.org>
+Description: Dynamically link to libastrometry.so, when possible
+--- a/blind/Makefile
++++ b/blind/Makefile
+@@ -43,9 +43,7 @@
+ LDLIBS := $(LDLIBS_DEF)
+ LDLIBS += $(ANFILES_LIB)
+
+-SLIB := $(ENGINE_LIB)
+-SLIB += $(CATS_SLIB)
+-SLIB += $(ANFILES_SLIB)
++SLIB := $(ENGINE_SO)
+
+ CAIRO_SLIB := $(COMMON)/cairoutils.o
+ CAIRO_SLIB += $(SLIB)
+@@ -131,7 +129,7 @@
+ resort-xylist.o
+
+ BUILD_INDEX_OBJS := build-index.o uniformize-catalog.o startree2.o hpquads.o \
+- quad-builder.o quad-utils.o codefile.o codetree.o unpermute-stars.o \
++ quad-builder.o codefile.o codetree.o unpermute-stars.o \
+ unpermute-quads.o merge-index.o
+ ENGINE_OBJS += $(BUILD_INDEX_OBJS)
+
+@@ -147,8 +145,8 @@
+ $(AR) rc $@ $(ENGINE_OBJS)
+ $(RANLIB) $@
+
+-$(ENGINE_SO): $(ENGINE_OBJS) $(SLIB)
+- $(CC) $(LDFLAGS) $(SHAREDLIBFLAGS) -Wl,-soname,$@.0 -o $@.0 $^ $(LDLIBS)
++$(ENGINE_SO): $(ENGINE_LIB) $(CATS_SLIB) $(ANFILES_SLIB)
++ $(CC) $(LDFLAGS) $(SHAREDLIBFLAGS) -Wl,-soname,$@.0 -o $@.0 -Wl,--whole-archive $^ -Wl,--no-whole-archive $(LDLIBS) -lpthread
+ ln -s $@.0 $@
+
+ # old and miscellaneous executables that aren't part of the pipeline.
+--- a/util/Makefile
++++ b/util/Makefile
+@@ -86,8 +86,7 @@
+
+ LDFLAGS += $(LDFLAGS_DEF)
+
+-LDLIBS := $(LDLIBS_DEF)
+-LDLIBS += $(ANFILES_LIB)
++LDLIBS := $(LDLIBS_DEF) -lm
+
+ SHAREDLIBFLAGS := $(SHAREDLIBFLAGS_DEF)
+
+@@ -122,8 +121,7 @@
+ ANUTILS_H_PATH := $(addprefix $(INCLUDE_DIR)/,$(ANUTILS_H))
+
+ ifndef NO_QFITS
+-ANUTILS_OBJ += fitsioutils.o sip_qfits.o fitstable.o fitsbin.o fitsfile.o \
+- tic.o
++ANUTILS_OBJ += fitsioutils.o sip_qfits.o fitstable.o fitsbin.o fitsfile.o
+ ANUTILS_DEPS += $(QFITS_LIB)
+ endif
+
+@@ -164,7 +162,7 @@
+ ALL_OBJ += wcs-pv2sip.o
+
+ _util$(PYTHON_SO_EXT): util.i lanczos.i $(ANFILES_SLIB)
+- LDFLAGS="$(LDFLAGS)" LDLIBS="$(LDLIBS)" SLIB="$(ANFILES_SLIB)" \
++ LDFLAGS="$(LDFLAGS)" LDLIBS="-L../blind -lastrometry" \
+ INC="$(ANFILES_INC)" CFLAGS="$(CFLAGS)" \
+ python setup.py build_ext -v --inplace --build-temp .
+ util.py: util.i lanczos.i
+--- a/libkd/Makefile
++++ b/libkd/Makefile
+@@ -90,8 +90,7 @@
+ PYSPHEREMATCH_OBJ := pyspherematch.o
+
+ spherematch_c$(PYTHON_SO_EXT): pyspherematch.c setup.py $(SLIB)
+- LDFLAGS="$(LDFLAGS)" LDLIBS="$(LDLIBS)" \
+- SLIB="$(SLIB)" \
++ LDFLAGS="$(LDFLAGS)" LDLIBS="-L../blind -lastrometry" \
+ INC="$(INC)" \
+ CFLAGS="$(CFLAGS)" \
+ python setup.py build_ext --inplace --force --build-temp .
diff --git a/sci-astronomy/astrometry/files/astrometry-0.67-soname.patch b/sci-astronomy/astrometry/files/astrometry-0.67-soname.patch
new file mode 100644
index 000000000000..595dd79a2f46
--- /dev/null
+++ b/sci-astronomy/astrometry/files/astrometry-0.67-soname.patch
@@ -0,0 +1,25 @@
+Author: Ole Streicher <olebole@debian.org>
+Description: Add SONAME to libastrometry.so
+--- a/blind/Makefile
++++ b/blind/Makefile
+@@ -148,7 +148,8 @@
+ $(RANLIB) $@
+
+ $(ENGINE_SO): $(ENGINE_OBJS) $(SLIB)
+- $(CC) $(LDFLAGS) $(SHAREDLIBFLAGS) -o $@ $^ $(LDLIBS)
++ $(CC) $(LDFLAGS) $(SHAREDLIBFLAGS) -Wl,-soname,$@.0 -o $@.0 $^ $(LDLIBS)
++ ln -s $@.0 $@
+
+ # old and miscellaneous executables that aren't part of the pipeline.
+ OLDEXECS := plotquads rawstartree checkquads
+@@ -233,8 +234,8 @@
+ done
+ mkdir -p '$(LIB_INSTALL_DIR)'
+ @for x in $(INSTALL_LIB); do \
+- echo cp $$x '$(LIB_INSTALL_DIR)'; \
+- cp $$x '$(LIB_INSTALL_DIR)'; \
++ echo cp -d $$x* '$(LIB_INSTALL_DIR)'; \
++ cp -d $$x* '$(LIB_INSTALL_DIR)'; \
+ done
+ mkdir -p '$(PY_INSTALL_DIR)'
+ @for x in $(PYTHON_INSTALL); do \
diff --git a/sci-astronomy/astrometry/metadata.xml b/sci-astronomy/astrometry/metadata.xml
new file mode 100644
index 000000000000..a08f005b1f63
--- /dev/null
+++ b/sci-astronomy/astrometry/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ If you have astronomical imaging of the sky with celestial
+ coordinates you do not know—or do not trust—then Astrometry.net is
+ for you. Input an image and we'll give you back astrometric
+ calibration meta-data, plus lists of known objects falling inside
+ the field of view.
+</longdescription>
+ <use>
+ <flag name="extra">Add extra tools for astrometry.net, specifically for plots</flag>
+ </use>
+</pkgmetadata>