[Numpy-svn] r4461 - in branches/numpy.scons/numpy/distutils: command scons/core

numpy-svn at scipy.org numpy-svn at scipy.org
Thu Nov 15 23:35:51 EST 2007


Author: cdavid
Date: 2007-11-15 22:35:30 -0600 (Thu, 15 Nov 2007)
New Revision: 4461

Modified:
   branches/numpy.scons/numpy/distutils/command/scons.py
   branches/numpy.scons/numpy/distutils/scons/core/numpyenv.py
   branches/numpy.scons/numpy/distutils/scons/core/utils.py
Log:
Correctly set path to install scons-built libraries into distutils path

Modified: branches/numpy.scons/numpy/distutils/command/scons.py
===================================================================
--- branches/numpy.scons/numpy/distutils/command/scons.py	2007-11-15 10:42:48 UTC (rev 4460)
+++ branches/numpy.scons/numpy/distutils/command/scons.py	2007-11-16 04:35:30 UTC (rev 4461)
@@ -220,8 +220,9 @@
                 cmd.append(" --jobs=%d" % int(self.jobs))
             cmd.append('src_dir="%s"' % pdirname(sconscript))
             cmd.append('pkg_name="%s"' % pkg_name)
-            cmd.append('distutils_libdir=%s' % protect_path(pjoin(self.build_lib,
-                                                                pdirname(sconscript))))
+            #cmd.append('distutils_libdir=%s' % protect_path(pjoin(self.build_lib,
+            #                                                    pdirname(sconscript))))
+            cmd.append('distutils_libdir=%s' % protect_path(pjoin(self.build_lib)))
 
             if not self._bypass_distutils_cc:
                 cmd.append('cc_opt=%s' % self.scons_compiler)

Modified: branches/numpy.scons/numpy/distutils/scons/core/numpyenv.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/core/numpyenv.py	2007-11-15 10:42:48 UTC (rev 4460)
+++ branches/numpy.scons/numpy/distutils/scons/core/numpyenv.py	2007-11-16 04:35:30 UTC (rev 4461)
@@ -13,6 +13,7 @@
 from custom_builders import NumpySharedLibrary, NumpyCtypes, NumpyPythonExtension
 from libinfo import get_config
 from extension_scons import PythonExtension, built_with_mstools
+from utils import pkg_to_path
 
 import numpy.distutils.scons.tools
 from numpy.distutils.scons.tools.substinfile import TOOL_SUBST
@@ -206,7 +207,7 @@
     # Setting dirs according to command line options
     env.AppendUnique(build_dir = pjoin(env['build_prefix'], env['src_dir']))
     env.AppendUnique(distutils_installdir = pjoin(env['distutils_libdir'], 
-                                                  env['pkg_name']))
+                                                  pkg_to_path(env['pkg_name'])))
 
     #------------------------------------------------
     # Setting tools according to command line options

Modified: branches/numpy.scons/numpy/distutils/scons/core/utils.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/core/utils.py	2007-11-15 10:42:48 UTC (rev 4460)
+++ branches/numpy.scons/numpy/distutils/scons/core/utils.py	2007-11-16 04:35:30 UTC (rev 4461)
@@ -1,5 +1,5 @@
 #! /usr/bin/env python
-# Last Change: Mon Oct 29 07:00 PM 2007 J
+# Last Change: Fri Nov 16 01:00 PM 2007 J
 
 # This module defines various utilities used throughout the scons support
 # library.
@@ -39,6 +39,12 @@
 
     return status, out
 
+def pkg_to_path(pkg_name):
+    """Given a python package name, returns its path from the root.
+
+    Example: numpy.core becomes numpy/core."""
+    return os.sep.join(pkg_name.split('.'))
+
 def get_empty(dict, key):
     """Assuming dict is a dictionary with lists as values, returns an empty
     list if key is not found, or a (deep) copy of the existing value if it




More information about the Numpy-svn mailing list