From fc75115e9cec3f2631140f323191232596ade9a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Fabbro?= Date: Mon, 7 Mar 2016 21:01:33 +0000 Subject: sci-astronomy/sextractor: re-added Package-Manager: portage-2.2.27 --- sci-astronomy/sextractor/Manifest | 1 + .../sextractor-2.19.5-fix-format-errors.patch | 65 +++++++++++++++++++ .../files/sextractor-2.19.5-have-malloc.patch | 32 ++++++++++ .../files/sextractor-2.19.5-have-mmap.patch | 55 ++++++++++++++++ .../files/sextractor-2.19.5-sigbus.patch | 26 ++++++++ sci-astronomy/sextractor/metadata.xml | 22 +++++++ sci-astronomy/sextractor/sextractor-2.19.5.ebuild | 73 ++++++++++++++++++++++ 7 files changed, 274 insertions(+) create mode 100644 sci-astronomy/sextractor/Manifest create mode 100644 sci-astronomy/sextractor/files/sextractor-2.19.5-fix-format-errors.patch create mode 100644 sci-astronomy/sextractor/files/sextractor-2.19.5-have-malloc.patch create mode 100644 sci-astronomy/sextractor/files/sextractor-2.19.5-have-mmap.patch create mode 100644 sci-astronomy/sextractor/files/sextractor-2.19.5-sigbus.patch create mode 100644 sci-astronomy/sextractor/metadata.xml create mode 100644 sci-astronomy/sextractor/sextractor-2.19.5.ebuild (limited to 'sci-astronomy') diff --git a/sci-astronomy/sextractor/Manifest b/sci-astronomy/sextractor/Manifest new file mode 100644 index 000000000000..bf33f0f45c6c --- /dev/null +++ b/sci-astronomy/sextractor/Manifest @@ -0,0 +1 @@ +DIST sextractor-2.19.5.tar.gz 4317039 SHA256 2a880e018585f905300d5919ab454b18640a5bef13deb5c4f03111ac4710b2c5 SHA512 aadd007facad983ea35bd7496a53520f987aa8e492259e428170354d262212e3c1a17c60bf6ea97b6056136b0bd02793e92e14b21cb40a0f8886245eeeac6f4d WHIRLPOOL cf499f4763ebf07d94ccb630030baa1b1e3e03972a9f214ee965c1f742548ee46fa4ce22203d1a6ee7c0817c2915d36483d1a7d7fcc04348beb559f5b5dd4464 diff --git a/sci-astronomy/sextractor/files/sextractor-2.19.5-fix-format-errors.patch b/sci-astronomy/sextractor/files/sextractor-2.19.5-fix-format-errors.patch new file mode 100644 index 000000000000..c20ce31ee30e --- /dev/null +++ b/sci-astronomy/sextractor/files/sextractor-2.19.5-fix-format-errors.patch @@ -0,0 +1,65 @@ +Author: Ole Streicher +Description: Fix format security errors +--- a/src/catout.c ++++ b/src/catout.c +@@ -999,7 +999,7 @@ + break; + + case ASCII_SKYCAT: +- fprintf(ascfile, skycattail); ++ fprintf(ascfile, "%s", skycattail); + if (!prefs.pipe_flag) + fclose(ascfile); + break; +--- a/src/xml.c ++++ b/src/xml.c +@@ -696,7 +696,7 @@ + name, ucd); + break; + case P_STRING: +- sprintf(value, (char *)key[i].ptr); ++ sprintf(value, "%s", (char *)key[i].ptr); + fprintf(file, " \n", + name, ucd, *value? value: " "); +@@ -705,13 +705,13 @@ + n = *(key[i].nlistptr); + if (n) + { +- sprintf(value, ((char **)key[i].ptr)[0]); ++ sprintf(value, "%s", ((char **)key[i].ptr)[0]); + fprintf(file, " \n"); +@@ -722,7 +722,7 @@ + name, ucd); + break; + case P_KEY: +- sprintf(value, key[i].keylist[*((int *)key[i].ptr)]); ++ sprintf(value, "%s", key[i].keylist[*((int *)key[i].ptr)]); + fprintf(file, " \n", + name, ucd, value); +@@ -731,13 +731,13 @@ + n = *(key[i].nlistptr); + if (n) + { +- sprintf(value, key[i].keylist[((int *)key[i].ptr)[0]]); ++ sprintf(value, "%s", key[i].keylist[((int *)key[i].ptr)[0]]); + fprintf(file, " \n"); diff --git a/sci-astronomy/sextractor/files/sextractor-2.19.5-have-malloc.patch b/sci-astronomy/sextractor/files/sextractor-2.19.5-have-malloc.patch new file mode 100644 index 000000000000..dd10d4a2c3cd --- /dev/null +++ b/sci-astronomy/sextractor/files/sextractor-2.19.5-have-malloc.patch @@ -0,0 +1,32 @@ +Author: Justin Pryzby +Description: (guess) Define rpl_malloc if not there. +--- a/src/misc.c ++++ b/src/misc.c +@@ -34,6 +34,8 @@ + #include + #include + ++#include ++ + #include "define.h" + #include "globals.h" + +@@ -153,3 +155,18 @@ + } + + ++#if !HAVE_MALLOC ++#undef malloc ++ ++// Allocate an N-byte block of memory from the heap. If N is zero, ++// allocate a 1-byte block. ++void *rpl_malloc(size_t n) ++{ ++ void *malloc(); ++ if (0==n) { ++ n = 1; ++ } ++ ++ return malloc(n); ++} ++#endif diff --git a/sci-astronomy/sextractor/files/sextractor-2.19.5-have-mmap.patch b/sci-astronomy/sextractor/files/sextractor-2.19.5-have-mmap.patch new file mode 100644 index 000000000000..1b6565089849 --- /dev/null +++ b/sci-astronomy/sextractor/files/sextractor-2.19.5-have-mmap.patch @@ -0,0 +1,55 @@ +Author: Justin Pryzby +Description: (guess) Use mmap only if it exists. +--- a/src/fits/fitsbody.c ++++ b/src/fits/fitsbody.c +@@ -64,9 +64,12 @@ + ***/ + PIXTYPE *alloc_body(tabstruct *tab, void (*func)(PIXTYPE *ptr, int npix)) + { ++#ifdef HAVE_MMAP + FILE *file; + PIXTYPE *buffer; +- size_t npix, size, sizeleft, spoonful; ++ size_t sizeleft, spoonful; ++#endif ++ size_t npix, size; + + if (!body_ramflag) + { +@@ -87,7 +90,9 @@ + /* Decide if the data will go in physical memory or on swap-space */ + npix = tab->tabsize/tab->bytepix; + size = npix*sizeof(PIXTYPE); ++#if !HAVE_MMAP + if (size < body_ramleft) ++#endif + { + /*-- There should be enough RAM left: try to do a malloc() */ + if ((tab->bodybuf = malloc(size))) +@@ -105,6 +110,7 @@ + tab->bodybuf = NULL; + } + ++#if HAVE_MMAP + if (size < body_vramleft) + { + /*-- Convert and copy the data to a swap file, and mmap() it */ +@@ -144,6 +150,7 @@ + return NULL; + return (PIXTYPE *)tab->bodybuf; + } ++#endif + + /* If no memory left at all: forget it! */ + return NULL; +@@ -270,8 +277,10 @@ + size = (tab->tabsize/tab->bytepix)*sizeof(PIXTYPE); + if (tab->swapflag) + { ++#if HAVE_MMAP + if (munmap(tab->bodybuf, size)) + warning("Can't unmap ", tab->cat->filename); ++#endif + tab->swapflag = 0; + tab->bodybuf = NULL; + body_vramleft += size; diff --git a/sci-astronomy/sextractor/files/sextractor-2.19.5-sigbus.patch b/sci-astronomy/sextractor/files/sextractor-2.19.5-sigbus.patch new file mode 100644 index 000000000000..2796f63884e3 --- /dev/null +++ b/sci-astronomy/sextractor/files/sextractor-2.19.5-sigbus.patch @@ -0,0 +1,26 @@ +Author: Justin Pryzby +Description: (guess) Handle the "sigbus" case only if it exists +--- a/src/fits/fitscleanup.c ++++ b/src/fits/fitscleanup.c +@@ -164,7 +164,9 @@ + /* Catch CTRL-Cs */ + signal(SIGINT, signal_function); + /* Catch bus errors */ ++#ifdef SIGBUS // TODO: what if it is an enum? + signal(SIGBUS, signal_function); ++#endif + /* Catch segmentation faults */ + signal(SIGSEGV, signal_function); + /* Catch floating exceptions */ +@@ -195,9 +197,11 @@ + case SIGINT: + fprintf(stderr, "^C\n"); + exit(-1); ++#ifdef SIGBUS + case SIGBUS: + fprintf(stderr, "bus error\n"); + exit(-1); ++#endif + case SIGSEGV: + fprintf(stderr, "segmentation fault\n"); + exit(-1); diff --git a/sci-astronomy/sextractor/metadata.xml b/sci-astronomy/sextractor/metadata.xml new file mode 100644 index 000000000000..87b74a0a93cb --- /dev/null +++ b/sci-astronomy/sextractor/metadata.xml @@ -0,0 +1,22 @@ + + + + +sci-astronomy@gentoo.org +Gentoo Astronomy Project + + + SExtractor (Source Extractor) is a program that builds a catalogue of + objects from an astronomical image. Although it is particularly + oriented towards reduction of large scale galaxy-survey data, it + performs rather well on moderately crowded star fields. It has the + ability to automatically separate stars and galaxy using neural + networks. + + + + Enable profile model fitting, needs sci-libs/atlas + and sci-libs/fftw + + + diff --git a/sci-astronomy/sextractor/sextractor-2.19.5.ebuild b/sci-astronomy/sextractor/sextractor-2.19.5.ebuild new file mode 100644 index 000000000000..ebd8ef33a54b --- /dev/null +++ b/sci-astronomy/sextractor/sextractor-2.19.5.ebuild @@ -0,0 +1,73 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +AUTOTOOLS_AUTO_DEPEND=no + +inherit autotools + +DESCRIPTION="Extract catalogs of sources from astronomical FITS images" +HOMEPAGE="http://www.astromatic.net/software/sextractor" +SRC_URI="http://www.astromatic.net/download/${PN}/${P}.tar.gz" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" + +LICENSE="GPL-3" +SLOT="0" + +IUSE="doc modelfit test threads" + +RDEPEND=" + modelfit? ( sci-libs/atlas[lapack,threads=] sci-libs/fftw:3.0 )" +DEPEND="${RDEPEND} + modelfit? ( ${AUTOTOOLS_DEPEND} )" + +REQUIRED_USE="test? ( modelfit )" + +PATCHES=( + "${FILESDIR}/${P}-fix-format-errors.patch" + "${FILESDIR}/${P}-have-malloc.patch" + "${FILESDIR}/${P}-have-mmap.patch" + "${FILESDIR}/${P}-sigbus.patch" +) + +src_prepare() { + default + if use modelfit; then + local mycblas=atlcblas myclapack=atlclapack + if use threads; then + [[ -e "${EPREFIX}"/usr/$(get_libdir)/libptcblas.so ]] && \ + mycblas=ptcblas + [[ -e "${EPREFIX}"/usr/$(get_libdir)/libptclapack.so ]] && \ + myclapack=ptclapack + fi + sed -i \ + -e "s/-lcblas/-l${mycblas}/g" \ + -e "s/AC_CHECK_LIB(cblas/AC_CHECK_LIB(${mycblas}/g" \ + -e "s/-llapack/-l${myclapack}/g" \ + -e "s/AC_CHECK_LIB(lapack/AC_CHECK_LIB(${myclapack}/g" \ + acx_atlas.m4 || die + eautoreconf + fi +} + +src_configure() { + econf \ + --with-atlas-incdir="${EPREFIX}/usr/include/atlas" \ + $(use_enable modelfit model-fitting) \ + $(use_enable threads) +} + +src_install () { + default + CONFDIR=/usr/share/sextractor + insinto ${CONFDIR} + doins config/* + use doc && dodoc doc/* +} + +pkg_postinst() { + elog "SExtractor examples configuration files are located in" + elog "${EROOT%/}/${CONFDIR} and are not loaded anymore by default." +} -- cgit v1.2.3