From 6c5db88529d31b98829b19bcfa5c6f8bdb70f20b Mon Sep 17 00:00:00 2001 From: Kacper Kowalik Date: Fri, 6 Jan 2012 17:37:02 +0000 Subject: [PATCH] Version bump, adds Python3 support Package-Manager: portage-2.2.0_alpha84/cvs/Linux x86_64 --- dev-python/pywcs/ChangeLog | 10 +- dev-python/pywcs/Manifest | 25 +++- .../pywcs/files/pywcs-1.11-wcslib.patch | 126 ++++++++++++++++++ dev-python/pywcs/pywcs-1.11.ebuild | 46 +++++++ 4 files changed, 199 insertions(+), 8 deletions(-) create mode 100644 dev-python/pywcs/files/pywcs-1.11-wcslib.patch create mode 100644 dev-python/pywcs/pywcs-1.11.ebuild diff --git a/dev-python/pywcs/ChangeLog b/dev-python/pywcs/ChangeLog index 6b818e2e0721..98fe406284aa 100644 --- a/dev-python/pywcs/ChangeLog +++ b/dev-python/pywcs/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for dev-python/pywcs -# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/pywcs/ChangeLog,v 1.2 2011/08/04 18:42:19 bicatali Exp $ +# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/pywcs/ChangeLog,v 1.3 2012/01/06 17:37:02 xarthisius Exp $ + +*pywcs-1.11 (06 Jan 2012) + + 06 Jan 2012; Kacper Kowalik + +files/pywcs-1.11-wcslib.patch, +pywcs-1.11.ebuild: + Version bump, adds Python3 support 04 Aug 2011; Sébastien Fabbro metadata.xml: Switched herd to sci-astronomy diff --git a/dev-python/pywcs/Manifest b/dev-python/pywcs/Manifest index a5b471199bf8..922954a28dc4 100644 --- a/dev-python/pywcs/Manifest +++ b/dev-python/pywcs/Manifest @@ -1,15 +1,28 @@ -----BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 +Hash: SHA256 +AUX pywcs-1.11-wcslib.patch 4183 RMD160 747c24e2dace5421ebbd0b131914ee02a6095d2c SHA1 fa2b6366ab4425dec86c1b38983800fdb19392c9 SHA256 8d7bafb81226060edeaecacb9dc4adb4e142cc64b97c4d53b8244087198438e6 AUX pywcs-1.9-wcslib.patch 3950 RMD160 f0811c8c77097021449e3e8e4c537dba33703862 SHA1 b1e312de9d5e0712f780fee3144beb70085c9867 SHA256 c523d9642300977dd1e69e5185ca176f799caa143eaa79fabb48c453667e9231 +DIST pywcs-1.11-4.8.2.tar.gz 2187116 RMD160 ca76fa03cf77a25613ad1aab86723b469e653924 SHA1 670746ef477cef43cefe488b95f05c70891f1ae0 SHA256 61b2d9abf90f4dce2071dfeed1628b487aa32e27b0c01e9983410557db96ac34 DIST pywcs-1.9-4.4.4.tar.gz 1971894 RMD160 56ec95409e5cf7a836f14f922ee2a0b9df11a290 SHA1 5edb4628ac97f2c3801487c44b6bd186309bf5ba SHA256 b7e6d61280f62228c249e3ebf5799fe012d37a32df4e15eb3bb9d2b23f37f30d +EBUILD pywcs-1.11.ebuild 1100 RMD160 17cdb669319dbfeb0c356e17f24696c68f5b223e SHA1 09f43ef4ad286a6e0a4b972a8770ff93b35d19ee SHA256 1a4f393297c719224ea423f9cdfa1c107a3d1f4a736b9b067df3c591063b2cd1 EBUILD pywcs-1.9.ebuild 1153 RMD160 df3dc1d01199184ad21aebeb1a44858d0a7d51f3 SHA1 0f0c39434efef28545bafcbbd3ba0097f8002145 SHA256 f26acb7bfb917bda61f40bcbf4df4687f7bcfa8d3db0ffdeb537271cc3c3d9b0 -MISC ChangeLog 1530 RMD160 d6b3146b5aa447a76b84a319cbdd22211a3ef7b2 SHA1 a3f7174c99f853cb6fb2a37c4cb18f7af152971c SHA256 9655dcd92eeb55391a6bf54ec9f14ba71f1a53d53b7f725eadc604da7cdfe29b +MISC ChangeLog 1705 RMD160 0f20f53c90a6fae861816e2fd578cadc49120205 SHA1 9b1cb5da7de63461386847721c611348ff2ba6f5 SHA256 0d96e85c0ab3364482160778042385ac23879521296673702d7e6b1e34c8e8bb MISC metadata.xml 384 RMD160 d6b03458d69f1c1c91ee4f35f2ab445652e2247d SHA1 a8c7d08273f126e6f853fb53135ab3212d443674 SHA256 84cfdb26708fbfad4b807b2527dc4599d0e3b3e118ce07b85ee5638d8c5b6bc3 -----BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.17 (GNU/Linux) +Version: GnuPG v2.0.18 (GNU/Linux) -iEYEARECAAYFAk466BMACgkQ1ycZbhPLE2CaGgCfZj9Bzdt9UtGhQeHp1F34DB4j -qoYAni1svBuJt795O/daIZaGuQA/uoBt -=TtvH +iQIcBAEBCAAGBQJPBzFIAAoJEF0huFKJUZL5bMMP/Ay7/ItMCGWKeR4fZxWokGSo +04VeDnr8CinBBjDr4Td6RSOf0+izP1oegT31HWJTfrNhpiGDNkEYvrELVNR6AIUj +hmG7W9ixhe9jrUz1lYFHkrSG0sCz++hvLjwR5JBR/Dy/srcSWMvLQWjYsl6TwKiE +wJ8miAAfx9y4hFpUU0RxvJPfHOxd+2zoJ8ykadT5mXU1437e0/dRGC/G+eBUMgRg +zpPAhN4eo0IuSQ7SBmHxOOF6uuhqsRInGkKQ/waCB9q0545kg0c5OtqZDjI1W3lp +T4FUlRENsiS2zT7MZKeSJ+W2naE0PIZryUOk1sw8y/qZt4gL2yaj6sTKlIIhNyst +/AtnuRVbvCRGaOJNduVikJpS+cxg/risU4TCjzt2ZPJ+sgfTc783ruwMBRwLXLgH +pp+reF0gsVIyp7upVMUDfJ0fcwVGaKKH7VgHosk6UBsWbWj8uN6y7s4eMVF/yD7q +6HuyOzfroHBdOYzJOi19svpAJ1dJlxd3AnMAoDxKs3w7wtcN9TktO/t61HOs7GJg +z/87JcLbY5EgZ2mEMlOUbjPMCLswYkyUzoNTRvGjkyhyzFhnAn3dZIKp2laJsYed +o4g3i8loYoKAAFlaZn6czLFphdf3vS2P9dO6BPqbOHSI+7YjHwY9urFISHcjsqV4 +1ultgmcxQ7VGqCw/uFQb +=UJEj -----END PGP SIGNATURE----- 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..2dd198677307 --- /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 = WCSLIB['version'][0] + + ###################################################################### + # 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/pywcs-1.11.ebuild b/dev-python/pywcs/pywcs-1.11.ebuild new file mode 100644 index 000000000000..9d354b05a1ee --- /dev/null +++ b/dev-python/pywcs/pywcs-1.11.ebuild @@ -0,0 +1,46 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/pywcs/pywcs-1.11.ebuild,v 1.1 2012/01/06 17:37:02 xarthisius Exp $ + +EAPI=4 + +PYTHON_DEPEND="*" +SUPPORT_PYTHON_ABIS="1" + +inherit distutils 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 http://www.scipy.org/AstroLib" +SRC_URI="http://stsdas.stsci.edu/astrolib/${MYP}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +CDEPEND=">=sci-astronomy/wcslib-${WCS_V}" +DEPEND="${CDEPEND} + dev-util/pkgconfig" +RDEPEND="${CDEPEND} + dev-python/pyfits" + +S=${WORKDIR}/${MYP} + +src_prepare(){ + epatch "${FILESDIR}"/${P}-wcslib.patch + distutils_src_prepare +} + +src_test() { + testing() { + PYTHONPATH="$(ls -d build-${PYTHON_ABI}/lib.*)" \ + "$(PYTHON)" lib/${PN}/tests/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 -- 2.26.2