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/psfex/files/, sci-astronomy/psfex/
Date: Mon, 07 Mar 2016 20:06:30
Message-Id: 1457384544.732d5c38a89687a8c064fb5e5033b911254412c4.bicatali@gentoo
1 commit: 732d5c38a89687a8c064fb5e5033b911254412c4
2 Author: Sébastien Fabbro <bicatali <AT> gentoo <DOT> org>
3 AuthorDate: Mon Mar 7 21:00:43 2016 +0000
4 Commit: Sebastien Fabbro <bicatali <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 7 21:02:24 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=732d5c38
7
8 sci-astronomy/psfex: initial import
9
10 Package-Manager: portage-2.2.27
11
12 sci-astronomy/psfex/Manifest | 1 +
13 .../psfex/files/psfex-3.17.1-have-mmap.patch | 55 +++++
14 .../psfex/files/psfex-3.17.1-plplot510.patch | 221 +++++++++++++++++++++
15 .../psfex/files/psfex-3.17.1-sigbus.patch | 26 +++
16 sci-astronomy/psfex/metadata.xml | 17 ++
17 sci-astronomy/psfex/psfex-3.17.1.ebuild | 64 ++++++
18 6 files changed, 384 insertions(+)
19
20 diff --git a/sci-astronomy/psfex/Manifest b/sci-astronomy/psfex/Manifest
21 new file mode 100644
22 index 0000000..e739f7b
23 --- /dev/null
24 +++ b/sci-astronomy/psfex/Manifest
25 @@ -0,0 +1 @@
26 +DIST psfex-3.17.1.tar.gz 2366370 SHA256 53f1b449ab7da7e6e0a989c41b82885f52c8f08270ceb4378bb1ec7ef754af89 SHA512 eb562372dd75593a111c23698b0c00ce050547051803a741ac771ca346d13a0de1e478b055581619a9fa2bf6fa374915ca685cfcf1c4162271b6aa44303e6e58 WHIRLPOOL 3245b2b8c5a85e5f0a88b0c11aff07ce10ced0682890b786d0b092285d46fedf72bf15e87dd3ef6f6296527bc632e12c5162fa0b3b660b5b8bff0b30f38510c9
27
28 diff --git a/sci-astronomy/psfex/files/psfex-3.17.1-have-mmap.patch b/sci-astronomy/psfex/files/psfex-3.17.1-have-mmap.patch
29 new file mode 100644
30 index 0000000..1b65650
31 --- /dev/null
32 +++ b/sci-astronomy/psfex/files/psfex-3.17.1-have-mmap.patch
33 @@ -0,0 +1,55 @@
34 +Author: Justin Pryzby <justinpryzby@××××××××.net>
35 +Description: (guess) Use mmap only if it exists.
36 +--- a/src/fits/fitsbody.c
37 ++++ b/src/fits/fitsbody.c
38 +@@ -64,9 +64,12 @@
39 + ***/
40 + PIXTYPE *alloc_body(tabstruct *tab, void (*func)(PIXTYPE *ptr, int npix))
41 + {
42 ++#ifdef HAVE_MMAP
43 + FILE *file;
44 + PIXTYPE *buffer;
45 +- size_t npix, size, sizeleft, spoonful;
46 ++ size_t sizeleft, spoonful;
47 ++#endif
48 ++ size_t npix, size;
49 +
50 + if (!body_ramflag)
51 + {
52 +@@ -87,7 +90,9 @@
53 + /* Decide if the data will go in physical memory or on swap-space */
54 + npix = tab->tabsize/tab->bytepix;
55 + size = npix*sizeof(PIXTYPE);
56 ++#if !HAVE_MMAP
57 + if (size < body_ramleft)
58 ++#endif
59 + {
60 + /*-- There should be enough RAM left: try to do a malloc() */
61 + if ((tab->bodybuf = malloc(size)))
62 +@@ -105,6 +110,7 @@
63 + tab->bodybuf = NULL;
64 + }
65 +
66 ++#if HAVE_MMAP
67 + if (size < body_vramleft)
68 + {
69 + /*-- Convert and copy the data to a swap file, and mmap() it */
70 +@@ -144,6 +150,7 @@
71 + return NULL;
72 + return (PIXTYPE *)tab->bodybuf;
73 + }
74 ++#endif
75 +
76 + /* If no memory left at all: forget it! */
77 + return NULL;
78 +@@ -270,8 +277,10 @@
79 + size = (tab->tabsize/tab->bytepix)*sizeof(PIXTYPE);
80 + if (tab->swapflag)
81 + {
82 ++#if HAVE_MMAP
83 + if (munmap(tab->bodybuf, size))
84 + warning("Can't unmap ", tab->cat->filename);
85 ++#endif
86 + tab->swapflag = 0;
87 + tab->bodybuf = NULL;
88 + body_vramleft += size;
89
90 diff --git a/sci-astronomy/psfex/files/psfex-3.17.1-plplot510.patch b/sci-astronomy/psfex/files/psfex-3.17.1-plplot510.patch
91 new file mode 100644
92 index 0000000..4dd5805
93 --- /dev/null
94 +++ b/sci-astronomy/psfex/files/psfex-3.17.1-plplot510.patch
95 @@ -0,0 +1,221 @@
96 +Author: Ole Streicher <olebole@××××××.org>
97 +Description: Replace deprecated plwid() calls by plwidth().
98 +--- a/src/cplot.c
99 ++++ b/src/cplot.c
100 +@@ -527,7 +527,7 @@
101 +
102 + /* Draw meridians */
103 + plschr(0.0, 0.33);
104 +- plwid(0);
105 ++ plwidth(0.0);
106 + pllsty(2);
107 + xmd = xmu = xdo = -0.5;
108 + ymd = ymu = ydo = -0.5;
109 +@@ -709,14 +709,14 @@
110 + ymin = 0.5;
111 + ymax = 100.5;
112 + lwid = plotaaflag? ((CPLOT_AAFAC+1)/2) : 1;
113 +- plwid(lwid);
114 ++ plwidth((double)lwid);
115 + plfont(2);
116 + plcol0(15);
117 + plenv((PLFLT)xmin, (PLFLT)xmax, (PLFLT)ymin, (PLFLT)ymax, 1, -1);
118 + sprintf(str, "#uField %.24s: FWHM map", field->rtcatname);
119 + plschr(0.0, 1.0);
120 + pllab("","", str);
121 +- plwid(0);
122 ++ plwidth(0.0);
123 + plcol0(7);
124 + cplot_drawloccoordgrid(wcsout, xmin, xmax, ymin, ymax);
125 +
126 +@@ -830,7 +830,7 @@
127 + plFree2dGrid(fwhm, nsnap2, nsnap2);
128 + }
129 + plcol0(7);
130 +- plwid(lwid);
131 ++ plwidth((double)lwid);
132 + cplot_drawbounds(wcs, wcsout);
133 + }
134 +
135 +@@ -941,14 +941,14 @@
136 + ymin = 0.5;
137 + ymax = 100.5;
138 + lwid = plotaaflag? ((CPLOT_AAFAC+1)/2) : 1;
139 +- plwid(lwid);
140 ++ plwidth((double)lwid);
141 + plfont(2);
142 + plcol0(15);
143 + plenv((PLFLT)xmin, (PLFLT)xmax, (PLFLT)ymin, (PLFLT)ymax, 1, -1);
144 + sprintf(str, "#uField %.24s: ellipticity map", field->rtcatname);
145 + plschr(0.0, 1.0);
146 + pllab("","", str);
147 +- plwid(0);
148 ++ plwidth(0.0);
149 + plcol0(7);
150 + cplot_drawloccoordgrid(wcsout, xmin, xmax, ymin, ymax);
151 +
152 +@@ -1062,7 +1062,7 @@
153 + plFree2dGrid(ellip, nsnap2, nsnap2);
154 + }
155 + plcol0(7);
156 +- plwid(lwid);
157 ++ plwidth((double)lwid);
158 + cplot_drawbounds(wcs, wcsout);
159 + }
160 +
161 +@@ -1159,14 +1159,14 @@
162 + ymin = 0.5;
163 + ymax = 100.5;
164 + lwid = plotaaflag? ((CPLOT_AAFAC+1)/2) : 1;
165 +- plwid(lwid);
166 ++ plwidth((double)lwid);
167 + plfont(2);
168 + plcol0(15);
169 + plenv((PLFLT)xmin, (PLFLT)xmax, (PLFLT)ymin, (PLFLT)ymax, 1, -1);
170 + sprintf(str, "#uField %.24s: map of Moffat fit residuals", field->rtcatname);
171 + plschr(0.0, 1.0);
172 + pllab("","", str);
173 +- plwid(0);
174 ++ plwidth(0.0);
175 + plcol0(7);
176 + cplot_drawloccoordgrid(wcsout, xmin, xmax, ymin, ymax);
177 +
178 +@@ -1278,7 +1278,7 @@
179 + plFree2dGrid(resi, nsnap2, nsnap2);
180 + }
181 + plcol0(7);
182 +- plwid(lwid);
183 ++ plwidth((double)lwid);
184 + cplot_drawbounds(wcs, wcsout);
185 + }
186 +
187 +@@ -1378,14 +1378,14 @@
188 + ymin = 0.5;
189 + ymax = 100.5;
190 + lwid = plotaaflag? ((CPLOT_AAFAC+1)/2) : 1;
191 +- plwid(lwid);
192 ++ plwidth((double)lwid);
193 + plfont(2);
194 + plcol0(15);
195 + plenv((PLFLT)xmin, (PLFLT)xmax, (PLFLT)ymin, (PLFLT)ymax, 1, -1);
196 + sprintf(str, "#uField %.24s: PSF asymmetry map", field->rtcatname);
197 + plschr(0.0, 1.0);
198 + pllab("","", str);
199 +- plwid(0);
200 ++ plwidth(0.0);
201 + plcol0(7);
202 + cplot_drawloccoordgrid(wcsout, xmin, xmax, ymin, ymax);
203 +
204 +@@ -1497,7 +1497,7 @@
205 + plFree2dGrid(resi, nsnap2, nsnap2);
206 + }
207 + plcol0(7);
208 +- plwid(lwid);
209 ++ plwidth((double)lwid);
210 + cplot_drawbounds(wcs, wcsout);
211 + }
212 +
213 +@@ -1592,14 +1592,14 @@
214 + ymin = 0.5;
215 + ymax = 100.5;
216 + lwid = plotaaflag? ((CPLOT_AAFAC+1)/2) : 1;
217 +- plwid(lwid);
218 ++ plwidth((double)lwid);
219 + plfont(2);
220 + plcol0(15);
221 + plenv((PLFLT)xmin, (PLFLT)xmax, (PLFLT)ymin, (PLFLT)ymax, 1, -1);
222 + sprintf(str, "#uField %.24s: source count map", field->rtcatname);
223 + plschr(0.0, 1.0);
224 + pllab("","", str);
225 +- plwid(0);
226 ++ plwidth(0.0);
227 + plcol0(7);
228 + cplot_drawloccoordgrid(wcsout, xmin, xmax, ymin, ymax);
229 +
230 +@@ -1666,7 +1666,7 @@
231 + clevel, CPLOT_NSHADES, 1, 0, 0, plfill, 0, distort_map, wcsptr);
232 + plFree2dGrid(count, nsnap2, nsnap2);
233 + plcol0(7);
234 +- plwid(lwid);
235 ++ plwidth((double)lwid);
236 + cplot_drawbounds(wcs, wcsout);
237 + }
238 +
239 +@@ -1751,14 +1751,14 @@
240 + ymin = 0.5;
241 + ymax = 100.5;
242 + lwid = plotaaflag? ((CPLOT_AAFAC+1)/2) : 1;
243 +- plwid(lwid);
244 ++ plwidth((double)lwid);
245 + plfont(2);
246 + plcol0(15);
247 + plenv((PLFLT)xmin, (PLFLT)xmax, (PLFLT)ymin, (PLFLT)ymax, 1, -1);
248 + sprintf(str, "#uField %.24s: source count fraction map", field->rtcatname);
249 + plschr(0.0, 1.0);
250 + pllab("","", str);
251 +- plwid(0);
252 ++ plwidth(0.0);
253 + plcol0(7);
254 + cplot_drawloccoordgrid(wcsout, xmin, xmax, ymin, ymax);
255 +
256 +@@ -1826,7 +1826,7 @@
257 + clevel, CPLOT_NSHADES, 1, 0, 0, plfill, 0, distort_map, wcsptr);
258 + plFree2dGrid(count, nsnap2, nsnap2);
259 + plcol0(7);
260 +- plwid(lwid);
261 ++ plwidth((double)lwid);
262 + cplot_drawbounds(wcs, wcsout);
263 + }
264 +
265 +@@ -1911,14 +1911,14 @@
266 + ymin = 0.5;
267 + ymax = 100.5;
268 + lwid = plotaaflag? ((CPLOT_AAFAC+1)/2) : 1;
269 +- plwid(lwid);
270 ++ plwidth((double)lwid);
271 + plfont(2);
272 + plcol0(15);
273 + plenv((PLFLT)xmin, (PLFLT)xmax, (PLFLT)ymin, (PLFLT)ymax, 1, -1);
274 + sprintf(str, "#uField %.24s: #gx#u2#d/d.o.f. map", field->rtcatname);
275 + plschr(0.0, 1.0);
276 + pllab("","", str);
277 +- plwid(0);
278 ++ plwidth(0.0);
279 + plcol0(7);
280 + cplot_drawloccoordgrid(wcsout, xmin, xmax, ymin, ymax);
281 +
282 +@@ -1985,7 +1985,7 @@
283 + clevel, CPLOT_NSHADES, 1, 0, 0, plfill, 0, distort_map, wcsptr);
284 + plFree2dGrid(count, nsnap2, nsnap2);
285 + plcol0(7);
286 +- plwid(lwid);
287 ++ plwidth((double)lwid);
288 + cplot_drawbounds(wcs, wcsout);
289 + }
290 +
291 +@@ -2070,14 +2070,14 @@
292 + ymin = 0.5;
293 + ymax = 100.5;
294 + lwid = plotaaflag? ((CPLOT_AAFAC+1)/2) : 1;
295 +- plwid(lwid);
296 ++ plwidth((double)lwid);
297 + plfont(2);
298 + plcol0(15);
299 + plenv((PLFLT)xmin, (PLFLT)xmax, (PLFLT)ymin, (PLFLT)ymax, 1, -1);
300 + sprintf(str, "#uField %.24s: map of residuals", field->rtcatname);
301 + plschr(0.0, 1.0);
302 + pllab("","", str);
303 +- plwid(0);
304 ++ plwidth(0.0);
305 + plcol0(7);
306 + cplot_drawloccoordgrid(wcsout, xmin, xmax, ymin, ymax);
307 +
308 +@@ -2144,7 +2144,7 @@
309 + clevel, CPLOT_NSHADES, 1, 0, 0, plfill, 0, distort_map, wcsptr);
310 + plFree2dGrid(count, nsnap2, nsnap2);
311 + plcol0(7);
312 +- plwid(lwid);
313 ++ plwidth((double)lwid);
314 + cplot_drawbounds(wcs, wcsout);
315 + }
316 +
317
318 diff --git a/sci-astronomy/psfex/files/psfex-3.17.1-sigbus.patch b/sci-astronomy/psfex/files/psfex-3.17.1-sigbus.patch
319 new file mode 100644
320 index 0000000..2796f63
321 --- /dev/null
322 +++ b/sci-astronomy/psfex/files/psfex-3.17.1-sigbus.patch
323 @@ -0,0 +1,26 @@
324 +Author: Justin Pryzby <justinpryzby@××××××××.net>
325 +Description: (guess) Handle the "sigbus" case only if it exists
326 +--- a/src/fits/fitscleanup.c
327 ++++ b/src/fits/fitscleanup.c
328 +@@ -164,7 +164,9 @@
329 + /* Catch CTRL-Cs */
330 + signal(SIGINT, signal_function);
331 + /* Catch bus errors */
332 ++#ifdef SIGBUS // TODO: what if it is an enum?
333 + signal(SIGBUS, signal_function);
334 ++#endif
335 + /* Catch segmentation faults */
336 + signal(SIGSEGV, signal_function);
337 + /* Catch floating exceptions */
338 +@@ -195,9 +197,11 @@
339 + case SIGINT:
340 + fprintf(stderr, "^C\n");
341 + exit(-1);
342 ++#ifdef SIGBUS
343 + case SIGBUS:
344 + fprintf(stderr, "bus error\n");
345 + exit(-1);
346 ++#endif
347 + case SIGSEGV:
348 + fprintf(stderr, "segmentation fault\n");
349 + exit(-1);
350
351 diff --git a/sci-astronomy/psfex/metadata.xml b/sci-astronomy/psfex/metadata.xml
352 new file mode 100644
353 index 0000000..45b00a7
354 --- /dev/null
355 +++ b/sci-astronomy/psfex/metadata.xml
356 @@ -0,0 +1,17 @@
357 +<?xml version="1.0" encoding="UTF-8"?>
358 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
359 +<pkgmetadata>
360 +<maintainer type="project">
361 + <email>sci-astronomy@g.o</email>
362 + <name>Gentoo Astronomy Project</name>
363 +</maintainer>
364 +<longdescription lang="en">
365 + PSFEx (“PSF Extractor”) extracts models of the Point Spread
366 + Function (PSF) from FITS images processed with <pkg>sci-libs/sextractor</pkg>, and
367 + measures the quality of images. The generated PSF models can be used
368 + for model-fitting photometry or morphological analyses.
369 +</longdescription>
370 +<use>
371 + <flag name="plplot">Build with <pkg>sci-libs/plplot</pkg> to allow diagnostic plots during processing</flag>
372 +</use>
373 +</pkgmetadata>
374
375 diff --git a/sci-astronomy/psfex/psfex-3.17.1.ebuild b/sci-astronomy/psfex/psfex-3.17.1.ebuild
376 new file mode 100644
377 index 0000000..d288e5b
378 --- /dev/null
379 +++ b/sci-astronomy/psfex/psfex-3.17.1.ebuild
380 @@ -0,0 +1,64 @@
381 +# Copyright 1999-2016 Gentoo Foundation
382 +# Distributed under the terms of the GNU General Public License v2
383 +# $Id$
384 +
385 +EAPI=6
386 +
387 +inherit autotools
388 +
389 +DESCRIPTION="Extracts models of the Point Spread Function from FITS images"
390 +HOMEPAGE="http://www.astromatic.net/software/psfex"
391 +SRC_URI="http://www.astromatic.net/download/${PN}/${P}.tar.gz"
392 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
393 +
394 +LICENSE="GPL-3"
395 +SLOT="0"
396 +IUSE="doc threads plplot"
397 +
398 +RDEPEND="
399 + sci-libs/atlas:0[lapack,threads=]
400 + sci-libs/fftw:3.0
401 + plplot? ( sci-libs/plplot:= )"
402 +DEPEND="${RDEPEND}
403 + virtual/pkgconfig"
404 +
405 +PATCHES=(
406 + "${FILESDIR}/${P}-have-mmap.patch"
407 + "${FILESDIR}/${P}-plplot510.patch"
408 + "${FILESDIR}/${P}-sigbus.patch"
409 +)
410 +
411 +src_prepare() {
412 + default
413 + local mycblas=atlcblas myclapack=atlclapack
414 + if use threads; then
415 + [[ -e ${EPREFIX}/usr/$(get_libdir)/libptcblas.so ]] && \
416 + mycblas=ptcblas
417 + [[ -e ${EPREFIX}/usr/$(get_libdir)/libptclapack.so ]] &&
418 + myclapack=ptclapack
419 + fi
420 + # fix the configure and not the acx_atlas.m4. the eautoreconf will
421 + # produce a configure giving a wrong install Makefile target (to fix)
422 + sed -e "s/-lcblas/-l${mycblas}/g" \
423 + -e "s/AC_CHECK_LIB(cblas/AC_CHECK_LIB(${mycblas}/g" \
424 + -e "s/-llapack/-l${myclapack}/g" \
425 + -e "s/\(lapack_lib=\).*/\1${myclapack}/g" \
426 + -e "s/AC_CHECK_LIB(lapack/AC_CHECK_LIB(${myclapack}/g" \
427 + -i acx_atlas.m4 || die
428 +
429 + # fix for newer plplot
430 + sed -e 's/plplotd/plplot/g' -i acx_plplot.m4 || die
431 + eautoreconf
432 +}
433 +
434 +src_configure() {
435 + econf \
436 + --with-atlas-incdir="${EPREFIX}/usr/include/atlas" \
437 + $(use_enable plplot) \
438 + $(use_enable threads)
439 +}
440 +
441 +src_install () {
442 + default
443 + use doc && dodoc doc/*
444 +}