[49395] trunk/dports/python/py26-numpy

mcalhoun at macports.org mcalhoun at macports.org
Wed Apr 8 17:55:29 PDT 2009


Revision: 49395
          http://trac.macports.org/changeset/49395
Author:   mcalhoun at macports.org
Date:     2009-04-08 17:55:26 -0700 (Wed, 08 Apr 2009)
Log Message:
-----------
py26-numpy: Fix 32/64-bit universal builds.

Modified Paths:
--------------
    trunk/dports/python/py26-numpy/Portfile

Added Paths:
-----------
    trunk/dports/python/py26-numpy/files/patch-npy_endian.h.diff
    trunk/dports/python/py26-numpy/files/patch-numpyconfig.h.in.diff
    trunk/dports/python/py26-numpy/files/patch-setup.py.diff

Modified: trunk/dports/python/py26-numpy/Portfile
===================================================================
--- trunk/dports/python/py26-numpy/Portfile	2009-04-08 22:55:27 UTC (rev 49394)
+++ trunk/dports/python/py26-numpy/Portfile	2009-04-09 00:55:26 UTC (rev 49395)
@@ -21,7 +21,8 @@
                     rmd160 a75155d2014204e16c59857b92356353505c39b9
 
 patchfiles              patch-g95_link.diff \
-                        patch-f2py_setup.py.diff
+                        patch-f2py_setup.py.diff \
+                        patch-npy_endian.h.diff
 
 depends_lib-append      port:fftw-3 \
                         port:py26-nose
@@ -36,4 +37,8 @@
     ln -s ${python.prefix}/bin/f2py ${destroot}${prefix}/bin/f2py-${branch}
 }
 
+variant universal {
+    patchfiles-append  patch-numpyconfig.h.in.diff patch-setup.py.diff
+}
+
 livecheck.distname      NumPy

Added: trunk/dports/python/py26-numpy/files/patch-npy_endian.h.diff
===================================================================
--- trunk/dports/python/py26-numpy/files/patch-npy_endian.h.diff	                        (rev 0)
+++ trunk/dports/python/py26-numpy/files/patch-npy_endian.h.diff	2009-04-09 00:55:26 UTC (rev 49395)
@@ -0,0 +1,11 @@
+--- numpy/core/include/numpy/npy_endian.h.orig	2009-04-05 04:09:20.000000000 -0400
++++ numpy/core/include/numpy/npy_endian.h	2009-04-08 18:57:06.000000000 -0400
+@@ -25,7 +25,7 @@
+             || defined(NPY_CPU_IA64)
+         #define NPY_LITTLE_ENDIAN
+         #define NPY_BYTE_ORDER 1234
+-    #elif defined(NPY_CPU_PPC) || defined(NPY_CPU_SPARC)\
++    #elif defined(NPY_CPU_PPC) || defined(NPY_CPU_PPC64) || defined(NPY_CPU_SPARC)\
+             || defined(NPY_CPU_S390) || defined(NPY_CPU_PARISC)
+         #define NPY_BIG_ENDIAN
+         #define NPY_BYTE_ORDER 4321

Added: trunk/dports/python/py26-numpy/files/patch-numpyconfig.h.in.diff
===================================================================
--- trunk/dports/python/py26-numpy/files/patch-numpyconfig.h.in.diff	                        (rev 0)
+++ trunk/dports/python/py26-numpy/files/patch-numpyconfig.h.in.diff	2009-04-09 00:55:26 UTC (rev 49395)
@@ -0,0 +1,23 @@
+--- numpy/core/include/numpy/numpyconfig.h.in.orig	2009-04-08 20:41:28.000000000 -0400
++++ numpy/core/include/numpy/numpyconfig.h.in	2009-04-08 20:42:35.000000000 -0400
+@@ -1,10 +1,18 @@
+ #define NPY_SIZEOF_SHORT        @SIZEOF_SHORT@
+ #define NPY_SIZEOF_INT          @SIZEOF_INT@
+-#define NPY_SIZEOF_LONG         @SIZEOF_LONG@
++#ifdef __LP64__
++#define NPY_SIZEOF_LONG         8
++#else
++#define NPY_SIZEOF_LONG         4
++#endif
+ #define NPY_SIZEOF_FLOAT        @SIZEOF_FLOAT@
+ #define NPY_SIZEOF_DOUBLE       @SIZEOF_DOUBLE@
+ #define NPY_SIZEOF_LONGDOUBLE   @SIZEOF_LONG_DOUBLE@
+-#define NPY_SIZEOF_PY_INTPTR_T  @SIZEOF_PY_INTPTR_T@
++#ifdef __LP64__
++#define NPY_SIZEOF_PY_INTPTR_T  8
++#else
++#define NPY_SIZEOF_PY_INTPTR_T  4
++#endif
+ 
+ @DEFINE_NPY_HAVE_DECL_ISNAN@
+ @DEFINE_NPY_HAVE_DECL_ISINF@

Added: trunk/dports/python/py26-numpy/files/patch-setup.py.diff
===================================================================
--- trunk/dports/python/py26-numpy/files/patch-setup.py.diff	                        (rev 0)
+++ trunk/dports/python/py26-numpy/files/patch-setup.py.diff	2009-04-09 00:55:26 UTC (rev 49395)
@@ -0,0 +1,34 @@
+--- numpy/core/setup.py.orig	2009-04-05 04:09:20.000000000 -0400
++++ numpy/core/setup.py	2009-04-08 19:53:45.000000000 -0400
+@@ -309,7 +309,14 @@
+                 if isinstance(d,str):
+                     target_f.write('#define %s\n' % (d))
+                 else:
+-                    target_f.write('#define %s %s\n' % (d[0],d[1]))
++                    if d[0]!='SIZEOF_LONG' and d[0]!='SIZEOF_PY_INTPTR_T':
++                        target_f.write('#define %s %s\n' % (d[0],d[1]))
++                    else:
++                        target_f.write('#ifdef __LP64__\n')
++                        target_f.write('#define %s %s\n' % (d[0],8))
++                        target_f.write('#else\n')
++                        target_f.write('#define %s %s\n' % (d[0],4))
++                        target_f.write('#endif\n')
+ 
+             # define inline to our keyword, or nothing
+             target_f.write('#ifndef __cplusplus\n')
+@@ -393,7 +393,14 @@
+                 if isinstance(d,str):
+                     target_f.write('#define %s\n' % (d))
+                 else:
+-                    target_f.write('#define %s %s\n' % (d[0],d[1]))
++                    if d[0]!='NPY_SIZEOF_LONG' and d[0]!='NPY_SIZEOF_PY_INTPTR_T':
++                        target_f.write('#define %s %s\n' % (d[0],d[1]))
++                    else:
++                        target_f.write('#ifdef __LP64__\n')
++                        target_f.write('#define %s %s\n' % (d[0],8))
++                        target_f.write('#else\n')
++                        target_f.write('#define %s %s\n' % (d[0],4))
++                        target_f.write('#endif\n')
+ 
+             # define NPY_INLINE to recognized keyword
+             target_f.write('#define NPY_INLINE %s\n' % inline)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090408/5baa749d/attachment.html>


More information about the macports-changes mailing list