diff options
-rw-r--r-- | sci-astronomy/kapteyn/ChangeLog | 8 | ||||
-rw-r--r-- | sci-astronomy/kapteyn/files/kapteyn-2.2-debundle_wcs.patch | 101 | ||||
-rw-r--r-- | sci-astronomy/kapteyn/kapteyn-2.2.ebuild | 38 |
3 files changed, 146 insertions, 1 deletions
diff --git a/sci-astronomy/kapteyn/ChangeLog b/sci-astronomy/kapteyn/ChangeLog index 8efc97dfe675..ebdd1e80cc13 100644 --- a/sci-astronomy/kapteyn/ChangeLog +++ b/sci-astronomy/kapteyn/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sci-astronomy/kapteyn # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sci-astronomy/kapteyn/ChangeLog,v 1.8 2012/02/28 00:44:06 patrick Exp $ +# $Header: /var/cvsroot/gentoo-x86/sci-astronomy/kapteyn/ChangeLog,v 1.9 2012/04/20 14:38:57 xarthisius Exp $ + +*kapteyn-2.2 (20 Apr 2012) + + 20 Apr 2012; Kacper Kowalik <xarthisius@gentoo.org> + +files/kapteyn-2.2-debundle_wcs.patch, +kapteyn-2.2.ebuild: + Version bump, debundle wcslib 28 Feb 2012; Patrick Lauer <patrick@gentoo.org> kapteyn-2.1.ebuild: Restricting pypy and jython diff --git a/sci-astronomy/kapteyn/files/kapteyn-2.2-debundle_wcs.patch b/sci-astronomy/kapteyn/files/kapteyn-2.2-debundle_wcs.patch new file mode 100644 index 000000000000..d657c27bcc53 --- /dev/null +++ b/sci-astronomy/kapteyn/files/kapteyn-2.2-debundle_wcs.patch @@ -0,0 +1,101 @@ +Use system wcslib + +Patch written by Kacper Kowalik <xarthisius@gentoo.org> + +--- a/setup.py ++++ b/setup.py +@@ -3,7 +3,8 @@ + from kapteyn import __version__ as version + from glob import glob + import sys, os +- ++from subprocess import Popen, PIPE ++from re import match + try: + import numpy + except: +@@ -14,21 +15,27 @@ + ''' + sys.exit(1) + +-try: +- wcslib_dir = glob('src/wcslib*/C/')[0] +-except: +- print ''' +--- Error. +-Unable to find WCSLIB source distribution. +-''' +- sys.exit(1) ++def pkgconfig(*packages, **kw): ++ flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'} ++ arg = "--libs --cflags --modversion %s" % ' '.join(packages) ++ for tok in Popen(["pkg-config "+ arg],stdout=PIPE, shell=True).communicate()[0].split(): ++ token = tok.decode("utf-8") ++ if(match("[0-9]",token)): ++ kw.setdefault("version",[]).append(token) ++ else: ++ kw.setdefault(flag_map.get(token[:2]), []).append(token[2:]) ++ return kw + + include_dirs = [] + numdir = os.path.dirname(numpy.__file__) + ipath = os.path.join(numdir, numpy.get_include()) + include_dirs.append(ipath) + include_dirs.append('src') +-include_dirs.append(wcslib_dir) ++ ++WCSLIB = pkgconfig('wcslib') ++WCSVERSION = WCSLIB['version'][0] ++ ++include_dirs += WCSLIB['include_dirs'] + + short_descr = "Kapteyn Package: Python modules for astronomical applications" + +@@ -94,27 +101,6 @@ + "xyz.c" + ] + +-wcslib_src = [ +- "cel.c", +- "lin.c", +- "log.c", +- "prj.c", +- "spc.c", +- "sph.c", +- "spx.c", +- "tab.c", +- "wcs.c", +- "wcsfix.c", +- "wcshdr.c", +- "wcsprintf.c", +- "wcstrig.c", +- "wcsunits.c", +- "wcsutil.c", +- "wcserr.c", +- "flexed/wcsulex.c", +- "flexed/wcsutrn.c" +-] +- + ndimg_src = [ + "nd_image.c", + "ni_filters.c", +@@ -125,8 +111,7 @@ + "ni_support.c", + ] + +-wcs_src = ( ['src/' + source for source in wcsmod_src] +- + [wcslib_dir + source for source in wcslib_src] ) ++wcs_src = ( ['src/' + source for source in wcsmod_src] ) + + _nd_image_src = ['src/ndimg/' + source for source in ndimg_src] + +@@ -168,7 +153,8 @@ + Extension( + "wcs", wcs_src, + include_dirs=include_dirs, +- define_macros=define_macros ++ define_macros=define_macros, ++ libraries=WCSLIB['libraries'] + ), + Extension( + "ascarray", diff --git a/sci-astronomy/kapteyn/kapteyn-2.2.ebuild b/sci-astronomy/kapteyn/kapteyn-2.2.ebuild new file mode 100644 index 000000000000..78b3bb0515d3 --- /dev/null +++ b/sci-astronomy/kapteyn/kapteyn-2.2.ebuild @@ -0,0 +1,38 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-astronomy/kapteyn/kapteyn-2.2.ebuild,v 1.1 2012/04/20 14:38:56 xarthisius Exp $ + +EAPI="3" + +PYTHON_DEPEND="2" +SUPPORT_PYTHON_ABIS="1" +RESTRICT_PYTHON_ABIS="3.* *-jython 2.7-pypy-*" + +inherit eutils distutils + +DESCRIPTION="Collection of python tools for astronomy" +HOMEPAGE="http://www.astro.rug.nl/software/kapteyn" +SRC_URI="http://www.astro.rug.nl/software/kapteyn/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +DEPEND=">=sci-astronomy/wcslib-4.13.4 + dev-python/numpy" +RDEPEND="${DEPEND}" + +PYTHON_CFLAGS=("2.* + -fno-strict-aliasing") +DOCS="CHANGES.txt README.txt" + +src_prepare() { + distutils_src_prepare + epatch "${FILESDIR}"/${P}-debundle_wcs.patch + rm -rf src/wcslib-4.* +} + +src_install() { + distutils_src_install + dodoc doc/${PN}.pdf || die +} |