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