about summary refs log tree commit diff
path: root/pkgs/development/python-modules/ndtypes/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/ndtypes/default.nix')
-rw-r--r--pkgs/development/python-modules/ndtypes/default.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/ndtypes/default.nix b/pkgs/development/python-modules/ndtypes/default.nix
new file mode 100644
index 000000000000..2110f3628a80
--- /dev/null
+++ b/pkgs/development/python-modules/ndtypes/default.nix
@@ -0,0 +1,30 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, numpy
+, libndtypes
+, isPy27
+}:
+
+buildPythonPackage {
+  pname = "ndtypes";
+  disabled = isPy27;
+  inherit (libndtypes) version src meta;
+
+  propagatedBuildInputs = [ numpy ];
+
+  postPatch = ''
+    substituteInPlace setup.py \
+      --replace 'include_dirs = ["libndtypes"]' \
+                'include_dirs = ["${libndtypes}/include"]' \
+      --replace 'library_dirs = ["libndtypes"]' \
+                'library_dirs = ["${libndtypes}/lib"]' \
+      --replace 'runtime_library_dirs = ["$ORIGIN"]' \
+                'runtime_library_dirs = ["${libndtypes}/lib"]'
+  '';
+
+  postInstall = ''
+    mkdir $out/include
+    cp python/ndtypes/*.h $out/include
+  '';
+}