about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorChris Ostrouchov2018-11-27 17:42:00 -0500
committerChris Ostrouchov2019-02-23 13:09:11 -0500
commit8f0ef92ab2b076463f2e53678d5e172b5ea82a76 (patch)
tree624fe6b76ed44982d0b1544a978d91fbb0214dfe /pkgs/development
parent7b093af342de1b95fa96bd3ff4058d3067582d32 (diff)
pythonPackages.ndtypes: init at unstable-2018-11-27
Diffstat (limited to 'pkgs/development')
-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
+  '';
+}