about summary refs log tree commit diff
diff options
context:
space:
mode:
authorwxt2024-11-14 20:32:20 +0800
committergithub-actions[bot]2024-11-15 10:38:54 +0000
commite7bde6831e5dbeee005aad6e28522a94a8f3ae37 (patch)
tree4fc4f94bbebef7d91e3de9d7e2612d122bed71ae
parent7bdd6ff0f072db368e7e305336e5fbba56244792 (diff)
python3Packages.chainer: fix build backport-355898-to-release-24.11
(cherry picked from commit 955168be69fedd2532b6e48002c9d9099d379c53)
-rw-r--r--pkgs/development/python-modules/chainer/default.nix21
1 files changed, 14 insertions, 7 deletions
diff --git a/pkgs/development/python-modules/chainer/default.nix b/pkgs/development/python-modules/chainer/default.nix
index 0ca1a2343941..789b0594c152 100644
--- a/pkgs/development/python-modules/chainer/default.nix
+++ b/pkgs/development/python-modules/chainer/default.nix
@@ -7,18 +7,19 @@
   fetchFromGitHub,
   filelock,
   mock,
-  numpy,
   protobuf,
   pytestCheckHook,
   pythonOlder,
   six,
+  setuptools,
+  numpy,
   typing-extensions,
 }:
 
 buildPythonPackage rec {
   pname = "chainer";
   version = "7.8.1.post1";
-  format = "setuptools";
+  build-system = [ setuptools ];
 
   disabled = pythonOlder "3.7";
 
@@ -29,12 +30,18 @@ buildPythonPackage rec {
     hash = "sha256-epwnExmyCWmwaOz+mJnAl1peEeHLBdQGC62BlLfSTQQ=";
   };
 
-  propagatedBuildInputs = [
+  postPatch = ''
+    substituteInPlace chainer/_environment_check.py \
+      --replace-fail "import numpy.distutils.system_info" "import numpy" \
+      --replace-fail "numpy.distutils.system_info" "numpy.__config__.get_info"
+  '';
+
+  dependencies = [
     filelock
-    numpy
     protobuf
     six
     typing-extensions
+    numpy
   ] ++ lib.optionals cudaSupport [ cupy ];
 
   nativeCheckInputs = [
@@ -60,10 +67,10 @@ buildPythonPackage rec {
 
   pythonImportsCheck = [ "chainer" ];
 
-  meta = with lib; {
+  meta = {
     description = "Flexible framework of neural networks for deep learning";
     homepage = "https://chainer.org/";
-    license = licenses.mit;
-    maintainers = with maintainers; [ hyphon81 ];
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ hyphon81 ];
   };
 }