boost: add numpy support
Not built by default. Also add enablePython flag (enabled by default) and cleanup a bit.
This commit is contained in:
parent
e2a7f508fc
commit
b1e499788c
@ -9,6 +9,8 @@
|
|||||||
, enableStatic ? !enableShared
|
, enableStatic ? !enableShared
|
||||||
, enablePIC ? false
|
, enablePIC ? false
|
||||||
, enableExceptions ? false
|
, enableExceptions ? false
|
||||||
|
, enablePython ? hostPlatform == buildPlatform
|
||||||
|
, enableNumpy ? false, numpy ? null
|
||||||
, taggedLayout ? ((enableRelease && enableDebug) || (enableSingleThreaded && enableMultiThreaded) || (enableShared && enableStatic))
|
, taggedLayout ? ((enableRelease && enableDebug) || (enableSingleThreaded && enableMultiThreaded) || (enableShared && enableStatic))
|
||||||
, patches ? null
|
, patches ? null
|
||||||
, mpi ? null
|
, mpi ? null
|
||||||
@ -21,6 +23,9 @@
|
|||||||
# We must build at least one type of libraries
|
# We must build at least one type of libraries
|
||||||
assert !enableShared -> enableStatic;
|
assert !enableShared -> enableStatic;
|
||||||
|
|
||||||
|
assert enablePython -> hostPlatform == buildPlatform;
|
||||||
|
assert enableNumpy -> enablePython;
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
let
|
let
|
||||||
|
|
||||||
@ -62,7 +67,8 @@ let
|
|||||||
] ++ optional (link != "static") "runtime-link=${runtime-link}" ++ [
|
] ++ optional (link != "static") "runtime-link=${runtime-link}" ++ [
|
||||||
"link=${link}"
|
"link=${link}"
|
||||||
"${cflags}"
|
"${cflags}"
|
||||||
] ++ optional (variant == "release") "debug-symbols=off";
|
] ++ optional (variant == "release") "debug-symbols=off"
|
||||||
|
++ optional (!enablePython) "--without-python";
|
||||||
|
|
||||||
nativeB2Flags = [
|
nativeB2Flags = [
|
||||||
"-sEXPAT_INCLUDE=${expat.dev}/include"
|
"-sEXPAT_INCLUDE=${expat.dev}/include"
|
||||||
@ -76,7 +82,6 @@ let
|
|||||||
"-sEXPAT_LIBPATH=${expat.crossDrv}/lib"
|
"-sEXPAT_LIBPATH=${expat.crossDrv}/lib"
|
||||||
"--user-config=user-config.jam"
|
"--user-config=user-config.jam"
|
||||||
"toolset=gcc-cross"
|
"toolset=gcc-cross"
|
||||||
"--without-python"
|
|
||||||
] ++ optionals (hostPlatform.libc == "msvcrt") [
|
] ++ optionals (hostPlatform.libc == "msvcrt") [
|
||||||
"target-os=windows"
|
"target-os=windows"
|
||||||
"threadapi=win32"
|
"threadapi=win32"
|
||||||
@ -148,8 +153,10 @@ stdenv.mkDerivation {
|
|||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
buildInputs = [ expat zlib bzip2 libiconv ]
|
buildInputs = [ expat zlib bzip2 libiconv ]
|
||||||
++ stdenv.lib.optionals (hostPlatform == buildPlatform) [ python icu ]
|
++ optional (hostPlatform == buildPlatform) icu
|
||||||
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
++ optional stdenv.isDarwin fixDarwinDylibNames
|
||||||
|
++ optional enablePython python
|
||||||
|
++ optional enableNumpy numpy;
|
||||||
|
|
||||||
configureScript = "./bootstrap.sh";
|
configureScript = "./bootstrap.sh";
|
||||||
configureFlags = commonConfigureFlags
|
configureFlags = commonConfigureFlags
|
||||||
|
@ -1476,7 +1476,10 @@ in {
|
|||||||
|
|
||||||
# Build boost for this specific Python version
|
# Build boost for this specific Python version
|
||||||
# TODO: use separate output for libboost_python.so
|
# TODO: use separate output for libboost_python.so
|
||||||
boost = pkgs.boost.override {inherit python;};
|
boost = pkgs.boost.override {
|
||||||
|
inherit (self) python numpy;
|
||||||
|
enablePython = true;
|
||||||
|
};
|
||||||
|
|
||||||
buttersink = buildPythonPackage rec {
|
buttersink = buildPythonPackage rec {
|
||||||
name = "buttersink-0.6.8";
|
name = "buttersink-0.6.8";
|
||||||
@ -1531,7 +1534,6 @@ in {
|
|||||||
python = self.python;
|
python = self.python;
|
||||||
boost = self.boost;
|
boost = self.boost;
|
||||||
numpy = self.numpy;
|
numpy = self.numpy;
|
||||||
pythonSupport = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
capstone = buildPythonPackage rec {
|
capstone = buildPythonPackage rec {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user