summary refs log tree commit diff
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2017-09-23 09:54:46 +0300
committerNikolay Amiantov <ab@fmap.me>2017-10-17 03:40:11 +0300
commitb1e499788c72f33ddacf5e7cc88b921681633c0c (patch)
treeef117e91cb04b680080ffd7e9bb08e29a36d6eba
parente2a7f508fc2e3ef665ce6a66bd9bc753dfdf13f5 (diff)
downloadnixlib-b1e499788c72f33ddacf5e7cc88b921681633c0c.tar
nixlib-b1e499788c72f33ddacf5e7cc88b921681633c0c.tar.gz
nixlib-b1e499788c72f33ddacf5e7cc88b921681633c0c.tar.bz2
nixlib-b1e499788c72f33ddacf5e7cc88b921681633c0c.tar.lz
nixlib-b1e499788c72f33ddacf5e7cc88b921681633c0c.tar.xz
nixlib-b1e499788c72f33ddacf5e7cc88b921681633c0c.tar.zst
nixlib-b1e499788c72f33ddacf5e7cc88b921681633c0c.zip
boost: add numpy support
Not built by default.

Also add enablePython flag (enabled by default) and cleanup a bit.
-rw-r--r--pkgs/development/libraries/boost/generic.nix15
-rw-r--r--pkgs/top-level/python-packages.nix6
2 files changed, 15 insertions, 6 deletions
diff --git a/pkgs/development/libraries/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix
index 22ef02023f88..3f9ae113f849 100644
--- a/pkgs/development/libraries/boost/generic.nix
+++ b/pkgs/development/libraries/boost/generic.nix
@@ -9,6 +9,8 @@
 , enableStatic ? !enableShared
 , enablePIC ? false
 , enableExceptions ? false
+, enablePython ? hostPlatform == buildPlatform
+, enableNumpy ? false, numpy ? null
 , taggedLayout ? ((enableRelease && enableDebug) || (enableSingleThreaded && enableMultiThreaded) || (enableShared && enableStatic))
 , patches ? null
 , mpi ? null
@@ -21,6 +23,9 @@
 # We must build at least one type of libraries
 assert !enableShared -> enableStatic;
 
+assert enablePython -> hostPlatform == buildPlatform;
+assert enableNumpy -> enablePython;
+
 with stdenv.lib;
 let
 
@@ -62,7 +67,8 @@ let
   ] ++ optional (link != "static") "runtime-link=${runtime-link}" ++ [
     "link=${link}"
     "${cflags}"
-  ] ++ optional (variant == "release") "debug-symbols=off";
+  ] ++ optional (variant == "release") "debug-symbols=off"
+    ++ optional (!enablePython) "--without-python";
 
   nativeB2Flags = [
     "-sEXPAT_INCLUDE=${expat.dev}/include"
@@ -76,7 +82,6 @@ let
     "-sEXPAT_LIBPATH=${expat.crossDrv}/lib"
     "--user-config=user-config.jam"
     "toolset=gcc-cross"
-    "--without-python"
   ] ++ optionals (hostPlatform.libc == "msvcrt") [
     "target-os=windows"
     "threadapi=win32"
@@ -148,8 +153,10 @@ stdenv.mkDerivation {
   enableParallelBuilding = true;
 
   buildInputs = [ expat zlib bzip2 libiconv ]
-    ++ stdenv.lib.optionals (hostPlatform == buildPlatform) [ python icu ]
-    ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
+    ++ optional (hostPlatform == buildPlatform) icu
+    ++ optional stdenv.isDarwin fixDarwinDylibNames
+    ++ optional enablePython python
+    ++ optional enableNumpy numpy;
 
   configureScript = "./bootstrap.sh";
   configureFlags = commonConfigureFlags
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 231d5fecf6ba..f7d2ce160ca9 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -1476,7 +1476,10 @@ in {
 
   # Build boost for this specific Python version
   # 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 {
     name = "buttersink-0.6.8";
@@ -1531,7 +1534,6 @@ in {
     python = self.python;
     boost = self.boost;
     numpy = self.numpy;
-    pythonSupport = true;
   };
 
   capstone = buildPythonPackage rec {