11import sys
22import os
3- from distutils .core import Distribution
4- from distutils .command .build import build
53
6- Import ('env' , 'GlobSources' )
4+ Import ('env' , 'GlobSources' , 'pyoutput' )
75
86# make sure numpy headers are available
9- from numpy .distutils .misc_util import get_numpy_include_dirs
10- env .AppendUnique (CPPPATH = get_numpy_include_dirs ())
7+ npdirs = pyoutput (
8+ 'from numpy.distutils.misc_util import get_numpy_include_dirs\n '
9+ 'print "\\ n".join(get_numpy_include_dirs())' )
10+ npdirs = map (str .strip , npdirs .split ('\n ' ))
11+ env .AppendUnique (CPPPATH = npdirs )
1112
1213# configure the boost_python library, which may have different extensions
1314if not (GetOption ('clean' ) or env .GetOption ('help' )):
@@ -28,9 +29,14 @@ test = env.Alias('test', develop,
2829AlwaysBuild (test )
2930
3031# normal install - trick distutils into using this module.
31- bcmd = build (Distribution ())
32- bcmd .finalize_options ()
33- distmodfile = os .path .join (bcmd .build_platlib ,
32+ build_platlib = pyoutput ('\n ' .join ([
33+ "from distutils.core import Distribution" ,
34+ "from distutils.command.build import build" ,
35+ "bcmd = build(Distribution())" ,
36+ "bcmd.finalize_options()" ,
37+ "print bcmd.build_platlib" ,
38+ ]))
39+ distmodfile = os .path .join (build_platlib ,
3440 'diffpy' , 'srreal' , os .path .basename (str (module [0 ])))
3541cmd_install = '$python setup.py install'
3642if 'prefix' in env :
0 commit comments