From 44d92674c60015b50f3be8f8201fedfd60f52c2a Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 10 Oct 2024 15:22:28 +0200 Subject: [PATCH 1/2] faiss, python312Packages.faiss: remove useless wheel from build-system --- pkgs/development/libraries/science/math/faiss/default.nix | 1 - pkgs/development/python-modules/faiss/default.nix | 2 -- 2 files changed, 3 deletions(-) diff --git a/pkgs/development/libraries/science/math/faiss/default.nix b/pkgs/development/libraries/science/math/faiss/default.nix index b5c0f5451c23..073e98bb4355 100644 --- a/pkgs/development/libraries/science/math/faiss/default.nix +++ b/pkgs/development/libraries/science/math/faiss/default.nix @@ -63,7 +63,6 @@ stdenv.mkDerivation { pythonPackages.python pythonPackages.setuptools pythonPackages.pip - pythonPackages.wheel ]; buildInputs = diff --git a/pkgs/development/python-modules/faiss/default.nix b/pkgs/development/python-modules/faiss/default.nix index f6eee8cc5e32..39e34a1879e8 100644 --- a/pkgs/development/python-modules/faiss/default.nix +++ b/pkgs/development/python-modules/faiss/default.nix @@ -7,7 +7,6 @@ packaging, setuptools, pip, - wheel, }: buildPythonPackage { @@ -24,7 +23,6 @@ buildPythonPackage { build-system = [ setuptools pip - wheel ]; dependencies = [ From cccb984259f02f6e5e2421bc7b5426cefd1986c3 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 10 Oct 2024 16:19:43 +0200 Subject: [PATCH 2/2] python312Packages.faiss: patch use of deprecated numpy.distutils --- .../libraries/science/math/faiss/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/science/math/faiss/default.nix b/pkgs/development/libraries/science/math/faiss/default.nix index 073e98bb4355..689349fb05ac 100644 --- a/pkgs/development/libraries/science/math/faiss/default.nix +++ b/pkgs/development/libraries/science/math/faiss/default.nix @@ -48,11 +48,18 @@ stdenv.mkDerivation { src = fetchFromGitHub { owner = "facebookresearch"; - repo = pname; - rev = "v${version}"; + repo = "faiss"; + rev = "refs/tags/v${version}"; hash = "sha256-P8TynU6jz5NbcWLdI7n4LX5Gdz0Ks72bmOzQ3LGjQCQ="; }; + postPatch = lib.optionalString pythonSupport '' + substituteInPlace faiss/python/loader.py \ + --replace-fail \ + "# platform-dependent legacy fallback using numpy.distutils.cpuinfo" \ + "return False" + ''; + nativeBuildInputs = [ cmake ] ++ lib.optionals cudaSupport [