* [gentoo-commits] gentoo-x86 commit in sci-astronomy/kapteyn/files: kapteyn-2.2-debundle_wcs.patch
@ 2012-04-20 14:38 Kacper Kowalik (xarthisius)
0 siblings, 0 replies; 2+ messages in thread
From: Kacper Kowalik (xarthisius) @ 2012-04-20 14:38 UTC (permalink / raw
To: gentoo-commits
xarthisius 12/04/20 14:38:57
Added: kapteyn-2.2-debundle_wcs.patch
Log:
Version bump, debundle wcslib
(Portage version: 2.2.0_alpha96/cvs/Linux x86_64)
Revision Changes Path
1.1 sci-astronomy/kapteyn/files/kapteyn-2.2-debundle_wcs.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-astronomy/kapteyn/files/kapteyn-2.2-debundle_wcs.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-astronomy/kapteyn/files/kapteyn-2.2-debundle_wcs.patch?rev=1.1&content-type=text/plain
Index: kapteyn-2.2-debundle_wcs.patch
===================================================================
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",
^ permalink raw reply [flat|nested] 2+ messages in thread
* [gentoo-commits] gentoo-x86 commit in sci-astronomy/kapteyn/files: kapteyn-2.2-debundle_wcs.patch
@ 2013-04-24 22:32 Sebastien Fabbro (bicatali)
0 siblings, 0 replies; 2+ messages in thread
From: Sebastien Fabbro (bicatali) @ 2013-04-24 22:32 UTC (permalink / raw
To: gentoo-commits
bicatali 13/04/24 22:32:19
Modified: kapteyn-2.2-debundle_wcs.patch
Log:
Switched to distutils-r1 and depend on virtual/pyfits
(Portage version: 2.2.01.21890-prefix/cvs/Linux x86_64, signed Manifest commit with key 0x13CB1360)
Revision Changes Path
1.2 sci-astronomy/kapteyn/files/kapteyn-2.2-debundle_wcs.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-astronomy/kapteyn/files/kapteyn-2.2-debundle_wcs.patch?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-astronomy/kapteyn/files/kapteyn-2.2-debundle_wcs.patch?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-astronomy/kapteyn/files/kapteyn-2.2-debundle_wcs.patch?r1=1.1&r2=1.2
Index: kapteyn-2.2-debundle_wcs.patch
===================================================================
RCS file: /var/cvsroot/gentoo-x86/sci-astronomy/kapteyn/files/kapteyn-2.2-debundle_wcs.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- kapteyn-2.2-debundle_wcs.patch 20 Apr 2012 14:38:57 -0000 1.1
+++ kapteyn-2.2-debundle_wcs.patch 24 Apr 2013 22:32:19 -0000 1.2
@@ -45,7 +45,7 @@
-include_dirs.append(wcslib_dir)
+
+WCSLIB = pkgconfig('wcslib')
-+WCSVERSION = WCSLIB['version'][0]
++WCSVERSION = Popen(["pkg-config --modversion"],stdout=PIPE, shell=True).communicate()[0].split()
+
+include_dirs += WCSLIB['include_dirs']
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-04-24 22:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-24 22:32 [gentoo-commits] gentoo-x86 commit in sci-astronomy/kapteyn/files: kapteyn-2.2-debundle_wcs.patch Sebastien Fabbro (bicatali)
-- strict thread matches above, loose matches on Subject: below --
2012-04-20 14:38 Kacper Kowalik (xarthisius)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox