Merge pull request #304922 from pbsds/fix-meep-1713393189

python312Packages.meep: unbreak by patching distutils
This commit is contained in:
Peder Bergebakken Sundt 2024-04-18 15:21:41 +02:00 committed by GitHub
commit e18c8cac72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 0 deletions

View File

@ -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 ];