From 7799ff5cb6eba42037c9d5b6491637e7b51a093e Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Thu, 18 Apr 2024 01:02:13 +0200 Subject: [PATCH] python312Packages.meep: unbreak by patching distutils --- pkgs/development/python-modules/meep/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/development/python-modules/meep/default.nix b/pkgs/development/python-modules/meep/default.nix index 70a588f1c8aa..de8f8994a2fb 100644 --- a/pkgs/development/python-modules/meep/default.nix +++ b/pkgs/development/python-modules/meep/default.nix @@ -2,6 +2,8 @@ , lib , buildPythonPackage , fetchFromGitHub +, pythonOlder +, setuptools , autoreconfHook , pkg-config , mpiCheckPhaseHook @@ -44,6 +46,12 @@ buildPythonPackage rec { format = "other"; + # https://github.com/NanoComp/meep/issues/2819 + postPatch = lib.optionalString (!pythonOlder "3.12") '' + substituteInPlace configure.ac doc/docs/setup.py python/visualization.py \ + --replace-fail "distutils" "setuptools._distutils" + ''; + # MPI is needed in nativeBuildInputs too, otherwise MPI libs will be missing # at runtime nativeBuildInputs = [ @@ -76,6 +84,9 @@ buildPythonPackage rec { cython autograd mpi4py + ] + ++ lib.optionals (!pythonOlder "3.12") [ + setuptools # used in python/visualization.py ]; propagatedUserEnvPkgs = [ mpi ];