diff options
author | Sebastien Fabbro <bicatali@gentoo.org> | 2010-10-12 23:09:43 +0000 |
---|---|---|
committer | Sebastien Fabbro <bicatali@gentoo.org> | 2010-10-12 23:09:43 +0000 |
commit | ab0845e306b3085766df995785e968fc57b405d0 (patch) | |
tree | 8c322d0f3783812b9f9f5f2c68c828b11140ff07 /dev-python/pywcs | |
parent | Version bump to new bugfix release and remove old. (diff) | |
download | historical-ab0845e306b3085766df995785e968fc57b405d0.tar.gz historical-ab0845e306b3085766df995785e968fc57b405d0.tar.bz2 historical-ab0845e306b3085766df995785e968fc57b405d0.zip |
Initial import to the main tree
Package-Manager: portage-2.2_rc91/cvs/Linux x86_64
Diffstat (limited to 'dev-python/pywcs')
-rw-r--r-- | dev-python/pywcs/ChangeLog | 46 | ||||
-rw-r--r-- | dev-python/pywcs/files/pywcs-1.9-wcslib.patch | 121 | ||||
-rw-r--r-- | dev-python/pywcs/metadata.xml | 10 | ||||
-rw-r--r-- | dev-python/pywcs/pywcs-1.9.ebuild | 48 |
4 files changed, 225 insertions, 0 deletions
diff --git a/dev-python/pywcs/ChangeLog b/dev-python/pywcs/ChangeLog new file mode 100644 index 000000000000..65d43f7d37e5 --- /dev/null +++ b/dev-python/pywcs/ChangeLog @@ -0,0 +1,46 @@ +# ChangeLog for dev-python/pywcs +# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/pywcs/ChangeLog,v 1.1 2010/10/12 23:08:42 bicatali Exp $ + + 12 Oct 2010; Sébastien Fabbro <bicatali@gentoo.org> +pywcs-1.9.ebuild, + +files/pywcs-1.9-wcslib.patch, +metadata.xml: + Initial import to the main tree + +*pywcs-1.9 (17 Aug 2010) + + 17 Aug 2010; Kacper Kowalik <xarthisius@gentoo.org> -pywcs-1.8.1.ebuild, + -files/pywcs-1.8.1-wcslib.patch, +pywcs-1.9.ebuild, + +files/pywcs-1.9-wcslib.patch: + Version bump + + 17 Aug 2010; Kacper Kowalik <xarthisius@gentoo.org> pywcs-1.8.1.ebuild: + Update HOMEPAGE + + 27 Jun 2010; Justin Lecher <jlec@gentoo.org> -pywcs-1.5.1.ebuild, + -pywcs-1.7.ebuild: + Removed old + + 26 Jun 2010; Justin Lecher <jlec@gentoo.org> pywcs-1.8.1.ebuild: + Python ABI fixes + + 28 Apr 2010; Kacper Kowalik (Xarthisius) <xarthisius.kk@gmail.com> + pywcs-1.8.1.ebuild, metadata.xml: + updating dependencies and Python style + +*pywcs-1.8.1 (26 Apr 2010) + + 26 Apr 2010; Kacper Kowalik <xarthisius.kk@gmail.com> +pywcs-1.8.1.ebuild, + +files/pywcs-1.8.1-wcslib.patch: + version bump, removing bundled wcslib + +*pywcs-1.7 (12 Feb 2010) + + 12 Feb 2010; Sébastien Fabbro <bicatali@gentoo.org> +pywcs-1.7.ebuild: + Bump + +*pywcs-1.4.2 (26 Jun 2009) + + 26 Jun 2009; Sébastien Fabbro <bicatali@gentoo.org> +pywcs-1.4.2.ebuild, + +metadata.xml: + Initial import + diff --git a/dev-python/pywcs/files/pywcs-1.9-wcslib.patch b/dev-python/pywcs/files/pywcs-1.9-wcslib.patch new file mode 100644 index 000000000000..1ce9cf59a50a --- /dev/null +++ b/dev-python/pywcs/files/pywcs-1.9-wcslib.patch @@ -0,0 +1,121 @@ +--- defsetup.py.orig 2010-07-21 16:01:17.000000000 +0200 ++++ defsetup.py 2010-08-17 17:20:16.761079432 +0200 +@@ -38,71 +38,26 @@ + + ###################################################################### + # WCSLIB +-WCSVERSION = "4.4.4" +-WCSLIB = "wcslib-%s" % WCSVERSION # Path to wcslib +-WCSLIBC = join(WCSLIB, "C") # Path to wcslib source files +-WCSFILES = [ # List of wcslib files to compile +- 'flexed/wcsbth.c', +- 'flexed/wcspih.c', +- 'flexed/wcsulex.c', +- 'flexed/wcsutrn.c', +- 'cel.c', +- 'lin.c', +- 'log.c', +- 'prj.c', +- 'spc.c', +- 'sph.c', +- 'spx.c', +- 'tab.c', +- 'wcs.c', +- 'wcsfix.c', +- 'wcshdr.c', +- 'wcsunits.c', +- 'wcsutil.c'] +-WCSFILES = [join(WCSLIBC, x) for x in WCSFILES] ++from subprocess import Popen, PIPE ++from re import match + +-###################################################################### +-# WCSLIB CONFIGURATION +- +-# The only configuration parameter needed at compile-time is how to +-# specify a 64-bit signed integer. Python's ctypes module can get us +-# that information, but it is only available in Python 2.5 or later. +-# If we can't be absolutely certain, we default to "long long int", +-# which is correct on most platforms (x86, x86_64). If we find +-# platforms where this heuristic doesn't work, we may need to hardcode +-# for them. +-def determine_64_bit_int(): +- try: +- try: +- import ctypes +- except ImportError: +- raise ValueError() +- +- if ctypes.sizeof(ctypes.c_longlong) == 8: +- return "long long int" +- elif ctypes.sizeof(ctypes.c_long) == 8: +- return "long int" +- elif ctypes.sizeof(ctypes.c_int) == 8: +- return "int" +- else: +- raise ValueError() ++def pkgconfig(*packages, **kw): ++ flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'} ++ arg = "--libs --cflags --modversion %s" % ' '.join(packages) ++ for token in Popen(["pkg-config "+ arg],stdout=PIPE, shell=True).communicate()[0].split(): ++ if(match("[0-9]",token)): ++ kw.setdefault("version",[]).append(token) ++ else: ++ kw.setdefault(flag_map.get(token[:2]), []).append(token[2:]) ++ return kw + +- except ValueError: +- return "long long int" ++WCSLIB = pkgconfig('wcslib') ++WCSVERSION = WCSLIB['version'][0] + + if os.path.exists("pywcs"): + srcroot = 'pywcs' + else: + srcroot = '.' +-fd = open(join(srcroot, 'src', 'wcsconfig.h'), "w") +-fd.write(""" +-/* WCSLIB library version number. */ +-#define WCSLIB_VERSION %s +- +-/* 64-bit integer data type. */ +-#define WCSLIB_INT64 %s +-""" % (WCSVERSION, determine_64_bit_int())) +-fd.close() + + ###################################################################### + # GENERATE DOCSTRINGS IN C +@@ -191,7 +146,8 @@ + + ###################################################################### + # DISTUTILS SETUP +-libraries = [] ++libraries = WCSLIB['libraries'] ++include_dirs = [numpy_include, join(srcroot, "src")] + WCSLIB['include_dirs'] + define_macros = [('ECHO', None), + ('WCSTRIG_MACRO', None), + ('PYWCS_BUILD', None), +@@ -234,13 +190,8 @@ + + PYWCS_EXTENSIONS = [ + Extension('pywcs._pywcs', +- WCSFILES + PYWCS_SOURCES, +- include_dirs = +- [numpy_include, +- join(srcroot, WCSLIBC), +- WCSLIBC, +- join(srcroot, "src") +- ], ++ PYWCS_SOURCES, ++ include_dirs=include_dirs, + define_macros=define_macros, + undef_macros=undef_macros, + extra_compile_args=extra_compile_args, +@@ -260,7 +211,6 @@ + 'ext_modules' : PYWCS_EXTENSIONS, + 'data_files' : [ + ( 'pywcs/include', ['src/*.h']), +- ( 'pywcs/include/wcslib', [ WCSLIBC + '/*.h'] ), + ], + 'package_dir' : {pkg[0]: 'lib', pkg[1]: 'test'}, + } diff --git a/dev-python/pywcs/metadata.xml b/dev-python/pywcs/metadata.xml new file mode 100644 index 000000000000..03c443f53531 --- /dev/null +++ b/dev-python/pywcs/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>sci</herd> +<longdescription lang="en"> + pywcs is a set of routines for handling the FITS World Coordinate + System (WCS) standard. It is a thin wrapper around the high- and + mid-level interfaces for wcslib. +</longdescription> +</pkgmetadata> diff --git a/dev-python/pywcs/pywcs-1.9.ebuild b/dev-python/pywcs/pywcs-1.9.ebuild new file mode 100644 index 000000000000..f4a23eb8d7cc --- /dev/null +++ b/dev-python/pywcs/pywcs-1.9.ebuild @@ -0,0 +1,48 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/pywcs/pywcs-1.9.ebuild,v 1.1 2010/10/12 23:08:42 bicatali Exp $ + +EAPI=3 + +PYTHON_DEPEND="2" +SUPPORT_PYTHON_ABIS="1" + +inherit distutils eutils + +WCS_V=4.4.4 +MYP="${P}-${WCS_V}" + +DESCRIPTION="Python routines for handling the FITS World Coordinate System" +HOMEPAGE="https://trac6.assembla.com/astrolib/wiki http://www.scipy.org/AstroLib" +SRC_URI="http://stsdas.stsci.edu/astrolib/${MYP}.tar.gz" + +IUSE="" +SLOT="0" +KEYWORDS="~amd64 ~x86" +LICENSE="BSD" + +COMMON_DEPEND=">=sci-astronomy/wcslib-${WCS_V}" +DEPEND="${COMMON_DEPEND} + dev-util/pkgconfig" +RDEPEND="${COMMON_DEPEND} + dev-python/pyfits" + +RESTRICT_PYTHON_ABIS="3.*" + +S="${WORKDIR}/${MYP}" + +src_prepare(){ + epatch "${FILESDIR}"/${P}-wcslib.patch +} + +src_test() { + # FIX: does not work, needs fits files + testing() { + PYTHONPATH="$(ls -d build-${PYTHON_ABI}/lib.*)" \ + "$(PYTHON)" test/test.py + } + python_execute_function testing +} + +#FIX: compiles twice (once during build, another time during install) +# seems to be in the defsetup.py hack script |