Gentoo Archives: gentoo-commits

From: Sebastien Fabbro <bicatali@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-astronomy/astrometry/files/, sci-astronomy/astrometry/
Date: Tue, 01 Mar 2016 22:47:14
Message-Id: 1456875776.3190a49bb37f43eafde10e486a83f083ff1c1771.bicatali@gentoo
1 commit: 3190a49bb37f43eafde10e486a83f083ff1c1771
2 Author: Sébastien Fabbro <bicatali <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 1 23:07:49 2016 +0000
4 Commit: Sebastien Fabbro <bicatali <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 1 23:42:56 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3190a49b
7
8 sci-astronomy/astrometry: Initial import (major bump from science overlay)
9
10 Package-Manager: portage-2.2.27
11
12 sci-astronomy/astrometry/Manifest | 1 +
13 sci-astronomy/astrometry/astrometry-0.67.ebuild | 105 +++++++++++++++++++++
14 .../astrometry/files/astrometry-0.67-dynlink.patch | 78 +++++++++++++++
15 .../astrometry/files/astrometry-0.67-soname.patch | 25 +++++
16 sci-astronomy/astrometry/metadata.xml | 18 ++++
17 5 files changed, 227 insertions(+)
18
19 diff --git a/sci-astronomy/astrometry/Manifest b/sci-astronomy/astrometry/Manifest
20 new file mode 100644
21 index 0000000..e29b4f7
22 --- /dev/null
23 +++ b/sci-astronomy/astrometry/Manifest
24 @@ -0,0 +1 @@
25 +DIST astrometry.net-0.67.tar.gz 10941863 SHA256 e351c81f7787550d42d45855db394a1702fd17c249ba934bdf4b6abf56281446 SHA512 f087e5a73a9881b1d4b1e4c205d45dc8b8663c304d8d1c1369a8427884df49fc8331fafeb5dc63648c2670b41a2626745568f6f11943bac56972db2d2bb11ddb WHIRLPOOL f4f71a54dd2694d0e98168e98e31846c7423c7cf593c0a629fa825e67b596ce3fa191719ef8cf3f52c1d0d641307e720176a977f28ffb1cffb0c60071f729af6
26
27 diff --git a/sci-astronomy/astrometry/astrometry-0.67.ebuild b/sci-astronomy/astrometry/astrometry-0.67.ebuild
28 new file mode 100644
29 index 0000000..df51244
30 --- /dev/null
31 +++ b/sci-astronomy/astrometry/astrometry-0.67.ebuild
32 @@ -0,0 +1,105 @@
33 +# Copyright 1999-2016 Gentoo Foundation
34 +# Distributed under the terms of the GNU General Public License v2
35 +# $Id$
36 +
37 +EAPI=6
38 +
39 +PYTHON_COMPAT=( python2_7 )
40 +
41 +inherit eutils toolchain-funcs python-single-r1
42 +
43 +MYP=${PN}.net-${PV}
44 +
45 +DESCRIPTION="Automated astrometric calibration programs and service"
46 +HOMEPAGE="http://astrometry.net/"
47 +SRC_URI="${HOMEPAGE}/downloads/${MYP}.tar.gz"
48 +
49 +LICENSE="BSD GPL-2 GPL-3"
50 +SLOT="0"
51 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
52 +IUSE="examples extra"
53 +
54 +RDEPEND="
55 + dev-python/numpy[${PYTHON_USEDEP}]
56 + sci-astronomy/wcslib:0=
57 + sci-libs/cfitsio:0=
58 + sci-libs/gsl:0=
59 + sys-libs/zlib:0=
60 + extra? (
61 + media-libs/libpng:0
62 + media-libs/netpbm
63 + virtual/jpeg:0
64 + x11-libs/cairo )"
65 +DEPEND="${RDEPEND}
66 + dev-lang/swig:0
67 + virtual/pkgconfig"
68 +
69 +S="${WORKDIR}/${MYP}"
70 +
71 +PATCHES=(
72 + "${FILESDIR}/${P}-soname.patch"
73 + "${FILESDIR}/${P}-dynlink.patch"
74 +)
75 +
76 +src_prepare() {
77 + default
78 + # fix python scripts
79 + python_fix_shebang "${S}"
80 + sed -e "s|python setup-util.py|${EPYTHON} setup-util.py|" -i util/Makefile || die
81 + sed -e "s|python setup.py|${EPYTHON} setup.py|" -i {libkd,sdss,blind}/Makefile || die
82 + sed -e "s|python -c|${EPYTHON} -c|" -i blind/Makefile || die
83 + sed -e "s|python <<EOF|${EPYTHON} <<EOF|" -i util/simplexy.c || die
84 + sed -e "s|python -V|${EPYTHON} -V|" -i Makefile || die
85 + # respect use compilation flags
86 + sed -e '/-O3/d' -e '/-fomit-frame-pointer/d' -i util/makefile.common || die
87 + # as-needed
88 + sed -e "s|-lm|$(pkg-config --libs wcslib gsl)|" -i util/Makefile || die
89 + export SYSTEM_GSL=yes
90 +}
91 +
92 +src_compile() {
93 + tc-export CC RANLIB AR
94 + emake
95 + emake py
96 + use extra && emake extra
97 + emake report.txt
98 +}
99 +
100 +src_test() {
101 + emake test
102 + local d
103 + for d in util blind libkd; do
104 + pushd ${d} > /dev/null
105 + ./test || die "failed tests in ${d}"
106 + popd ${d} > /dev/null
107 + done
108 +}
109 +
110 +ap_make() {
111 + emake \
112 + INSTALL_DIR="${ED}usr" \
113 + DATA_INSTALL_DIR="${ED}usr/share/astrometry" \
114 + LIB_INSTALL_DIR="${ED}usr/$(get_libdir)" \
115 + ETC_INSTALL_DIR="${ED}etc" \
116 + MAN1_INSTALL_DIR="${ED}usr/share/man/man1" \
117 + DOC_INSTALL_DIR="${ED}usr/share/doc/${PF}" \
118 + EXAMPLE_INSTALL_DIR="${ED}usr/share/doc/${PF}/examples" \
119 + PY_BASE_INSTALL_DIR="${ED}$(python_get_sitedir)/astrometry" \
120 + FINAL_DIR="${EPREFIX}usr" \
121 + DATA_FINAL_DIR="${EPREFIX}usr/share/astrometry" \
122 + $@
123 +}
124 +
125 +src_install() {
126 + ap_make install-core
127 + ap_make -C util install
128 + use extra && ap_make -C blind install-extra
129 +
130 + # remove cfitsio duplicates and non installable libraries
131 + rm "${ED}"/usr/bin/{fitscopy,imcopy,listhead} || die
132 + rm "${ED}"/usr/$(get_libdir)/lib*.a || die
133 +
134 + # remove license file
135 + rm "${ED}"/usr/share/doc/${PF}/LICENSE || die
136 + use examples || rm -r "${ED}"/usr/share/doc/${PF}/examples
137 +}
138
139 diff --git a/sci-astronomy/astrometry/files/astrometry-0.67-dynlink.patch b/sci-astronomy/astrometry/files/astrometry-0.67-dynlink.patch
140 new file mode 100644
141 index 0000000..64b87c0
142 --- /dev/null
143 +++ b/sci-astronomy/astrometry/files/astrometry-0.67-dynlink.patch
144 @@ -0,0 +1,78 @@
145 +Author: Ole Streicher <olebole@××××××.org>
146 +Description: Dynamically link to libastrometry.so, when possible
147 +--- a/blind/Makefile
148 ++++ b/blind/Makefile
149 +@@ -43,9 +43,7 @@
150 + LDLIBS := $(LDLIBS_DEF)
151 + LDLIBS += $(ANFILES_LIB)
152 +
153 +-SLIB := $(ENGINE_LIB)
154 +-SLIB += $(CATS_SLIB)
155 +-SLIB += $(ANFILES_SLIB)
156 ++SLIB := $(ENGINE_SO)
157 +
158 + CAIRO_SLIB := $(COMMON)/cairoutils.o
159 + CAIRO_SLIB += $(SLIB)
160 +@@ -131,7 +129,7 @@
161 + resort-xylist.o
162 +
163 + BUILD_INDEX_OBJS := build-index.o uniformize-catalog.o startree2.o hpquads.o \
164 +- quad-builder.o quad-utils.o codefile.o codetree.o unpermute-stars.o \
165 ++ quad-builder.o codefile.o codetree.o unpermute-stars.o \
166 + unpermute-quads.o merge-index.o
167 + ENGINE_OBJS += $(BUILD_INDEX_OBJS)
168 +
169 +@@ -147,8 +145,8 @@
170 + $(AR) rc $@ $(ENGINE_OBJS)
171 + $(RANLIB) $@
172 +
173 +-$(ENGINE_SO): $(ENGINE_OBJS) $(SLIB)
174 +- $(CC) $(LDFLAGS) $(SHAREDLIBFLAGS) -Wl,-soname,$@.0 -o $@.0 $^ $(LDLIBS)
175 ++$(ENGINE_SO): $(ENGINE_LIB) $(CATS_SLIB) $(ANFILES_SLIB)
176 ++ $(CC) $(LDFLAGS) $(SHAREDLIBFLAGS) -Wl,-soname,$@.0 -o $@.0 -Wl,--whole-archive $^ -Wl,--no-whole-archive $(LDLIBS) -lpthread
177 + ln -s $@.0 $@
178 +
179 + # old and miscellaneous executables that aren't part of the pipeline.
180 +--- a/util/Makefile
181 ++++ b/util/Makefile
182 +@@ -86,8 +86,7 @@
183 +
184 + LDFLAGS += $(LDFLAGS_DEF)
185 +
186 +-LDLIBS := $(LDLIBS_DEF)
187 +-LDLIBS += $(ANFILES_LIB)
188 ++LDLIBS := $(LDLIBS_DEF) -lm
189 +
190 + SHAREDLIBFLAGS := $(SHAREDLIBFLAGS_DEF)
191 +
192 +@@ -122,8 +121,7 @@
193 + ANUTILS_H_PATH := $(addprefix $(INCLUDE_DIR)/,$(ANUTILS_H))
194 +
195 + ifndef NO_QFITS
196 +-ANUTILS_OBJ += fitsioutils.o sip_qfits.o fitstable.o fitsbin.o fitsfile.o \
197 +- tic.o
198 ++ANUTILS_OBJ += fitsioutils.o sip_qfits.o fitstable.o fitsbin.o fitsfile.o
199 + ANUTILS_DEPS += $(QFITS_LIB)
200 + endif
201 +
202 +@@ -164,7 +162,7 @@
203 + ALL_OBJ += wcs-pv2sip.o
204 +
205 + _util$(PYTHON_SO_EXT): util.i lanczos.i $(ANFILES_SLIB)
206 +- LDFLAGS="$(LDFLAGS)" LDLIBS="$(LDLIBS)" SLIB="$(ANFILES_SLIB)" \
207 ++ LDFLAGS="$(LDFLAGS)" LDLIBS="-L../blind -lastrometry" \
208 + INC="$(ANFILES_INC)" CFLAGS="$(CFLAGS)" \
209 + python setup.py build_ext -v --inplace --build-temp .
210 + util.py: util.i lanczos.i
211 +--- a/libkd/Makefile
212 ++++ b/libkd/Makefile
213 +@@ -90,8 +90,7 @@
214 + PYSPHEREMATCH_OBJ := pyspherematch.o
215 +
216 + spherematch_c$(PYTHON_SO_EXT): pyspherematch.c setup.py $(SLIB)
217 +- LDFLAGS="$(LDFLAGS)" LDLIBS="$(LDLIBS)" \
218 +- SLIB="$(SLIB)" \
219 ++ LDFLAGS="$(LDFLAGS)" LDLIBS="-L../blind -lastrometry" \
220 + INC="$(INC)" \
221 + CFLAGS="$(CFLAGS)" \
222 + python setup.py build_ext --inplace --force --build-temp .
223
224 diff --git a/sci-astronomy/astrometry/files/astrometry-0.67-soname.patch b/sci-astronomy/astrometry/files/astrometry-0.67-soname.patch
225 new file mode 100644
226 index 0000000..595dd79
227 --- /dev/null
228 +++ b/sci-astronomy/astrometry/files/astrometry-0.67-soname.patch
229 @@ -0,0 +1,25 @@
230 +Author: Ole Streicher <olebole@××××××.org>
231 +Description: Add SONAME to libastrometry.so
232 +--- a/blind/Makefile
233 ++++ b/blind/Makefile
234 +@@ -148,7 +148,8 @@
235 + $(RANLIB) $@
236 +
237 + $(ENGINE_SO): $(ENGINE_OBJS) $(SLIB)
238 +- $(CC) $(LDFLAGS) $(SHAREDLIBFLAGS) -o $@ $^ $(LDLIBS)
239 ++ $(CC) $(LDFLAGS) $(SHAREDLIBFLAGS) -Wl,-soname,$@.0 -o $@.0 $^ $(LDLIBS)
240 ++ ln -s $@.0 $@
241 +
242 + # old and miscellaneous executables that aren't part of the pipeline.
243 + OLDEXECS := plotquads rawstartree checkquads
244 +@@ -233,8 +234,8 @@
245 + done
246 + mkdir -p '$(LIB_INSTALL_DIR)'
247 + @for x in $(INSTALL_LIB); do \
248 +- echo cp $$x '$(LIB_INSTALL_DIR)'; \
249 +- cp $$x '$(LIB_INSTALL_DIR)'; \
250 ++ echo cp -d $$x* '$(LIB_INSTALL_DIR)'; \
251 ++ cp -d $$x* '$(LIB_INSTALL_DIR)'; \
252 + done
253 + mkdir -p '$(PY_INSTALL_DIR)'
254 + @for x in $(PYTHON_INSTALL); do \
255
256 diff --git a/sci-astronomy/astrometry/metadata.xml b/sci-astronomy/astrometry/metadata.xml
257 new file mode 100644
258 index 0000000..a08f005
259 --- /dev/null
260 +++ b/sci-astronomy/astrometry/metadata.xml
261 @@ -0,0 +1,18 @@
262 +<?xml version="1.0" encoding="UTF-8"?>
263 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
264 +<pkgmetadata>
265 + <maintainer type="project">
266 + <email>sci-astronomy@g.o</email>
267 + <name>Gentoo Astronomy Project</name>
268 + </maintainer>
269 + <longdescription lang="en">
270 + If you have astronomical imaging of the sky with celestial
271 + coordinates you do not know—or do not trust—then Astrometry.net is
272 + for you. Input an image and we'll give you back astrometric
273 + calibration meta-data, plus lists of known objects falling inside
274 + the field of view.
275 +</longdescription>
276 + <use>
277 + <flag name="extra">Add extra tools for astrometry.net, specifically for plots</flag>
278 + </use>
279 +</pkgmetadata>