From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- .../psfex/files/psfex-3.17.1-have-mmap.patch | 55 +++++ .../psfex/files/psfex-3.17.1-plplot510.patch | 221 +++++++++++++++++++++ .../psfex/files/psfex-3.17.1-sigbus.patch | 26 +++ 3 files changed, 302 insertions(+) create mode 100644 sci-astronomy/psfex/files/psfex-3.17.1-have-mmap.patch create mode 100644 sci-astronomy/psfex/files/psfex-3.17.1-plplot510.patch create mode 100644 sci-astronomy/psfex/files/psfex-3.17.1-sigbus.patch (limited to 'sci-astronomy/psfex/files') 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 new file mode 100644 index 000000000000..1b6565089849 --- /dev/null +++ b/sci-astronomy/psfex/files/psfex-3.17.1-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/psfex/files/psfex-3.17.1-plplot510.patch b/sci-astronomy/psfex/files/psfex-3.17.1-plplot510.patch new file mode 100644 index 000000000000..4dd5805a9367 --- /dev/null +++ b/sci-astronomy/psfex/files/psfex-3.17.1-plplot510.patch @@ -0,0 +1,221 @@ +Author: Ole Streicher +Description: Replace deprecated plwid() calls by plwidth(). +--- a/src/cplot.c ++++ b/src/cplot.c +@@ -527,7 +527,7 @@ + + /* Draw meridians */ + plschr(0.0, 0.33); +- plwid(0); ++ plwidth(0.0); + pllsty(2); + xmd = xmu = xdo = -0.5; + ymd = ymu = ydo = -0.5; +@@ -709,14 +709,14 @@ + ymin = 0.5; + ymax = 100.5; + lwid = plotaaflag? ((CPLOT_AAFAC+1)/2) : 1; +- plwid(lwid); ++ plwidth((double)lwid); + plfont(2); + plcol0(15); + plenv((PLFLT)xmin, (PLFLT)xmax, (PLFLT)ymin, (PLFLT)ymax, 1, -1); + sprintf(str, "#uField %.24s: FWHM map", field->rtcatname); + plschr(0.0, 1.0); + pllab("","", str); +- plwid(0); ++ plwidth(0.0); + plcol0(7); + cplot_drawloccoordgrid(wcsout, xmin, xmax, ymin, ymax); + +@@ -830,7 +830,7 @@ + plFree2dGrid(fwhm, nsnap2, nsnap2); + } + plcol0(7); +- plwid(lwid); ++ plwidth((double)lwid); + cplot_drawbounds(wcs, wcsout); + } + +@@ -941,14 +941,14 @@ + ymin = 0.5; + ymax = 100.5; + lwid = plotaaflag? ((CPLOT_AAFAC+1)/2) : 1; +- plwid(lwid); ++ plwidth((double)lwid); + plfont(2); + plcol0(15); + plenv((PLFLT)xmin, (PLFLT)xmax, (PLFLT)ymin, (PLFLT)ymax, 1, -1); + sprintf(str, "#uField %.24s: ellipticity map", field->rtcatname); + plschr(0.0, 1.0); + pllab("","", str); +- plwid(0); ++ plwidth(0.0); + plcol0(7); + cplot_drawloccoordgrid(wcsout, xmin, xmax, ymin, ymax); + +@@ -1062,7 +1062,7 @@ + plFree2dGrid(ellip, nsnap2, nsnap2); + } + plcol0(7); +- plwid(lwid); ++ plwidth((double)lwid); + cplot_drawbounds(wcs, wcsout); + } + +@@ -1159,14 +1159,14 @@ + ymin = 0.5; + ymax = 100.5; + lwid = plotaaflag? ((CPLOT_AAFAC+1)/2) : 1; +- plwid(lwid); ++ plwidth((double)lwid); + plfont(2); + plcol0(15); + plenv((PLFLT)xmin, (PLFLT)xmax, (PLFLT)ymin, (PLFLT)ymax, 1, -1); + sprintf(str, "#uField %.24s: map of Moffat fit residuals", field->rtcatname); + plschr(0.0, 1.0); + pllab("","", str); +- plwid(0); ++ plwidth(0.0); + plcol0(7); + cplot_drawloccoordgrid(wcsout, xmin, xmax, ymin, ymax); + +@@ -1278,7 +1278,7 @@ + plFree2dGrid(resi, nsnap2, nsnap2); + } + plcol0(7); +- plwid(lwid); ++ plwidth((double)lwid); + cplot_drawbounds(wcs, wcsout); + } + +@@ -1378,14 +1378,14 @@ + ymin = 0.5; + ymax = 100.5; + lwid = plotaaflag? ((CPLOT_AAFAC+1)/2) : 1; +- plwid(lwid); ++ plwidth((double)lwid); + plfont(2); + plcol0(15); + plenv((PLFLT)xmin, (PLFLT)xmax, (PLFLT)ymin, (PLFLT)ymax, 1, -1); + sprintf(str, "#uField %.24s: PSF asymmetry map", field->rtcatname); + plschr(0.0, 1.0); + pllab("","", str); +- plwid(0); ++ plwidth(0.0); + plcol0(7); + cplot_drawloccoordgrid(wcsout, xmin, xmax, ymin, ymax); + +@@ -1497,7 +1497,7 @@ + plFree2dGrid(resi, nsnap2, nsnap2); + } + plcol0(7); +- plwid(lwid); ++ plwidth((double)lwid); + cplot_drawbounds(wcs, wcsout); + } + +@@ -1592,14 +1592,14 @@ + ymin = 0.5; + ymax = 100.5; + lwid = plotaaflag? ((CPLOT_AAFAC+1)/2) : 1; +- plwid(lwid); ++ plwidth((double)lwid); + plfont(2); + plcol0(15); + plenv((PLFLT)xmin, (PLFLT)xmax, (PLFLT)ymin, (PLFLT)ymax, 1, -1); + sprintf(str, "#uField %.24s: source count map", field->rtcatname); + plschr(0.0, 1.0); + pllab("","", str); +- plwid(0); ++ plwidth(0.0); + plcol0(7); + cplot_drawloccoordgrid(wcsout, xmin, xmax, ymin, ymax); + +@@ -1666,7 +1666,7 @@ + clevel, CPLOT_NSHADES, 1, 0, 0, plfill, 0, distort_map, wcsptr); + plFree2dGrid(count, nsnap2, nsnap2); + plcol0(7); +- plwid(lwid); ++ plwidth((double)lwid); + cplot_drawbounds(wcs, wcsout); + } + +@@ -1751,14 +1751,14 @@ + ymin = 0.5; + ymax = 100.5; + lwid = plotaaflag? ((CPLOT_AAFAC+1)/2) : 1; +- plwid(lwid); ++ plwidth((double)lwid); + plfont(2); + plcol0(15); + plenv((PLFLT)xmin, (PLFLT)xmax, (PLFLT)ymin, (PLFLT)ymax, 1, -1); + sprintf(str, "#uField %.24s: source count fraction map", field->rtcatname); + plschr(0.0, 1.0); + pllab("","", str); +- plwid(0); ++ plwidth(0.0); + plcol0(7); + cplot_drawloccoordgrid(wcsout, xmin, xmax, ymin, ymax); + +@@ -1826,7 +1826,7 @@ + clevel, CPLOT_NSHADES, 1, 0, 0, plfill, 0, distort_map, wcsptr); + plFree2dGrid(count, nsnap2, nsnap2); + plcol0(7); +- plwid(lwid); ++ plwidth((double)lwid); + cplot_drawbounds(wcs, wcsout); + } + +@@ -1911,14 +1911,14 @@ + ymin = 0.5; + ymax = 100.5; + lwid = plotaaflag? ((CPLOT_AAFAC+1)/2) : 1; +- plwid(lwid); ++ plwidth((double)lwid); + plfont(2); + plcol0(15); + plenv((PLFLT)xmin, (PLFLT)xmax, (PLFLT)ymin, (PLFLT)ymax, 1, -1); + sprintf(str, "#uField %.24s: #gx#u2#d/d.o.f. map", field->rtcatname); + plschr(0.0, 1.0); + pllab("","", str); +- plwid(0); ++ plwidth(0.0); + plcol0(7); + cplot_drawloccoordgrid(wcsout, xmin, xmax, ymin, ymax); + +@@ -1985,7 +1985,7 @@ + clevel, CPLOT_NSHADES, 1, 0, 0, plfill, 0, distort_map, wcsptr); + plFree2dGrid(count, nsnap2, nsnap2); + plcol0(7); +- plwid(lwid); ++ plwidth((double)lwid); + cplot_drawbounds(wcs, wcsout); + } + +@@ -2070,14 +2070,14 @@ + ymin = 0.5; + ymax = 100.5; + lwid = plotaaflag? ((CPLOT_AAFAC+1)/2) : 1; +- plwid(lwid); ++ plwidth((double)lwid); + plfont(2); + plcol0(15); + plenv((PLFLT)xmin, (PLFLT)xmax, (PLFLT)ymin, (PLFLT)ymax, 1, -1); + sprintf(str, "#uField %.24s: map of residuals", field->rtcatname); + plschr(0.0, 1.0); + pllab("","", str); +- plwid(0); ++ plwidth(0.0); + plcol0(7); + cplot_drawloccoordgrid(wcsout, xmin, xmax, ymin, ymax); + +@@ -2144,7 +2144,7 @@ + clevel, CPLOT_NSHADES, 1, 0, 0, plfill, 0, distort_map, wcsptr); + plFree2dGrid(count, nsnap2, nsnap2); + plcol0(7); +- plwid(lwid); ++ plwidth((double)lwid); + cplot_drawbounds(wcs, wcsout); + } + diff --git a/sci-astronomy/psfex/files/psfex-3.17.1-sigbus.patch b/sci-astronomy/psfex/files/psfex-3.17.1-sigbus.patch new file mode 100644 index 000000000000..2796f63884e3 --- /dev/null +++ b/sci-astronomy/psfex/files/psfex-3.17.1-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); -- cgit v1.2.3