[oe-commits] org.oe.dev python-numpy: add gross hack to make it build

koen commit oe at amethyst.openembedded.net
Mon Sep 1 18:36:23 UTC 2008


python-numpy: add gross hack to make it build

Author: koen at openembedded.org
Branch: org.openembedded.dev
Revision: c021e71f7b7a73cecfc7558d9fdb15d400d50bc5
ViewMTN: http://monotone.openembedded.org/revision/info/c021e71f7b7a73cecfc7558d9fdb15d400d50bc5
Files:
1
packages/python/python-numpy/arm
packages/python/python-numpy/arm/config.h
packages/python/python-numpy/arm/numpyconfig.h
packages/python/python-numpy/trycompile.diff
packages/python/python-numpy_1.1.1.bb
Diffs:

#
# mt diff -rf25ee9f4905390095da5b802bdeb967b82494c18 -rc021e71f7b7a73cecfc7558d9fdb15d400d50bc5
#
#
#
# add_dir "packages/python/python-numpy/arm"
# 
# add_file "packages/python/python-numpy/arm/config.h"
#  content [49d3ea7ecc913ff768f658cbc3b006329dd908df]
# 
# add_file "packages/python/python-numpy/arm/numpyconfig.h"
#  content [5ef46292cbca23ac1109074f427af9514165c618]
# 
# add_file "packages/python/python-numpy/trycompile.diff"
#  content [c6d78ba02b769b42fc0545f8a98d64c8141b8a2e]
# 
# patch "packages/python/python-numpy_1.1.1.bb"
#  from [bb077493a3e8852e6547319161e595c4622bcfc5]
#    to [35cd7953095f766b2f0497396859da5461a829f8]
#
============================================================
--- packages/python/python-numpy/arm/config.h	49d3ea7ecc913ff768f658cbc3b006329dd908df
+++ packages/python/python-numpy/arm/config.h	49d3ea7ecc913ff768f658cbc3b006329dd908df
@@ -0,0 +1,21 @@
+/* ./src.linux-i686-2.5/numpy/core/include/numpy/config.h */
+/* #define SIZEOF_SHORT 2 */
+/* #define SIZEOF_INT 4 */
+/* #define SIZEOF_LONG 4 */
+/* #define SIZEOF_FLOAT 4 */
+/* #define SIZEOF_DOUBLE 8 */
+#define SIZEOF_LONG_DOUBLE 12
+#define SIZEOF_PY_INTPTR_T 4
+/* #define SIZEOF_LONG_LONG 8 */
+#define SIZEOF_PY_LONG_LONG 8
+/* #define CHAR_BIT 8 */
+#define MATHLIB m
+#define HAVE_FLOAT_FUNCS
+#define HAVE_LOG1P
+#define HAVE_EXPM1
+#define HAVE_INVERSE_HYPERBOLIC
+#define HAVE_INVERSE_HYPERBOLIC_FLOAT
+#define HAVE_ISNAN
+#define HAVE_ISINF
+#define HAVE_RINT
+
============================================================
--- packages/python/python-numpy/arm/numpyconfig.h	5ef46292cbca23ac1109074f427af9514165c618
+++ packages/python/python-numpy/arm/numpyconfig.h	5ef46292cbca23ac1109074f427af9514165c618
@@ -0,0 +1,17 @@
+/* cat ./src.linux-i686-2.5/numpy/core/include/numpy/numpyconfig.h */
+/*
+ *  * This file is generated by numpy/core/setup.pyc. DO NOT EDIT 
+ *   */
+#define NPY_SIZEOF_SHORT 2 
+#define NPY_SIZEOF_INT 4 
+#define NPY_SIZEOF_LONG 4 
+#define NPY_SIZEOF_FLOAT 4 
+#define NPY_SIZEOF_DOUBLE 8 
+#define NPY_SIZEOF_LONGDOUBLE 12 
+#define NPY_SIZEOF_PY_INTPTR_T 4 
+#define NPY_NO_SMP 0
+
+#define NPY_SIZEOF_LONGLONG 8 
+#define NPY_SIZEOF_PY_LONG_LONG 8 
+/* #define CHAR_BIT 8 */
+
============================================================
--- packages/python/python-numpy/trycompile.diff	c6d78ba02b769b42fc0545f8a98d64c8141b8a2e
+++ packages/python/python-numpy/trycompile.diff	c6d78ba02b769b42fc0545f8a98d64c8141b8a2e
@@ -0,0 +1,33 @@
+--- /tmp/setup.py	2008-09-01 10:37:44.000000000 +0200
++++ numpy-1.1.1/numpy/core/setup.py	2008-09-01 10:38:20.373198000 +0200
+@@ -80,8 +80,7 @@
+                 raise SystemError,\
+                       "Non-existing %s. Perhaps you need to install"\
+                       " python-dev|python-devel." % (python_h)
+-            result = config_cmd.try_run(tc,include_dirs=[python_include],
+-                                        library_dirs = default_lib_dirs)
++            result = config_cmd.try_compile(tc)
+             if not result:
+                 raise SystemError,"Failed to test configuration. "\
+                       "See previous error messages for more information."
+@@ -95,7 +94,7 @@
+             if mathlib:
+                 mathlibs_choices.insert(0,mathlib.split(','))
+             for libs in mathlibs_choices:
+-                if config_cmd.try_run(tc,libraries=libs):
++                if config_cmd.try_compile(tc):
+                     mathlibs = libs
+                     break
+             else:
+@@ -180,10 +179,7 @@
+                       " python-dev|python-devel." % (python_h)
+ 
+             config.numpy_include_dirs
+-            result = config_cmd.try_run(testcode,
+-                                include_dirs = [python_include] + \
+-                                                       config.numpy_include_dirs,
+-                                        library_dirs = default_lib_dirs)
++            result = config_cmd.try_compile(testcode)
+ 
+             if not result:
+                 raise SystemError,"Failed to generate numpy configuration. "\
============================================================
--- packages/python/python-numpy_1.1.1.bb	bb077493a3e8852e6547319161e595c4622bcfc5
+++ packages/python/python-numpy_1.1.1.bb	35cd7953095f766b2f0497396859da5461a829f8
@@ -6,13 +6,22 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/numpy/n
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/numpy/numpy-${PV}.tar.gz \
            file://unbreak-assumptions.diff;patch=1 \
-	   "
+	   file://trycompile.diff;patch=1 \
+	   file://config.h \
+	   file://numpyconfig.h \
+	  "
 
 S = "${WORKDIR}/numpy-${PV}"
 
 inherit distutils
 
-do_stage() {
-	cp -pPR Include/Num* ${STAGING_INCDIR}
+# Make the build fail and replace *config.h with proper one
+# This is a ugly, ugly hack - Koen
+do_compile_prepend() {
+         BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+         ${STAGING_BINDIR_NATIVE}/python setup.py build ${DISTUTILS_BUILD_ARGS} || \
+         true
+	 cp ${WORKDIR}/*config.h ${S}/build/$(ls ${S}/build | grep src)/numpy/core/include/numpy/
 }
 
+






More information about the Openembedded-commits mailing list