diff --git a/default.nix b/default.nix index e28699f..a6c0169 100644 --- a/default.nix +++ b/default.nix @@ -12,6 +12,8 @@ rec { netbox-topology-views = callPythonPackage ./python-modules/netbox-topology-views { }; + nmslib = callPythonPackage ./python-modules/nmslib { }; + prefixed = callPythonPackage ./python-modules/prefixed { }; })); diff --git a/python-modules/nmslib/default.nix b/python-modules/nmslib/default.nix new file mode 100644 index 0000000..cd61204 --- /dev/null +++ b/python-modules/nmslib/default.nix @@ -0,0 +1,41 @@ +{ lib +, buildPythonPackage +, fetchPypi +, fetchpatch +, numpy +, psutil +, pybind11 +}: + +buildPythonPackage rec { + pname = "nmslib"; + version = "2.1.1"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-lxKUp3ZvkcaX1jyIyK3aR5epRDRsxTWiFzk/QWehnCA="; + }; + + patchFlags = [ "-p2" ]; + patches = [ + # Fix import on newer versions of pybind11 (https://github.com/nmslib/nmslib/pull/488) + (fetchpatch { + url = "https://github.com/nmslib/nmslib/commit/574ecd54c157d13aecc03033311be261c91a45ec.patch"; + sha256 = "sha256-R/y6BbnZRe7VM5XCbes6Z5A5N66r+8SCA2Hy6K301IM="; + }) + ]; + + propagatedBuildInputs = [ + numpy + psutil + pybind11 + ]; + + meta = with lib; { + description = "An efficient similarity search library and a toolkit for evaluation of their methods"; + homepage = "https://github.com/nmslib/nmslib"; + license = licenses.asl20; + maintainers = with maintainers; [ sbruder ]; + platforms = platforms.all; + }; +}