mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-07-25 21:08:35 -07:00
dev-python/numpy: Clean old versions up
This commit is contained in:
@@ -1,11 +1,7 @@
|
||||
DIST numpy-1.10.1.tar.gz 4048478 SHA256 8b9f453f29ce96a14e625100d3dcf8926301d36c5f622623bf8820e748510858 SHA512 ea717bac913a8e63bf93822bddbfe7701a3de00051bf3c7020f5e22756987becb5a2f96a6a52a36fc7c2b856815a782e450099688ce86b21fa94b0076b9ef376 WHIRLPOOL 7671368bec55c7f53ffa78a509946acc998e6f4223da4f3429b82a5a38b5e0277a0f89773ec2335f8e46b5c695620a4119af5ab59734184054c31b11841de44b
|
||||
DIST numpy-1.10.2.tar.gz 4055005 SHA256 23a3befdf955db4d616f8bb77b324680a80a323e0c42a7e8d7388ef578d8ffa9 SHA512 040db49593f3c53c9b43301eacffc3b5817310f1dbb91fd650efcf5ba65ce7e217549dc5268bc56846f19f1a03dd19470989005aa176531af44d602b3546b007 WHIRLPOOL 30c4b365aac6623241afd72fc30d3a543183205eb23db1366937e39fc50dee862923dd249775fee67cce0199940a57ec1423f1cb0e65ff7c65764c7969d7a76f
|
||||
DIST numpy-1.10.4.tar.gz 4069996 SHA256 7356e98fbcc529e8d540666f5a919912752e569150e9a4f8d869c686f14c720b SHA512 57ace46e357d49be0efd904e5ceb9862c626c916987c8798a12de7ae1e06816ad8483439ac4619792a04889631b5998f2397dc601c78dea33a784b4831c19c79 WHIRLPOOL 76946c2543b1cade06d71f83fd507bd818c1090baa9c3ddda7d1f48d48ed23672c5d9de76db890df990c6d8b7b26b71d3ce733c448943ad4177374a957360d1c
|
||||
DIST numpy-1.11.2.tar.gz 4178447 SHA256 04db2fbd64e2e7c68e740b14402b25af51418fc43a59d9e54172b38b906b0f69 SHA512 c1818de5c8b92cc2a673149f090cc863b484afd29e8a014ffcf8d0f5e70cf8886c7662dbe45847712dec8ae0412d1cb48b13cceefe3e4ec0e85bb20e4beaa46e WHIRLPOOL 668acc8ada165b57e1b2ab76969affa0098a5746c4ca21ae88cd189c5e6f79bde9d05bf951604d0c0f7400174f1e58f17fa0d662029f0b91cff78118fe3cdb0d
|
||||
DIST numpy-1.12.1.zip 4824784 SHA256 a65266a4ad6ec8936a1bc85ce51f8600634a31a258b722c9274a80ff189d9542 SHA512 156319821e4f0cf8d820e977da704aab274b7a4a4b792f6e40d7c0f2827700c990f55f1ca9650523c62c9e937f0e75f336d091d46ca47aaa9875c68fe32bac2a WHIRLPOOL 1ecd1df77d2a64bc6db1910446f60b477ebf5a1cf33ec2e1fced56dbbf1a7df5fef004c7f84f0dccb0ca20ea7ab73c384e4d247eb9700159a18c9a4a51e4db6d
|
||||
DIST numpy-1.8.2.tar.gz 3792998 SHA256 6d487fc724780d66746bde264ea71f5cd77d3a39e52ee2b073dcaed63bc669db SHA512 996e6b8e2d42f223e44660f56bf73eb8ab124f400d89218f8f5e4d7c9860ada44a4d7c54526137b0695c7a10f36e8834fbf0d42b7cb20bcdb5d5c245d673385c WHIRLPOOL 0d3a05b1e3c0a1ceb0a7b4818406dbb45506e5f25bc2727d4ff44cc0a0520e6556b3c68ae24dbca37ba9d67ae2defbb3ff9c906d4c2635b29ed44452d70e8311
|
||||
DIST numpy-1.9.2.tar.gz 3986067 SHA256 325e5f2b0b434ecb6e6882c7e1034cc6cdde3eeeea87dbc482575199a6aeef2a SHA512 70470ebb9afef5dfd0c83ceb7a9d5f1b7a072b1a9b54b04f04f5ed50fbaedd5b4906bd500472268d478f94df9e749a88698b1ff30f2d80258e7f3fec040617d9 WHIRLPOOL 59f5dc52cb95c7ce80fec3a7feac6cfda1d149596bf6d95c18bd8314e31a8df494b2b470c4cc3d8c296c9fc11c718d70d5b9b5344337175ca75496504c0fd201
|
||||
DIST numpy-1.9.3.tar.gz 3984430 SHA256 c3b74d3b9da4ceb11f66abd21e117da8cf584b63a0efbd01a9b7e91b693fbbd6 SHA512 32531cd8d1480a50812454ef8e3b68c0f84b2a4bc5de0df1457070db7f6fd94cdb50e6479a85fa4d1dc569a10d28f6864d5069fcf2a32fa20fa8803476a3df8c WHIRLPOOL a0235594e793625d5e3cef57956f4710587158885f39d7d1267c9845b12fb1d39fb9987ec095720c2d285c7c726383a15471f3629b739b77186470e2c40ba093
|
||||
DIST numpy-html-1.10.1.zip 9663942 SHA256 4af48eb5abf2551f01d85aea7e9a99a30096777f02937dc185b16bb72a110366 SHA512 9d1f3619b801c88604a0495290da4ae8cfb4800257d549214363c554c1dc09a736425d594ed88f492afee6ae7c68fe5c166b9b3a8f24637ea41d67fd23b9d9f9 WHIRLPOOL d6c93e31e31c832fb21f117d03719e0375ee3d27fb6f7975bfcd12469df4a2ed0a25a16bd09a0e2113407446efc220e5bff534f7cd76a715c3d7df26c02f07a1
|
||||
DIST numpy-html-1.11.0.zip 9879611 SHA256 0244bff4b585ab417be963f492e69129e54bb83d630b463591f9e89c62807d85 SHA512 7bf416030c273c767a98d0f23adef0e5fd05f96f6bb911e32ec88821a5bc7c47a2799d33fb0706cb2d391ea6e47b3e0eef0d789eb1c0d81c982cfaa991a09822 WHIRLPOOL d7e81340aa1ec46c2b0d36b76e7a1e11ba7d1b39177a8168efe734936e1622808c8997a8cc22f773b9c3e17b51f5861e11eaf7fa89e9b0c61cae937ee7b5fdba
|
||||
DIST numpy-html-1.8.1.zip 9703711 SHA256 f7fc3af4dba7b40deabd1828a86ea2e2eb5b9fa17c7ebddd73ee4cb8625105b1 SHA512 1d52c657931f4eebb5325159444aedd969b201f5098855058f1ef632dc8677372d632291154ebc3db9869cdb8abf7eb820eade1a9edba2d6be1ae918cb38c071 WHIRLPOOL e502b1416bad4b189773ba98035dfbeed0dc251d8f9b76e336450f14e8425caf92d55d2b1c2cc5ef9eb2d33eb2bf7cd55e720c1b265e45539b195fea1d7f046c
|
||||
|
||||
@@ -1,127 +0,0 @@
|
||||
From 3a816a4db9b498eb64eb837fdcca0fa8ddbe063e Mon Sep 17 00:00:00 2001
|
||||
From: Allan Haldane <allan.haldane@gmail.com>
|
||||
Date: Sat, 17 Oct 2015 14:00:36 -0400
|
||||
Subject: [PATCH] BUG: recarrays viewed as subarrays don't convert to np.record
|
||||
type
|
||||
|
||||
Record array views were updated in #5943 to return np.record dtype
|
||||
where possible, but forgot about the case of sub-arrays.
|
||||
|
||||
That's fixed here, so accessing subarray fields by attribute or index
|
||||
works sensibly, as well as viewing a record array as a subarray dtype,
|
||||
and printing subarrays.
|
||||
|
||||
This also happens to fix #6459, since it affects the same lines.
|
||||
|
||||
Fixes #6497 #6459
|
||||
---
|
||||
numpy/core/records.py | 30 +++++++++++++++++++-----------
|
||||
numpy/core/tests/test_records.py | 23 +++++++++++++++++++++++
|
||||
2 files changed, 42 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/numpy/core/records.py b/numpy/core/records.py
|
||||
index 4a99553..4ce3fe9 100644
|
||||
--- a/numpy/core/records.py
|
||||
+++ b/numpy/core/records.py
|
||||
@@ -448,12 +448,14 @@ def __getattribute__(self, attr):
|
||||
|
||||
# At this point obj will always be a recarray, since (see
|
||||
# PyArray_GetField) the type of obj is inherited. Next, if obj.dtype is
|
||||
- # non-structured, convert it to an ndarray. If obj is structured leave
|
||||
- # it as a recarray, but make sure to convert to the same dtype.type (eg
|
||||
- # to preserve numpy.record type if present), since nested structured
|
||||
- # fields do not inherit type.
|
||||
+ # non-structured, convert it to an ndarray. Then if obj is structured
|
||||
+ # with void type convert it to the same dtype.type (eg to preserve
|
||||
+ # numpy.record type if present), since nested structured fields do not
|
||||
+ # inherit type. Don't do this for non-void structures though.
|
||||
if obj.dtype.fields:
|
||||
- return obj.view(dtype=(self.dtype.type, obj.dtype.fields))
|
||||
+ if issubclass(obj.dtype.type, nt.void):
|
||||
+ return obj.view(dtype=(self.dtype.type, obj.dtype))
|
||||
+ return obj
|
||||
else:
|
||||
return obj.view(ndarray)
|
||||
|
||||
@@ -463,8 +465,9 @@ def __getattribute__(self, attr):
|
||||
# Thus, you can't create attributes on-the-fly that are field names.
|
||||
def __setattr__(self, attr, val):
|
||||
|
||||
- # Automatically convert (void) dtypes to records.
|
||||
- if attr == 'dtype' and issubclass(val.type, nt.void):
|
||||
+ # Automatically convert (void) structured types to records
|
||||
+ # (but not non-void structures, subarrays, or non-structured voids)
|
||||
+ if attr == 'dtype' and issubclass(val.type, nt.void) and val.fields:
|
||||
val = sb.dtype((record, val))
|
||||
|
||||
newattr = attr not in self.__dict__
|
||||
@@ -499,7 +502,9 @@ def __getitem__(self, indx):
|
||||
# we might also be returning a single element
|
||||
if isinstance(obj, ndarray):
|
||||
if obj.dtype.fields:
|
||||
- return obj.view(dtype=(self.dtype.type, obj.dtype.fields))
|
||||
+ if issubclass(obj.dtype.type, nt.void):
|
||||
+ return obj.view(dtype=(self.dtype.type, obj.dtype))
|
||||
+ return obj
|
||||
else:
|
||||
return obj.view(type=ndarray)
|
||||
else:
|
||||
@@ -519,11 +524,14 @@ def __repr__(self):
|
||||
# If this is a full record array (has numpy.record dtype),
|
||||
# or if it has a scalar (non-void) dtype with no records,
|
||||
# represent it using the rec.array function. Since rec.array
|
||||
- # converts dtype to a numpy.record for us, use only dtype.descr,
|
||||
- # not repr(dtype).
|
||||
+ # converts dtype to a numpy.record for us, convert back
|
||||
+ # to non-record before printing
|
||||
+ plain_dtype = self.dtype
|
||||
+ if plain_dtype.type is record:
|
||||
+ plain_dtype = sb.dtype((nt.void, plain_dtype))
|
||||
lf = '\n'+' '*len("rec.array(")
|
||||
return ('rec.array(%s, %sdtype=%s)' %
|
||||
- (lst, lf, repr(self.dtype.descr)))
|
||||
+ (lst, lf, plain_dtype))
|
||||
else:
|
||||
# otherwise represent it using np.array plus a view
|
||||
# This should only happen if the user is playing
|
||||
diff --git a/numpy/core/tests/test_records.py b/numpy/core/tests/test_records.py
|
||||
index 7a18f29..290bc4f 100644
|
||||
--- a/numpy/core/tests/test_records.py
|
||||
+++ b/numpy/core/tests/test_records.py
|
||||
@@ -121,6 +121,23 @@ def test_recarray_views(self):
|
||||
assert_equal(type(rv), np.recarray)
|
||||
assert_equal(rv.dtype.type, np.record)
|
||||
|
||||
+ # check that accessing nested structures keep record type, but
|
||||
+ # not for subarrays, non-void structures, non-structured voids
|
||||
+ test_dtype = [('a', 'f4,f4'), ('b', 'V8'), ('c', ('f4',2)),
|
||||
+ ('d', ('i8', 'i4,i4'))]
|
||||
+ r = np.rec.array([((1,1), b'11111111', [1,1], 1),
|
||||
+ ((1,1), b'11111111', [1,1], 1)], dtype=test_dtype)
|
||||
+ assert_equal(r.a.dtype.type, np.record)
|
||||
+ assert_equal(r.b.dtype.type, np.void)
|
||||
+ assert_equal(r.c.dtype.type, np.float32)
|
||||
+ assert_equal(r.d.dtype.type, np.int64)
|
||||
+ # check the same, but for views
|
||||
+ r = np.rec.array(np.ones(4, dtype='i4,i4'))
|
||||
+ assert_equal(r.view('f4,f4').dtype.type, np.record)
|
||||
+ assert_equal(r.view(('i4',2)).dtype.type, np.int32)
|
||||
+ assert_equal(r.view('V8').dtype.type, np.void)
|
||||
+ assert_equal(r.view(('i8', 'i4,i4')).dtype.type, np.int64)
|
||||
+
|
||||
#check that we can undo the view
|
||||
arrs = [np.ones(4, dtype='f4,i4'), np.ones(4, dtype='f8')]
|
||||
for arr in arrs:
|
||||
@@ -135,6 +152,12 @@ def test_recarray_repr(self):
|
||||
a = np.array(np.ones(4, dtype='f8'))
|
||||
assert_(repr(np.rec.array(a)).startswith('rec.array'))
|
||||
|
||||
+ # check that the 'np.record' part of the dtype isn't shown
|
||||
+ a = np.rec.array(np.ones(3, dtype='i4,i4'))
|
||||
+ assert_equal(repr(a).find('numpy.record'), -1)
|
||||
+ a = np.rec.array(np.ones(3, dtype='i4'))
|
||||
+ assert_(repr(a).find('dtype=int32') != -1)
|
||||
+
|
||||
def test_recarray_from_names(self):
|
||||
ra = np.rec.array([
|
||||
(1, 'abc', 3.7000002861022949, 0),
|
||||
@@ -1,73 +0,0 @@
|
||||
From 0d25dc4175e00cdaf9545e8b1b1a5b879cf67248 Mon Sep 17 00:00:00 2001
|
||||
From: Ethan Kruse <eakruse@uw.edu>
|
||||
Date: Mon, 19 Oct 2015 13:29:01 -0700
|
||||
Subject: [PATCH 1/2] Potential fix for #6462
|
||||
|
||||
---
|
||||
numpy/lib/function_base.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
|
||||
index 555d083..fef69df 100644
|
||||
--- a/numpy/lib/function_base.py
|
||||
+++ b/numpy/lib/function_base.py
|
||||
@@ -3339,7 +3339,7 @@ def _median(a, axis=None, out=None, overwrite_input=False):
|
||||
indexer[axis] = slice(index-1, index+1)
|
||||
|
||||
# Check if the array contains any nan's
|
||||
- if np.issubdtype(a.dtype, np.inexact):
|
||||
+ if np.issubdtype(a.dtype, np.inexact) and sz > 0:
|
||||
# warn and return nans like mean would
|
||||
rout = mean(part[indexer], axis=axis, out=out)
|
||||
part = np.rollaxis(part, axis, part.ndim)
|
||||
|
||||
From 59d859fb2160950ac93267d7461ad952145c8724 Mon Sep 17 00:00:00 2001
|
||||
From: Ethan Kruse <eakruse@uw.edu>
|
||||
Date: Tue, 20 Oct 2015 11:40:49 -0700
|
||||
Subject: [PATCH 2/2] Added tests for median of empty arrays
|
||||
|
||||
---
|
||||
numpy/lib/tests/test_function_base.py | 30 ++++++++++++++++++++++++++++++
|
||||
1 file changed, 30 insertions(+)
|
||||
|
||||
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
|
||||
index 4516c92..aa41c1f 100644
|
||||
--- a/numpy/lib/tests/test_function_base.py
|
||||
+++ b/numpy/lib/tests/test_function_base.py
|
||||
@@ -2597,6 +2597,36 @@ def test_nan_behavior(self):
|
||||
assert_equal(np.median(a, (0, 2)), b)
|
||||
assert_equal(len(w), 1)
|
||||
|
||||
+ def test_empty(self):
|
||||
+ # empty arrays
|
||||
+ a = np.array([], dtype=float)
|
||||
+ with warnings.catch_warnings(record=True) as w:
|
||||
+ warnings.filterwarnings('always', '', RuntimeWarning)
|
||||
+ assert_equal(np.median(a), np.nan)
|
||||
+ assert_(w[0].category is RuntimeWarning)
|
||||
+
|
||||
+ # multiple dimensions
|
||||
+ a = np.array([], dtype=float, ndmin=3)
|
||||
+ # no axis
|
||||
+ with warnings.catch_warnings(record=True) as w:
|
||||
+ warnings.filterwarnings('always', '', RuntimeWarning)
|
||||
+ assert_equal(np.median(a), np.nan)
|
||||
+ assert_(w[0].category is RuntimeWarning)
|
||||
+
|
||||
+ # axis 0 and 1
|
||||
+ b = np.array([], dtype=float, ndmin=2)
|
||||
+ with warnings.catch_warnings(record=True) as w:
|
||||
+ warnings.filterwarnings('always', '', RuntimeWarning)
|
||||
+ assert_equal(np.median(a, axis=0), b)
|
||||
+ assert_equal(np.median(a, axis=1), b)
|
||||
+
|
||||
+ # axis 2
|
||||
+ b = np.array(np.nan, dtype=float, ndmin=2)
|
||||
+ with warnings.catch_warnings(record=True) as w:
|
||||
+ warnings.filterwarnings('always', '', RuntimeWarning)
|
||||
+ assert_equal(np.median(a, axis=2), b)
|
||||
+ assert_(w[0].category is RuntimeWarning)
|
||||
+
|
||||
def test_object(self):
|
||||
o = np.arange(7.)
|
||||
assert_(type(np.median(o.astype(object))), float)
|
||||
@@ -1,71 +0,0 @@
|
||||
--- numpy-1.11.1/numpy/distutils/system_info.py
|
||||
+++ numpy-1.11.1/numpy/distutils/system_info.py
|
||||
@@ -312,26 +312,7 @@
|
||||
1 - display warning message
|
||||
2 - raise error
|
||||
"""
|
||||
- cl = {'atlas': atlas_info, # use lapack_opt or blas_opt instead
|
||||
- 'atlas_threads': atlas_threads_info, # ditto
|
||||
- 'atlas_blas': atlas_blas_info,
|
||||
- 'atlas_blas_threads': atlas_blas_threads_info,
|
||||
- 'lapack_atlas': lapack_atlas_info, # use lapack_opt instead
|
||||
- 'lapack_atlas_threads': lapack_atlas_threads_info, # ditto
|
||||
- 'atlas_3_10': atlas_3_10_info, # use lapack_opt or blas_opt instead
|
||||
- 'atlas_3_10_threads': atlas_3_10_threads_info, # ditto
|
||||
- 'atlas_3_10_blas': atlas_3_10_blas_info,
|
||||
- 'atlas_3_10_blas_threads': atlas_3_10_blas_threads_info,
|
||||
- 'lapack_atlas_3_10': lapack_atlas_3_10_info, # use lapack_opt instead
|
||||
- 'lapack_atlas_3_10_threads': lapack_atlas_3_10_threads_info, # ditto
|
||||
- 'mkl': mkl_info,
|
||||
- # openblas which may or may not have embedded lapack
|
||||
- 'openblas': openblas_info, # use blas_opt instead
|
||||
- # openblas with embedded lapack
|
||||
- 'openblas_lapack': openblas_lapack_info, # use blas_opt instead
|
||||
- 'lapack_mkl': lapack_mkl_info, # use lapack_opt instead
|
||||
- 'blas_mkl': blas_mkl_info, # use blas_opt instead
|
||||
- 'x11': x11_info,
|
||||
+ cl = {'x11': x11_info,
|
||||
'fft_opt': fft_opt_info,
|
||||
'fftw': fftw_info,
|
||||
'fftw2': fftw2_info,
|
||||
@@ -669,10 +650,7 @@
|
||||
return [b for b in [a.strip() for a in libs.split(',')] if b]
|
||||
|
||||
def get_libraries(self, key='libraries'):
|
||||
- if hasattr(self, '_lib_names'):
|
||||
- return self.get_libs(key, default=self._lib_names)
|
||||
- else:
|
||||
- return self.get_libs(key, '')
|
||||
+ return self.get_libs(key, '')
|
||||
|
||||
def library_extensions(self):
|
||||
static_exts = ['.a']
|
||||
@@ -1685,7 +1663,7 @@
|
||||
lib = self.has_cblas(info)
|
||||
if lib is not None:
|
||||
info['language'] = 'c'
|
||||
- info['libraries'] = [lib]
|
||||
+ info['libraries'] = lib
|
||||
info['define_macros'] = [('HAVE_CBLAS', None)]
|
||||
self.set_info(**info)
|
||||
|
||||
@@ -1718,16 +1696,16 @@
|
||||
# check for cblas lib, and if not present check for blas lib.
|
||||
try:
|
||||
c.link_executable(obj, os.path.join(tmpdir, "a.out"),
|
||||
- libraries=["cblas"],
|
||||
+ libraries=info["libraries"],
|
||||
library_dirs=info['library_dirs'],
|
||||
extra_postargs=info.get('extra_link_args', []))
|
||||
- res = "cblas"
|
||||
+ res = info["libraries"]
|
||||
except distutils.ccompiler.LinkError:
|
||||
c.link_executable(obj, os.path.join(tmpdir, "a.out"),
|
||||
libraries=["blas"],
|
||||
library_dirs=info['library_dirs'],
|
||||
extra_postargs=info.get('extra_link_args', []))
|
||||
- res = "blas"
|
||||
+ res = ["blas"]
|
||||
except distutils.ccompiler.CompileError:
|
||||
res = None
|
||||
finally:
|
||||
@@ -1,27 +0,0 @@
|
||||
From 5d0ce36e5be134bb5ead03cab1edeaa60fa355aa Mon Sep 17 00:00:00 2001
|
||||
From: Jonathan Helmus <jjhelmus@gmail.com>
|
||||
Date: Wed, 12 Oct 2016 13:07:42 -0500
|
||||
Subject: [PATCH] BUG: import full module path in npy_load_module
|
||||
|
||||
Use the full module path when importing importlib.machinery for use in the
|
||||
npy_load_module function. Just importing importlib is not sufficient in certain
|
||||
cases, for example Python 3.4.
|
||||
|
||||
closes #8147
|
||||
---
|
||||
numpy/compat/py3k.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/numpy/compat/py3k.py b/numpy/compat/py3k.py
|
||||
index 25cc535..d5bb2e4 100644
|
||||
--- a/numpy/compat/py3k.py
|
||||
+++ b/numpy/compat/py3k.py
|
||||
@@ -118,7 +118,7 @@ def npy_load_module(name, fn, info=None):
|
||||
mod : module
|
||||
|
||||
"""
|
||||
- import importlib
|
||||
+ import importlib.machinery
|
||||
return importlib.machinery.SourceFileLoader(name, fn).load_module()
|
||||
else:
|
||||
def npy_load_module(name, fn, info=None):
|
||||
@@ -1,152 +0,0 @@
|
||||
# Copyright 1999-2017 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=5
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
|
||||
PYTHON_REQ_USE="threads(+)"
|
||||
|
||||
FORTRAN_NEEDED=lapack
|
||||
|
||||
inherit distutils-r1 eutils flag-o-matic fortran-2 multilib multiprocessing toolchain-funcs versionator
|
||||
|
||||
DOC_PV="1.9.1"
|
||||
DOC_P="${PN}-${DOC_PV}"
|
||||
|
||||
DESCRIPTION="Fast array and numerical python library"
|
||||
HOMEPAGE="http://www.numpy.org/"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz
|
||||
doc? (
|
||||
http://docs.scipy.org/doc/${DOC_P}/${PN}-html-${DOC_PV}.zip
|
||||
http://docs.scipy.org/doc/${DOC_P}/${PN}-ref-${DOC_PV}.pdf
|
||||
http://docs.scipy.org/doc/${DOC_P}/${PN}-user-${DOC_PV}.pdf
|
||||
)"
|
||||
# It appears the docs haven't been upgraded, still @ 1.8.1
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
|
||||
IUSE="doc lapack test"
|
||||
|
||||
RDEPEND="
|
||||
dev-python/setuptools[${PYTHON_USEDEP}]
|
||||
lapack? ( virtual/cblas virtual/lapack )"
|
||||
DEPEND="${RDEPEND}
|
||||
doc? ( app-arch/unzip )
|
||||
lapack? ( virtual/pkgconfig )
|
||||
test? ( >=dev-python/nose-1.0[${PYTHON_USEDEP}] )"
|
||||
|
||||
# Uses distutils.command.config.
|
||||
DISTUTILS_IN_SOURCE_BUILD=1
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${PN}-1.9.2-no-hardcode-blas.patch
|
||||
"${FILESDIR}"/${P}-backport-1.patch
|
||||
"${FILESDIR}"/${P}-backport-2.patch
|
||||
)
|
||||
|
||||
src_unpack() {
|
||||
default
|
||||
if use doc; then
|
||||
unzip -qo "${DISTDIR}"/${PN}-html-${DOC_PV}.zip -d html || die
|
||||
fi
|
||||
}
|
||||
|
||||
pc_incdir() {
|
||||
$(tc-getPKG_CONFIG) --cflags-only-I $@ | \
|
||||
sed -e 's/^-I//' -e 's/[ ]*-I/:/g' -e 's/[ ]*$//' -e 's|^:||'
|
||||
}
|
||||
|
||||
pc_libdir() {
|
||||
$(tc-getPKG_CONFIG) --libs-only-L $@ | \
|
||||
sed -e 's/^-L//' -e 's/[ ]*-L/:/g' -e 's/[ ]*$//' -e 's|^:||'
|
||||
}
|
||||
|
||||
pc_libs() {
|
||||
$(tc-getPKG_CONFIG) --libs-only-l $@ | \
|
||||
sed -e 's/[ ]-l*\(pthread\|m\)\([ ]\|$\)//g' \
|
||||
-e 's/^-l//' -e 's/[ ]*-l/,/g' -e 's/[ ]*$//' \
|
||||
| tr ',' '\n' | sort -u | tr '\n' ',' | sed -e 's|,$||'
|
||||
}
|
||||
|
||||
python_prepare_all() {
|
||||
if use lapack; then
|
||||
append-ldflags "$($(tc-getPKG_CONFIG) --libs-only-other cblas lapack)"
|
||||
local libdir="${EPREFIX}"/usr/$(get_libdir)
|
||||
cat >> site.cfg <<-EOF
|
||||
[blas]
|
||||
include_dirs = $(pc_incdir cblas)
|
||||
library_dirs = $(pc_libdir cblas blas):${libdir}
|
||||
blas_libs = $(pc_libs cblas blas)
|
||||
[lapack]
|
||||
library_dirs = $(pc_libdir lapack):${libdir}
|
||||
lapack_libs = $(pc_libs lapack)
|
||||
EOF
|
||||
else
|
||||
export {ATLAS,PTATLAS,BLAS,LAPACK,MKL}=None
|
||||
fi
|
||||
|
||||
export CC="$(tc-getCC) ${CFLAGS}"
|
||||
|
||||
append-flags -fno-strict-aliasing
|
||||
|
||||
# See progress in http://projects.scipy.org/scipy/numpy/ticket/573
|
||||
# with the subtle difference that we don't want to break Darwin where
|
||||
# -shared is not a valid linker argument
|
||||
if [[ ${CHOST} != *-darwin* ]]; then
|
||||
append-ldflags -shared
|
||||
fi
|
||||
|
||||
# only one fortran to link with:
|
||||
# linking with cblas and lapack library will force
|
||||
# autodetecting and linking to all available fortran compilers
|
||||
append-fflags -fPIC
|
||||
if use lapack; then
|
||||
NUMPY_FCONFIG="config_fc --noopt --noarch"
|
||||
# workaround bug 335908
|
||||
[[ $(tc-getFC) == *gfortran* ]] && NUMPY_FCONFIG+=" --fcompiler=gnu95"
|
||||
fi
|
||||
|
||||
# don't version f2py, we will handle it.
|
||||
sed -i -e '/f2py_exe/s:+os\.path.*$::' numpy/f2py/setup.py || die
|
||||
|
||||
# we don't have f2py-3.3
|
||||
sed \
|
||||
-e "/f2py_cmd/s:'f2py'.*:'f2py':g" \
|
||||
-i numpy/tests/test_scripts.py || die
|
||||
|
||||
distutils-r1_python_prepare_all
|
||||
}
|
||||
|
||||
python_compile() {
|
||||
distutils-r1_python_compile -j $(makeopts_jobs) ${NUMPY_FCONFIG}
|
||||
}
|
||||
|
||||
python_test() {
|
||||
distutils_install_for_testing ${NUMPY_FCONFIG}
|
||||
|
||||
cd "${TMPDIR}" || die
|
||||
${EPYTHON} -c "
|
||||
import numpy, sys
|
||||
r = numpy.test(label='full', verbose=3)
|
||||
sys.exit(0 if r.wasSuccessful() else 1)" || die "Tests fail with ${EPYTHON}"
|
||||
}
|
||||
|
||||
python_install() {
|
||||
distutils-r1_python_install ${NUMPY_FCONFIG}
|
||||
}
|
||||
|
||||
python_install_all() {
|
||||
distutils-r1_python_install_all
|
||||
|
||||
dodoc COMPATIBILITY DEV_README.txt THANKS.txt
|
||||
|
||||
if use doc; then
|
||||
dohtml -r "${WORKDIR}"/html/*
|
||||
dodoc "${DISTDIR}"/${PN}-{user,ref}-${DOC_PV}.pdf
|
||||
fi
|
||||
|
||||
# absent in 1.9
|
||||
#docinto f2py
|
||||
#dodoc numpy/f2py/docs/*.txt
|
||||
#doman numpy/f2py/f2py.1
|
||||
}
|
||||
@@ -1,149 +0,0 @@
|
||||
# Copyright 1999-2017 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=5
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
|
||||
PYTHON_REQ_USE="threads(+)"
|
||||
|
||||
FORTRAN_NEEDED=lapack
|
||||
|
||||
inherit distutils-r1 eutils flag-o-matic fortran-2 multilib multiprocessing toolchain-funcs versionator
|
||||
|
||||
DOC_PV="1.10.1"
|
||||
DOC_P="${PN}-${DOC_PV}"
|
||||
|
||||
DESCRIPTION="Fast array and numerical python library"
|
||||
HOMEPAGE="http://www.numpy.org/"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz
|
||||
doc? (
|
||||
http://docs.scipy.org/doc/${DOC_P}/${PN}-html-${DOC_PV}.zip
|
||||
http://docs.scipy.org/doc/${DOC_P}/${PN}-ref-${DOC_PV}.pdf
|
||||
http://docs.scipy.org/doc/${DOC_P}/${PN}-user-${DOC_PV}.pdf
|
||||
)"
|
||||
# It appears the docs haven't been upgraded, still @ 1.8.1
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
|
||||
IUSE="doc lapack test"
|
||||
|
||||
RDEPEND="
|
||||
dev-python/setuptools[${PYTHON_USEDEP}]
|
||||
lapack? ( virtual/cblas virtual/lapack )"
|
||||
DEPEND="${RDEPEND}
|
||||
doc? ( app-arch/unzip )
|
||||
lapack? ( virtual/pkgconfig )
|
||||
test? ( >=dev-python/nose-1.0[${PYTHON_USEDEP}] )"
|
||||
|
||||
# Uses distutils.command.config.
|
||||
DISTUTILS_IN_SOURCE_BUILD=1
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${P}-no-hardcode-blas.patch
|
||||
)
|
||||
|
||||
src_unpack() {
|
||||
default
|
||||
if use doc; then
|
||||
unzip -qo "${DISTDIR}"/${PN}-html-${DOC_PV}.zip -d html || die
|
||||
fi
|
||||
}
|
||||
|
||||
pc_incdir() {
|
||||
$(tc-getPKG_CONFIG) --cflags-only-I $@ | \
|
||||
sed -e 's/^-I//' -e 's/[ ]*-I/:/g' -e 's/[ ]*$//' -e 's|^:||'
|
||||
}
|
||||
|
||||
pc_libdir() {
|
||||
$(tc-getPKG_CONFIG) --libs-only-L $@ | \
|
||||
sed -e 's/^-L//' -e 's/[ ]*-L/:/g' -e 's/[ ]*$//' -e 's|^:||'
|
||||
}
|
||||
|
||||
pc_libs() {
|
||||
$(tc-getPKG_CONFIG) --libs-only-l $@ | \
|
||||
sed -e 's/[ ]-l*\(pthread\|m\)\([ ]\|$\)//g' \
|
||||
-e 's/^-l//' -e 's/[ ]*-l/,/g' -e 's/[ ]*$//' \
|
||||
| tr ',' '\n' | sort -u | tr '\n' ',' | sed -e 's|,$||'
|
||||
}
|
||||
|
||||
python_prepare_all() {
|
||||
if use lapack; then
|
||||
append-ldflags "$($(tc-getPKG_CONFIG) --libs-only-other cblas lapack)"
|
||||
local libdir="${EPREFIX}"/usr/$(get_libdir)
|
||||
cat >> site.cfg <<-EOF
|
||||
[blas]
|
||||
include_dirs = $(pc_incdir cblas)
|
||||
library_dirs = $(pc_libdir cblas blas):${libdir}
|
||||
blas_libs = $(pc_libs cblas blas)
|
||||
[lapack]
|
||||
library_dirs = $(pc_libdir lapack):${libdir}
|
||||
lapack_libs = $(pc_libs lapack)
|
||||
EOF
|
||||
else
|
||||
export {ATLAS,PTATLAS,BLAS,LAPACK,MKL}=None
|
||||
fi
|
||||
|
||||
export CC="$(tc-getCC) ${CFLAGS}"
|
||||
|
||||
append-flags -fno-strict-aliasing
|
||||
|
||||
# See progress in http://projects.scipy.org/scipy/numpy/ticket/573
|
||||
# with the subtle difference that we don't want to break Darwin where
|
||||
# -shared is not a valid linker argument
|
||||
if [[ ${CHOST} != *-darwin* ]]; then
|
||||
append-ldflags -shared
|
||||
fi
|
||||
|
||||
# only one fortran to link with:
|
||||
# linking with cblas and lapack library will force
|
||||
# autodetecting and linking to all available fortran compilers
|
||||
append-fflags -fPIC
|
||||
if use lapack; then
|
||||
NUMPY_FCONFIG="config_fc --noopt --noarch"
|
||||
# workaround bug 335908
|
||||
[[ $(tc-getFC) == *gfortran* ]] && NUMPY_FCONFIG+=" --fcompiler=gnu95"
|
||||
fi
|
||||
|
||||
# # don't version f2py, we will handle it.
|
||||
sed -i -e '/f2py_exe/s: + os\.path.*$::' numpy/f2py/setup.py || die
|
||||
|
||||
# # we don't have f2py-3.3
|
||||
sed \
|
||||
-e 's:test_f2py:_&:g' \
|
||||
-i numpy/tests/test_scripts.py || die
|
||||
|
||||
distutils-r1_python_prepare_all
|
||||
}
|
||||
|
||||
python_compile() {
|
||||
distutils-r1_python_compile -j $(makeopts_jobs) ${NUMPY_FCONFIG}
|
||||
}
|
||||
|
||||
python_test() {
|
||||
distutils_install_for_testing ${NUMPY_FCONFIG}
|
||||
|
||||
cd "${TMPDIR}" || die
|
||||
${EPYTHON} -c "
|
||||
import numpy, sys
|
||||
r = numpy.test(label='full', verbose=3)
|
||||
sys.exit(0 if r.wasSuccessful() else 1)" || die "Tests fail with ${EPYTHON}"
|
||||
}
|
||||
|
||||
python_install() {
|
||||
distutils-r1_python_install ${NUMPY_FCONFIG}
|
||||
}
|
||||
|
||||
python_install_all() {
|
||||
DOCS+=( COMPATIBILITY DEV_README.txt THANKS.txt )
|
||||
|
||||
if use doc; then
|
||||
HTML_DOCS=( "${WORKDIR}"/html/. )
|
||||
DOCS+=( "${DISTDIR}"/${PN}-{user,ref}-${DOC_PV}.pdf )
|
||||
fi
|
||||
|
||||
distutils-r1_python_install_all
|
||||
|
||||
docinto f2py
|
||||
dodoc doc/f2py/*.txt
|
||||
doman doc/f2py/f2py.1
|
||||
}
|
||||
@@ -1,166 +0,0 @@
|
||||
# Copyright 1999-2017 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
|
||||
PYTHON_REQ_USE="threads(+)"
|
||||
|
||||
FORTRAN_NEEDED=lapack
|
||||
|
||||
inherit distutils-r1 flag-o-matic fortran-2 multiprocessing toolchain-funcs versionator
|
||||
|
||||
DOC_PV="1.11.0"
|
||||
DOC_P="${PN}-${DOC_PV}"
|
||||
|
||||
DESCRIPTION="Fast array and numerical python library"
|
||||
HOMEPAGE="http://www.numpy.org/"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz
|
||||
doc? (
|
||||
http://docs.scipy.org/doc/${DOC_P}/${PN}-html-${DOC_PV}.zip
|
||||
http://docs.scipy.org/doc/${DOC_P}/${PN}-ref-${DOC_PV}.pdf
|
||||
http://docs.scipy.org/doc/${DOC_P}/${PN}-user-${DOC_PV}.pdf
|
||||
)"
|
||||
# It appears the docs haven't been upgraded, still @ 1.11.0
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
|
||||
IUSE="doc lapack test"
|
||||
|
||||
RDEPEND="lapack? ( virtual/cblas virtual/lapack )"
|
||||
DEPEND="${RDEPEND}
|
||||
dev-python/setuptools[${PYTHON_USEDEP}]
|
||||
doc? ( app-arch/unzip )
|
||||
lapack? ( virtual/pkgconfig )
|
||||
test? ( >=dev-python/nose-1.0[${PYTHON_USEDEP}] )"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${PN}-1.11.1-no-hardcode-blas.patch
|
||||
"${FILESDIR}"/${PN}-1.11.2-blas_rec_inc_dir.patch
|
||||
# This has been fixed upstream but no new release yet
|
||||
# https://github.com/numpy/numpy/commit/5d0ce36e5be134bb5ead03cab1edeaa60fa355aa
|
||||
"${FILESDIR}"/${P}-import-module-fix.patch
|
||||
)
|
||||
|
||||
src_unpack() {
|
||||
default
|
||||
if use doc; then
|
||||
unzip -qo "${DISTDIR}"/${PN}-html-${DOC_PV}.zip -d html || die
|
||||
fi
|
||||
}
|
||||
|
||||
pc_incdir() {
|
||||
$(tc-getPKG_CONFIG) --cflags-only-I $@ | \
|
||||
sed -e 's/^-I//' -e 's/[ ]*-I/:/g' -e 's/[ ]*$//' -e 's|^:||'
|
||||
}
|
||||
|
||||
pc_libdir() {
|
||||
$(tc-getPKG_CONFIG) --libs-only-L $@ | \
|
||||
sed -e 's/^-L//' -e 's/[ ]*-L/:/g' -e 's/[ ]*$//' -e 's|^:||'
|
||||
}
|
||||
|
||||
pc_libs() {
|
||||
$(tc-getPKG_CONFIG) --libs-only-l $@ | \
|
||||
sed -e 's/[ ]-l*\(pthread\|m\)\([ ]\|$\)//g' \
|
||||
-e 's/^-l//' -e 's/[ ]*-l/,/g' -e 's/[ ]*$//' \
|
||||
| tr ',' '\n' | sort -u | tr '\n' ',' | sed -e 's|,$||'
|
||||
}
|
||||
|
||||
python_prepare_all() {
|
||||
if use lapack; then
|
||||
append-ldflags "$($(tc-getPKG_CONFIG) --libs-only-other cblas lapack)"
|
||||
local libdir="${EPREFIX}"/usr/$(get_libdir)
|
||||
cat >> site.cfg <<-EOF || die
|
||||
[blas]
|
||||
include_dirs = $(pc_incdir cblas)
|
||||
library_dirs = $(pc_libdir cblas blas):${libdir}
|
||||
blas_libs = $(pc_libs cblas blas)
|
||||
[lapack]
|
||||
library_dirs = $(pc_libdir lapack):${libdir}
|
||||
lapack_libs = $(pc_libs lapack)
|
||||
EOF
|
||||
else
|
||||
export {ATLAS,PTATLAS,BLAS,LAPACK,MKL}=None
|
||||
fi
|
||||
|
||||
export CC="$(tc-getCC) ${CFLAGS}"
|
||||
|
||||
append-flags -fno-strict-aliasing
|
||||
|
||||
# See progress in http://projects.scipy.org/scipy/numpy/ticket/573
|
||||
# with the subtle difference that we don't want to break Darwin where
|
||||
# -shared is not a valid linker argument
|
||||
if [[ ${CHOST} != *-darwin* ]]; then
|
||||
append-ldflags -shared
|
||||
fi
|
||||
|
||||
# only one fortran to link with:
|
||||
# linking with cblas and lapack library will force
|
||||
# autodetecting and linking to all available fortran compilers
|
||||
append-fflags -fPIC
|
||||
if use lapack; then
|
||||
NUMPY_FCONFIG="config_fc --noopt --noarch"
|
||||
# workaround bug 335908
|
||||
[[ $(tc-getFC) == *gfortran* ]] && NUMPY_FCONFIG+=" --fcompiler=gnu95"
|
||||
fi
|
||||
|
||||
# don't version f2py, we will handle it.
|
||||
sed -i -e '/f2py_exe/s: + os\.path.*$::' numpy/f2py/setup.py || die
|
||||
|
||||
# we don't have f2py-3.3
|
||||
sed \
|
||||
-e 's:test_f2py:_&:g' \
|
||||
-i numpy/tests/test_scripts.py || die
|
||||
|
||||
# QA bug 590464
|
||||
# The .py files from numpy/core/tests are just added, instead
|
||||
# of being bytecode compiled as a proper subdir package.
|
||||
# We trick the buildsystem into accepting it as a bytecode
|
||||
# package by adding a setup.py and an empty __init__.py
|
||||
#cp numpy/{compat/setup.py,core/tests} || die
|
||||
#touch numpy/core/tests/__init__.py || die
|
||||
#sed \
|
||||
# -e 's:compat:tests:' \
|
||||
# -i numpy/core/tests/setup.py || die
|
||||
#sed \
|
||||
# -e "s:config\.add_data_dir('tests'):config\.add_subpackage('tests'):" \
|
||||
# -i numpy/core/setup.py || die
|
||||
|
||||
distutils-r1_python_prepare_all
|
||||
}
|
||||
|
||||
python_compile() {
|
||||
distutils-r1_python_compile \
|
||||
$(usex python_targets_python3_5 "" "-j $(makeopts_jobs)") \
|
||||
${NUMPY_FCONFIG}
|
||||
}
|
||||
|
||||
python_test() {
|
||||
distutils_install_for_testing --single-version-externally-managed --record "${TMPDIR}/record.txt" ${NUMPY_FCONFIG}
|
||||
|
||||
cd "${TMPDIR}" || die
|
||||
|
||||
${EPYTHON} -c "
|
||||
import numpy, sys
|
||||
r = numpy.test(label='full', verbose=3)
|
||||
sys.exit(0 if r.wasSuccessful() else 1)" || die "Tests fail with ${EPYTHON}"
|
||||
}
|
||||
|
||||
python_install() {
|
||||
distutils-r1_python_install ${NUMPY_FCONFIG}
|
||||
}
|
||||
|
||||
python_install_all() {
|
||||
DOCS+=( THANKS.txt )
|
||||
|
||||
if use doc; then
|
||||
HTML_DOCS=( "${WORKDIR}"/html/. )
|
||||
DOCS+=( "${DISTDIR}"/${PN}-{user,ref}-${DOC_PV}.pdf )
|
||||
fi
|
||||
|
||||
distutils-r1_python_install_all
|
||||
|
||||
docinto f2py
|
||||
dodoc doc/f2py/*.txt
|
||||
doman doc/f2py/f2py.1
|
||||
}
|
||||
@@ -1,146 +0,0 @@
|
||||
# Copyright 1999-2017 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=5
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
|
||||
PYTHON_REQ_USE="threads(+)"
|
||||
|
||||
FORTRAN_NEEDED=lapack
|
||||
|
||||
inherit distutils-r1 eutils flag-o-matic fortran-2 multilib toolchain-funcs versionator
|
||||
|
||||
DOC_PV="1.9.1"
|
||||
DOC_P="${PN}-${DOC_PV}"
|
||||
|
||||
DESCRIPTION="Fast array and numerical python library"
|
||||
HOMEPAGE="http://numpy.scipy.org/"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz
|
||||
doc? (
|
||||
http://docs.scipy.org/doc/${DOC_P}/${PN}-html-${DOC_PV}.zip
|
||||
http://docs.scipy.org/doc/${DOC_P}/${PN}-ref-${DOC_PV}.pdf
|
||||
http://docs.scipy.org/doc/${DOC_P}/${PN}-user-${DOC_PV}.pdf
|
||||
)"
|
||||
# It appears the docs haven't been upgraded, still @ 1.8.1
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
|
||||
IUSE="doc lapack test"
|
||||
|
||||
RDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
|
||||
lapack? ( virtual/cblas virtual/lapack )"
|
||||
DEPEND="${RDEPEND}
|
||||
doc? ( app-arch/unzip )
|
||||
lapack? ( virtual/pkgconfig )
|
||||
test? ( dev-python/nose[${PYTHON_USEDEP}] )"
|
||||
|
||||
# Uses distutils.command.config.
|
||||
DISTUTILS_IN_SOURCE_BUILD=1
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${PN}-1.9.2-no-hardcode-blas.patch
|
||||
)
|
||||
|
||||
src_unpack() {
|
||||
default
|
||||
if use doc; then
|
||||
unzip -qo "${DISTDIR}"/${PN}-html-${DOC_PV}.zip -d html || die
|
||||
fi
|
||||
}
|
||||
|
||||
pc_incdir() {
|
||||
$(tc-getPKG_CONFIG) --cflags-only-I $@ | \
|
||||
sed -e 's/^-I//' -e 's/[ ]*-I/:/g' -e 's/[ ]*$//' -e 's|^:||'
|
||||
}
|
||||
|
||||
pc_libdir() {
|
||||
$(tc-getPKG_CONFIG) --libs-only-L $@ | \
|
||||
sed -e 's/^-L//' -e 's/[ ]*-L/:/g' -e 's/[ ]*$//' -e 's|^:||'
|
||||
}
|
||||
|
||||
pc_libs() {
|
||||
$(tc-getPKG_CONFIG) --libs-only-l $@ | \
|
||||
sed -e 's/[ ]-l*\(pthread\|m\)\([ ]\|$\)//g' \
|
||||
-e 's/^-l//' -e 's/[ ]*-l/,/g' -e 's/[ ]*$//' \
|
||||
| tr ',' '\n' | sort -u | tr '\n' ',' | sed -e 's|,$||'
|
||||
}
|
||||
|
||||
python_prepare_all() {
|
||||
if use lapack; then
|
||||
append-ldflags "$($(tc-getPKG_CONFIG) --libs-only-other cblas lapack)"
|
||||
local libdir="${EPREFIX}"/usr/$(get_libdir)
|
||||
# make sure _dotblas.so gets built
|
||||
sed -i -e '/NO_ATLAS_INFO/,+1d' numpy/core/setup.py || die
|
||||
cat >> site.cfg <<-EOF
|
||||
[blas]
|
||||
include_dirs = $(pc_incdir cblas)
|
||||
library_dirs = $(pc_libdir cblas blas):${libdir}
|
||||
blas_libs = $(pc_libs cblas blas)
|
||||
[lapack]
|
||||
library_dirs = $(pc_libdir lapack):${libdir}
|
||||
lapack_libs = $(pc_libs lapack)
|
||||
EOF
|
||||
else
|
||||
export {ATLAS,PTATLAS,BLAS,LAPACK,MKL}=None
|
||||
fi
|
||||
|
||||
export CC="$(tc-getCC) ${CFLAGS}"
|
||||
|
||||
append-flags -fno-strict-aliasing
|
||||
|
||||
# See progress in http://projects.scipy.org/scipy/numpy/ticket/573
|
||||
# with the subtle difference that we don't want to break Darwin where
|
||||
# -shared is not a valid linker argument
|
||||
if [[ ${CHOST} != *-darwin* ]]; then
|
||||
append-ldflags -shared
|
||||
fi
|
||||
|
||||
# only one fortran to link with:
|
||||
# linking with cblas and lapack library will force
|
||||
# autodetecting and linking to all available fortran compilers
|
||||
append-fflags -fPIC
|
||||
if use lapack; then
|
||||
NUMPY_FCONFIG="config_fc --noopt --noarch"
|
||||
# workaround bug 335908
|
||||
[[ $(tc-getFC) == *gfortran* ]] && NUMPY_FCONFIG+=" --fcompiler=gnu95"
|
||||
fi
|
||||
|
||||
# don't version f2py, we will handle it.
|
||||
sed -i -e '/f2py_exe/s:+os\.path.*$::' numpy/f2py/setup.py || die
|
||||
|
||||
distutils-r1_python_prepare_all
|
||||
}
|
||||
|
||||
python_compile() {
|
||||
distutils-r1_python_compile ${NUMPY_FCONFIG}
|
||||
}
|
||||
|
||||
python_test() {
|
||||
distutils_install_for_testing ${NUMPY_FCONFIG}
|
||||
|
||||
cd "${TMPDIR}" || die
|
||||
${EPYTHON} -c "
|
||||
import numpy, sys
|
||||
r = numpy.test(label='full', verbose=3)
|
||||
sys.exit(0 if r.wasSuccessful() else 1)" || die "Tests fail with ${EPYTHON}"
|
||||
}
|
||||
|
||||
python_install() {
|
||||
distutils-r1_python_install ${NUMPY_FCONFIG}
|
||||
}
|
||||
|
||||
python_install_all() {
|
||||
distutils-r1_python_install_all
|
||||
|
||||
dodoc COMPATIBILITY DEV_README.txt THANKS.txt
|
||||
|
||||
if use doc; then
|
||||
dohtml -r "${WORKDIR}"/html/*
|
||||
dodoc "${DISTDIR}"/${PN}-{user,ref}-${DOC_PV}.pdf
|
||||
fi
|
||||
|
||||
# absent in 1.9
|
||||
#docinto f2py
|
||||
#dodoc numpy/f2py/docs/*.txt
|
||||
#doman numpy/f2py/f2py.1
|
||||
}
|
||||
Reference in New Issue
Block a user