9 python = python3.withPackages(ps: with ps; [
14 stdenv.mkDerivation (finalAttrs: {
18 src = fetchFromGitHub {
21 rev = "refs/tags/v${finalAttrs.version}";
22 hash = "sha256-XXz0NIQ5dCGwcX2HtbK5NFTalP0TjLO6ll6TmH3oflI=";
27 name = "CVE-2023-37365.patch";
28 url = "https://github.com/nmslib/hnswlib/commit/f6d170ce0b41f9e75ace473b09df6e7872590757.patch";
29 hash = "sha256-28nakC0rh6kx6yYjv7m6r9/yJ+lWQuooRFyYYQN2rX8=";
33 # this is a header-only library, so we don't need to build it
34 # we need `cmake` only to run tests
35 nativeBuildInputs = lib.optionals finalAttrs.doCheck [
40 # we only want to run buildPhase when we run tests
41 dontBuild = !finalAttrs.doCheck;
46 install -Dm644 $src/hnswlib/*.h -t $out/include/hnswlib
55 ${python.interpreter} update_gen_data.py
68 description = "Header-only C++/python library for fast approximate nearest neighbors";
69 homepage = "https://github.com/nmslib/hnswlib";
70 changelog = "https://github.com/nmslib/hnswlib/releases/tag/${finalAttrs.src.rev}";
71 license = licenses.asl20;
72 maintainers = with maintainers; [ natsukium ];
73 platforms = platforms.unix;