[pytango] 307/483: changed way to calculate the numpy version used to compile pytango

Sandor Bodo-Merle sbodomerle-guest at moszumanska.debian.org
Thu Sep 28 19:14:53 UTC 2017


This is an automated email from the git hooks/post-receive script.

sbodomerle-guest pushed a commit to annotated tag bliss_8.10
in repository pytango.

commit b89826de748d4f2888c323cacf7a0d154d3da750
Author: tiagocoutinho <tiagocoutinho at 4e9c00fd-8f2e-0410-aa12-93ce3db5e235>
Date:   Tue Nov 19 13:01:02 2013 +0000

    changed way to calculate the numpy version used to compile pytango
    
    git-svn-id: http://svn.code.sf.net/p/tango-cs/code/bindings/PyTango/trunk@24263 4e9c00fd-8f2e-0410-aa12-93ce3db5e235
---
 Makefile                    |  4 +++-
 setup.py                    | 10 ++++++----
 src/boost/cpp/constants.cpp |  2 +-
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index d171dde..baf4e15 100644
--- a/Makefile
+++ b/Makefile
@@ -49,6 +49,8 @@ else
 NUMPY_INC = -I$(NUMPY_ROOT)/include
 endif
 
+PYTANGO_NUMPY_VERSION = \"$(shell $(PY_EXC) -c "import sys, numpy; sys.stdout.write(numpy.__version__)")\"
+
 ifndef prefix
 ifdef user
 _PY_DIR=$(shell $(PY_EXC) -c "import sys, os; sys.stdout.write(os.path.split(os.path.join(os.path.dirname(os.__file__)))[1])")
@@ -129,7 +131,7 @@ INCLUDE_DIRS += \
     $(PY_INC) \
     $(NUMPY_INC)
 
-MACROS := -DNDEBUG -DPYTANGO_HAS_UNIQUE_PTR
+MACROS := -DNDEBUG -DPYTANGO_HAS_UNIQUE_PTR -DPYTANGO_NUMPY_VERSION=$(PYTANGO_NUMPY_VERSION)
 CFLAGS := -pthread -fno-strict-aliasing -fwrapv -Wall -fPIC $(OPTIMIZE_CC) $(MACROS) $(TANGO_CFLAGS) $(INCLUDE_DIRS)
 LNFLAGS := $(LN_DIRS) $(LN_LIBS)
 
diff --git a/setup.py b/setup.py
index 293dde4..bd8d7f4 100644
--- a/setup.py
+++ b/setup.py
@@ -142,8 +142,10 @@ def get_script_files():
     return scripts
 
 
-def add_lib(name, dirs, sys_libs, lib_name=None, inc_suffix=None):
-    ENV = os.environ.get(name.upper() + '_ROOT')
+def add_lib(name, dirs, sys_libs, env_name=None, lib_name=None, inc_suffix=None):
+    if env_name is None:
+        env_name = name.upper() + '_ROOT'
+    ENV = os.environ.get(env_name)
     if lib_name is None:
         lib_name = name
     if ENV is None:
@@ -321,8 +323,6 @@ class install(dftinstall):
 
     
 def main():
-    #ZMQ_ROOT = LOG4TANGO_ROOT = BOOST_ROOT = OMNI_ROOT = TANGO_ROOT = '/usr'
-
     macros = []
     
     directories = dict(include_dirs=[abspath('src', 'boost', 'cpp')],
@@ -369,6 +369,8 @@ def main():
 
     if not has_numpy():
         macros.append(('DISABLE_PYTANGO_NUMPY', None))
+    else:
+        macros.append(('PYTANGO_NUMPY_VERSION', '"' + str(numpy.__version__) + '"'))
 
     if 'posix' in os.name:
         directories = pkg_config(*sys_libs, **directories)
diff --git a/src/boost/cpp/constants.cpp b/src/boost/cpp/constants.cpp
index 8170acb..9717a23 100644
--- a/src/boost/cpp/constants.cpp
+++ b/src/boost/cpp/constants.cpp
@@ -31,7 +31,7 @@ void export_constants()
     consts_scope.attr("NUMPY_VERSION") = "0.0.0";
 #else
     consts_scope.attr("NUMPY_SUPPORT") = true;
-    consts_scope.attr("NUMPY_VERSION") = NPY_VERSION;
+    consts_scope.attr("NUMPY_VERSION") = PYTANGO_NUMPY_VERSION;
 #endif
 
     consts_scope.attr("PY_MAJOR_VERSION") = PY_MAJOR_VERSION;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pytango.git



More information about the debian-science-commits mailing list