about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorFrederik Rietdijk2019-02-23 19:51:40 +0100
committerGitHub2019-02-23 19:51:40 +0100
commit161122ffee8dd52ba61ff691e3ae7299d315b885 (patch)
treefdc208db99b70564f650604ed33b854c72fba93b /pkgs/development
parent0267483ac3cb907c0094b8890d381050469826e2 (diff)
parent1223c8fd9d28f07c10fb20847a7bc04343d6ac55 (diff)
Merge pull request #51151 from costrouc/costrouc/add-xnd-python-supprt
Adding xnd packages: libndtypes, ndtypes, libxnd, xnd, libgumath, gumath
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/libraries/libgumath/default.nix34
-rw-r--r--pkgs/development/libraries/libndtypes/default.nix17
-rw-r--r--pkgs/development/libraries/libxnd/default.nix19
-rw-r--r--pkgs/development/python-modules/gumath/default.nix29
-rw-r--r--pkgs/development/python-modules/ndtypes/default.nix30
-rw-r--r--pkgs/development/python-modules/xnd/default.nix31
6 files changed, 147 insertions, 13 deletions
diff --git a/pkgs/development/libraries/libgumath/default.nix b/pkgs/development/libraries/libgumath/default.nix
new file mode 100644
index 000000000000..d5d35678b4fb
--- /dev/null
+++ b/pkgs/development/libraries/libgumath/default.nix
@@ -0,0 +1,34 @@
+{ stdenv
+, fetchFromGitHub
+, libndtypes
+, libxnd
+}:
+
+stdenv.mkDerivation rec {
+  name = "libgumath-${version}";
+  version = "unstable-2018-11-27";
+
+  src = fetchFromGitHub {
+    owner = "plures";
+    repo = "gumath";
+    rev = "5a9d27883b40432246d6a93cd6133157267fd166";
+    sha256 = "0w2qzp7anxd1wzkvv5r2pdkkpgrnqzgrq47lrvpqc1i1wqzcwf0w";
+  };
+
+  buildInputs = [ libndtypes libxnd ];
+
+  # Override linker with cc (symlink to either gcc or clang)
+  # Library expects to use cc for linking
+  configureFlags = [
+    "LD=${stdenv.cc.targetPrefix}cc"
+  ];
+
+  doCheck = true;
+
+  meta = with stdenv.lib; {
+    description = "Library supporting function dispatch on general data containers. C base and Python wrapper";
+    homepage = https://xnd.io/;
+    license = licenses.bsd3;
+    maintainers = [ maintainers.costrouc ];
+  };
+}
diff --git a/pkgs/development/libraries/libndtypes/default.nix b/pkgs/development/libraries/libndtypes/default.nix
index 925154e1d459..51e4deed462c 100644
--- a/pkgs/development/libraries/libndtypes/default.nix
+++ b/pkgs/development/libraries/libndtypes/default.nix
@@ -1,27 +1,28 @@
-{ lib
-, stdenv
+{ stdenv
 , fetchFromGitHub
 }:
 
 stdenv.mkDerivation rec {
   name = "libndtypes-${version}";
-  version = "0.2.0dev3";
+  version = "unstable-2018-11-27";
 
   src = fetchFromGitHub {
     owner = "plures";
     repo = "ndtypes";
-    rev = "v${version}";
-    sha256 = "0dpvv13mrid8l5zkjlz18qvirz3nr0v98agx9bcvkqbiahlfgjli";
+    rev = "4d810d0c4d54c81a7136f313f0ae6623853d574a";
+    sha256 = "1kk1sa7f17ffh49jc1qlizlsj536fr3s4flb6x4rjyi81rp7psb9";
   };
 
   # Override linker with cc (symlink to either gcc or clang)
   # Library expects to use cc for linking
   configureFlags = [ "LD=${stdenv.cc.targetPrefix}cc" ];
 
-  meta = {
+  doCheck = true;
+
+  meta = with stdenv.lib; {
     description = "Dynamic types for data description and in-memory computations";
     homepage = https://xnd.io/;
-    license = lib.licenses.bsdOriginal;
-    maintainers = with lib.maintainers; [ costrouc ];
+    license = licenses.bsdOriginal;
+    maintainers = [ maintainers.costrouc ];
   };
 }
diff --git a/pkgs/development/libraries/libxnd/default.nix b/pkgs/development/libraries/libxnd/default.nix
index 6b9375c73815..cb93ec63e670 100644
--- a/pkgs/development/libraries/libxnd/default.nix
+++ b/pkgs/development/libraries/libxnd/default.nix
@@ -6,23 +6,32 @@
 
 stdenv.mkDerivation rec {
   name = "libxnd-${version}";
-  version = "0.2.0dev3";
+  version = "unstable-2018-11-27";
 
   src = fetchFromGitHub {
     owner = "plures";
     repo = "xnd";
-    rev = "v${version}";
-    sha256 = "0byq7jspyr2wxrhihw4q7nf0y4sb6j5ax0ndd5dnq5dz88c7qqm2";
+    rev = "8a9f3bd1d01d872828b40bc9dbd0bc0184524da3";
+    sha256 = "10jh2kqvhpzwy50adayh9az7z2lm16yxy4flrh99alzzbqdyls44";
   };
 
   buildInputs = [ libndtypes ];
 
   # Override linker with cc (symlink to either gcc or clang)
   # Library expects to use cc for linking
-  configureFlags = [ "LD=${stdenv.cc.targetPrefix}cc" ];
+  configureFlags = [
+      # Override linker with cc (symlink to either gcc or clang)
+      # Library expects to use cc for linking
+      "LD=${stdenv.cc.targetPrefix}cc"
+      # needed for tests
+      "--with-includes=${libndtypes}/include"
+      "--with-libs=${libndtypes}/lib"
+  ];
+
+  doCheck = true;
 
   meta = {
-    description = "General container that maps a wide range of Python values directly to memory";
+    description = "C library for managing typed memory blocks and Python container module";
     homepage = https://xnd.io/;
     license = lib.licenses.bsdOriginal;
     maintainers = with lib.maintainers; [ costrouc ];
diff --git a/pkgs/development/python-modules/gumath/default.nix b/pkgs/development/python-modules/gumath/default.nix
new file mode 100644
index 000000000000..b066f323d682
--- /dev/null
+++ b/pkgs/development/python-modules/gumath/default.nix
@@ -0,0 +1,29 @@
+{ lib
+, buildPythonPackage
+, numba
+, ndtypes
+, xnd
+, libndtypes
+, libxnd
+, libgumath
+, isPy27
+}:
+
+buildPythonPackage {
+  pname = "gumath";
+  disabled = isPy27;
+  inherit (libgumath) src version meta;
+
+  checkInputs = [ numba ];
+  propagatedBuildInputs = [ ndtypes xnd ];
+
+  postPatch = ''
+    substituteInPlace setup.py \
+      --replace 'add_include_dirs = [".", "libgumath", "ndtypes/python/ndtypes", "xnd/python/xnd"] + INCLUDES' \
+                'add_include_dirs = [".", "${libndtypes}/include", "${libxnd}/include", "${libgumath}/include"]' \
+      --replace 'add_library_dirs = ["libgumath", "ndtypes/libndtypes", "xnd/libxnd"] + LIBS' \
+                'add_library_dirs = ["${libndtypes}/lib", "${libxnd}/lib", "${libgumath}/lib"]' \
+      --replace 'add_runtime_library_dirs = ["$ORIGIN"]' \
+                'add_runtime_library_dirs = ["${libndtypes}/lib", "${libxnd}/lib", "${libgumath}/lib"]'
+  '';
+}
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
+  '';
+}
diff --git a/pkgs/development/python-modules/xnd/default.nix b/pkgs/development/python-modules/xnd/default.nix
new file mode 100644
index 000000000000..8ffb8f96936b
--- /dev/null
+++ b/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
+  '';
+}