← Back to team overview

dorsal team mailing list archive

Re: [Branch ~dorsal-core/dorsal/main] Rev 385: Add patch for ScientificPython.

 

On Thu, Aug 19, 2010 at 5:40 PM,  <noreply@xxxxxxxxxxxxx> wrote:
> ------------------------------------------------------------
> revno: 385
> committer: Garth N. Wells <garth@linux-c7kd>
> branch nick: dorsal
> timestamp: Thu 2010-08-19 17:37:12 +0100
> message:
>  Add patch for ScientificPython.
>
>  Lib dirs are hard-wired in the provided setup.py, so I've added lib64 to the search path.

I think it is better to use numpy.get_include() to set the path to the
NumPy header files in the ScientificPython setup.py script. I attach a
patch for this that can be used in Dorsal.

Johannes

> added:
>  FEniCS/patches/scientificpython.patch
> modified:
>  FEniCS/packages/scientificpython.package
>  FEniCS/platforms/opensuse11.3.platform
>
>
> --
> lp:dorsal
> https://code.launchpad.net/~dorsal-core/dorsal/main
>
> Your team Dorsal Team is subscribed to branch lp:dorsal.
> To unsubscribe from this branch go to https://code.launchpad.net/~dorsal-core/dorsal/main/+edit-subscription
>
> === modified file 'FEniCS/packages/scientificpython.package'
> --- FEniCS/packages/scientificpython.package    2010-02-02 19:58:39 +0000
> +++ FEniCS/packages/scientificpython.package    2010-08-19 16:37:12 +0000
> @@ -2,3 +2,8 @@
>  SOURCE=http://sourcesup.cru.fr/frs/download.php/2309/
>  PACKING=.tar.gz
>  BUILDCHAIN=python
> +
> +package_specific_setup () {
> +    patch --forward < ${ORIG_DIR}/FEniCS/patches/scientificpython.patch || true
> +}
> +
>
> === added file 'FEniCS/patches/scientificpython.patch'
> --- FEniCS/patches/scientificpython.patch       1970-01-01 00:00:00 +0000
> +++ FEniCS/patches/scientificpython.patch       2010-08-19 16:37:12 +0000
> @@ -0,0 +1,16 @@
> +Only in ScientificPython-2.8_patched: build
> +diff -crB ScientificPython-2.8/setup.py ScientificPython-2.8_patched/setup.py
> +*** ScientificPython-2.8/setup.py      2008-10-28 13:31:44.000000000 +0000
> +--- ScientificPython-2.8_patched/setup.py      2010-08-19 17:20:03.951704369 +0100
> +***************
> +*** 45,50 ****
> +--- 45,53 ----
> +                                   "Lib/site-packages/numpy/core/include")]
> +      else:
> +          arrayobject_h_include = [os.path.join(sys.prefix,
> ++                                   "lib64/python%s.%s/site-packages/numpy/core/include"
> ++                                   % sys.version_info [:2]),
> ++                                 os.path.join(sys.prefix,
> +                                  "lib/python%s.%s/site-packages/numpy/core/include"
> +                                  % sys.version_info [:2])]
> +
>
> === modified file 'FEniCS/platforms/opensuse11.3.platform'
> --- FEniCS/platforms/opensuse11.3.platform      2010-08-19 15:30:59 +0000
> +++ FEniCS/platforms/opensuse11.3.platform      2010-08-19 16:37:12 +0000
> @@ -33,7 +33,7 @@
>  #trilinos
>  #scotch
>  cgal
> -#scientificpython
> +scientificpython
>  fiat
>  #ferari
>  ufc
>
>
>
diff -Nru ScientificPython-2.8.orig/setup.py ScientificPython-2.8/setup.py
--- ScientificPython-2.8.orig/setup.py	2008-10-28 14:31:44.000000000 +0100
+++ ScientificPython-2.8/setup.py	2010-08-20 09:29:16.000000000 +0200
@@ -40,13 +40,17 @@
     extra_compile_args.append("-DNUMARRAY=1")
 else :
     extra_compile_args.append("-DNUMPY=1")
-    if sys.platform == 'win32':
-        arrayobject_h_include = [os.path.join(sys.prefix,
-                                 "Lib/site-packages/numpy/core/include")]
-    else:
-        arrayobject_h_include = [os.path.join(sys.prefix,
-                                "lib/python%s.%s/site-packages/numpy/core/include"
-                                % sys.version_info [:2])]
+    try:
+        import numpy
+        arrayobject_h_include = [numpy.get_include()]
+    except ImportError:
+        if sys.platform == 'win32':
+            arrayobject_h_include = [os.path.join(sys.prefix,
+                                     "Lib/site-packages/numpy/core/include")]
+        else:
+            arrayobject_h_include = [os.path.join(sys.prefix,
+                                     "lib/python%s.%s/site-packages/numpy/core/include"
+                                     % sys.version_info [:2])]
 
 math_libraries = []
 if sys.platform != 'win32':

Follow ups