1
1
import sys
2
2
import os
3
- from distutils .core import Distribution
4
- from distutils .command .build import build
5
3
6
- Import ('env' )
4
+ Import ('env' , 'pyoutput' )
7
5
8
6
# 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 )
11
12
12
13
# configure the boost_python library, which may have different extensions
13
14
if not (GetOption ('clean' ) or env .GetOption ('help' )):
@@ -28,9 +29,14 @@ test = env.Alias('test', develop,
28
29
AlwaysBuild (test )
29
30
30
31
# 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 ,
34
40
'pyobjcryst' , os .path .basename (str (module [0 ])))
35
41
cmd_install = '$python setup.py install'
36
42
if 'prefix' in env :
0 commit comments