diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 13:49:04 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 17:38:18 -0700 |
commit | 56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch) | |
tree | 3f91093cdb475e565ae857f1c5a7fd339e2d781e /dev-python/pywcs | |
download | gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2 gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip |
proj/gentoo: Initial commit
This commit represents a new era for Gentoo:
Storing the gentoo-x86 tree in Git, as converted from CVS.
This commit is the start of the NEW history.
Any historical data is intended to be grafted onto this point.
Creation process:
1. Take final CVS checkout snapshot
2. Remove ALL ChangeLog* files
3. Transform all Manifests to thin
4. Remove empty Manifests
5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$
5.1. Do not touch files with -kb/-ko keyword flags.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests
X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project
X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration
X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn
X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts
X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration
X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging
X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'dev-python/pywcs')
-rw-r--r-- | dev-python/pywcs/Manifest | 1 | ||||
-rw-r--r-- | dev-python/pywcs/files/pywcs-1.11-wcslib.patch | 126 | ||||
-rw-r--r-- | dev-python/pywcs/metadata.xml | 10 | ||||
-rw-r--r-- | dev-python/pywcs/pywcs-1.11-r1.ebuild | 41 |
4 files changed, 178 insertions, 0 deletions
diff --git a/dev-python/pywcs/Manifest b/dev-python/pywcs/Manifest new file mode 100644 index 000000000000..2608654411f3 --- /dev/null +++ b/dev-python/pywcs/Manifest @@ -0,0 +1 @@ +DIST pywcs-1.11-4.8.2.tar.gz 2187116 SHA256 61b2d9abf90f4dce2071dfeed1628b487aa32e27b0c01e9983410557db96ac34 SHA512 595cdb910005ef8348eb84d1e0e3db7e5c925d8f44c8f84d8158729d2a9352811a1e1bee49049a91a033503bc9cc8b39c60b1acd526b2fccdd1a8764ec8a7c1e WHIRLPOOL d0c3cd2a428ab1d25594024f3db4f5b586cd1d3d82074828260942e74742602b8c4010cdcb4f73d32d20e71133dae9c7cb5af49e53aab880d404a9ebaf22cb08 diff --git a/dev-python/pywcs/files/pywcs-1.11-wcslib.patch b/dev-python/pywcs/files/pywcs-1.11-wcslib.patch new file mode 100644 index 000000000000..14cd4e3dceab --- /dev/null +++ b/dev-python/pywcs/files/pywcs-1.11-wcslib.patch @@ -0,0 +1,126 @@ +--- defsetup.py ++++ defsetup.py +@@ -78,73 +78,27 @@ + + ###################################################################### + # WCSLIB +-WCSVERSION = "4.8.2" +-WCSLIB = "wcslib" # Path to wcslib +-WCSLIB_PATCHED = "wcslib" +-WCSLIBC = join(WCSLIB_PATCHED, "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', +- 'wcserr.c', +- 'wcsfix.c', +- 'wcshdr.c', +- 'wcsprintf.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() +- +- except ValueError: +- return "long long int" ++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 + +-h_file = StringIO() +-h_file.write(""" +-/* WCSLIB library version number. */ +-#define WCSLIB_VERSION %s +- +-/* 64-bit integer data type. */ +-#define WCSLIB_INT64 %s +-""" % (WCSVERSION, determine_64_bit_int())) +-write_if_different(join(srcroot, 'src', 'wcsconfig.h'), h_file.getvalue()) ++WCSLIB = pkgconfig('wcslib') ++WCSVERSION = Popen(["pkg-config --modversion"],stdout=PIPE, shell=True).communicate()[0].split() + + ###################################################################### + # GENERATE DOCSTRINGS IN C ++ ++###################################################################### + docstrings = {} + with open(join(srcroot, 'doc', 'docstrings.py'), 'rb') as fd: + docstrings_content = fd.read() +@@ -233,7 +186,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), +@@ -282,13 +236,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, +@@ -309,7 +258,6 @@ + 'ext_modules' : PYWCS_EXTENSIONS, + 'data_files' : [ + ( 'pywcs/include', ['src/*.h']), +- ( 'pywcs/include/wcslib', [ WCSLIBC + '/*.h'] ), + ( 'pywcs/tests/maps', ['lib/pywcs/tests/maps/*.hdr']), + ( 'pywcs/tests/spectra', ['lib/pywcs/tests/spectra/*.hdr']), + ( 'pywcs/tests/data', ['lib/pywcs/tests/data/*.hdr']) diff --git a/dev-python/pywcs/metadata.xml b/dev-python/pywcs/metadata.xml new file mode 100644 index 000000000000..380f3bfe46bb --- /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-astronomy</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.11-r1.ebuild b/dev-python/pywcs/pywcs-1.11-r1.ebuild new file mode 100644 index 000000000000..ee7041a6c912 --- /dev/null +++ b/dev-python/pywcs/pywcs-1.11-r1.ebuild @@ -0,0 +1,41 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +PYTHON_COMPAT=( python{2_7,3_3,3_4} ) + +inherit distutils-r1 eutils + +WCS_V=4.8.2 +MYP=${P}-${WCS_V} + +DESCRIPTION="Python routines for handling the FITS World Coordinate System" +HOMEPAGE="https://trac6.assembla.com/astrolib/wiki" +SRC_URI="http://stsdas.stsci.edu/astrolib/${MYP}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +IUSE="" + +DEPEND=" + >=sci-astronomy/wcslib-${WCS_V} + virtual/pkgconfig" +RDEPEND=" + >=sci-astronomy/wcslib-${WCS_V} + virtual/pyfits + !<dev-python/astropy-0.3" + +# missing data to run tests +RESTRICT=test +S="${WORKDIR}/${MYP}" + +python_prepare_all(){ + epatch "${FILESDIR}"/${P}-wcslib.patch +} + +python_test() { + nosetests -w "${BUILD_DIR}"/lib || die "Tests fail with ${EPYTHON}" +} |