diff --git a/pkgs/development/libraries/libgumath/default.nix b/pkgs/development/libraries/libgumath/default.nix new file mode 100644 index 00000000000..d5d35678b4f --- /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 925154e1d45..51e4deed462 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 6b9375c7381..cb93ec63e67 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 00000000000..b066f323d68 --- /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 00000000000..2110f3628a8 --- /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 00000000000..8ffb8f96936 --- /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 + ''; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5906e3ff1a4..47d455b04ff 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3964,6 +3964,8 @@ in libhandy = callPackage ../development/libraries/libhandy { }; + libgumath = callPackage ../development/libraries/libgumath { }; + libipfix = callPackage ../development/libraries/libipfix { }; libircclient = callPackage ../development/libraries/libircclient { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 810eb17e5e7..e6cb127f96d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -418,6 +418,8 @@ in { guestfs = callPackage ../development/python-modules/guestfs { }; + gumath = callPackage ../development/python-modules/gumath { }; + h5py = callPackage ../development/python-modules/h5py { hdf5 = pkgs.hdf5; }; @@ -496,6 +498,8 @@ in { nbval = callPackage ../development/python-modules/nbval { }; + ndtypes = callPackage ../development/python-modules/ndtypes { }; + nest-asyncio = callPackage ../development/python-modules/nest-asyncio { }; neuron = pkgs.neuron.override { @@ -2784,6 +2788,8 @@ in { xdis = callPackage ../development/python-modules/xdis { }; + xnd = callPackage ../development/python-modules/xnd { }; + uncompyle6 = callPackage ../development/python-modules/uncompyle6 { }; lsi = callPackage ../development/python-modules/lsi { };