Revert "meson: don't set postPatch at all if not using PyPy"

This reverts commit ef3d7e646a.
This commit is contained in:
Michael Daniels
2026-09-10 19:26:18 -04:00
parent 6d2ce9dc6b
commit 86b171da65

View File

@@ -70,18 +70,22 @@ python3.pkgs.buildPythonApplication (finalAttrs: {
./007-freebsd-pkgconfig-path.patch
];
${if python3.isPyPy then "postPatch" else null} = ''
substituteInPlace mesonbuild/modules/python.py \
--replace-fail "PythonExternalProgram('python3', mesonlib.python_command" \
"PythonExternalProgram('${python3.meta.mainProgram}', mesonlib.python_command"
substituteInPlace mesonbuild/modules/python3.py \
--replace-fail "state.environment.lookup_binary_entry(mesonlib.MachineChoice.HOST, 'python3'" \
"state.environment.lookup_binary_entry(mesonlib.MachineChoice.HOST, '${python3.meta.mainProgram}'"
substituteInPlace "test cases"/*/*/*.py "test cases"/*/*/*/*.py \
--replace-quiet '#!/usr/bin/env python3' '#!/usr/bin/env pypy3' \
--replace-quiet '#! /usr/bin/env python3' '#!/usr/bin/env pypy3'
chmod +x "test cases"/*/*/*.py "test cases"/*/*/*/*.py
'';
postPatch =
if python3.isPyPy then
''
substituteInPlace mesonbuild/modules/python.py \
--replace-fail "PythonExternalProgram('python3', mesonlib.python_command" \
"PythonExternalProgram('${python3.meta.mainProgram}', mesonlib.python_command"
substituteInPlace mesonbuild/modules/python3.py \
--replace-fail "state.environment.lookup_binary_entry(mesonlib.MachineChoice.HOST, 'python3'" \
"state.environment.lookup_binary_entry(mesonlib.MachineChoice.HOST, '${python3.meta.mainProgram}'"
substituteInPlace "test cases"/*/*/*.py "test cases"/*/*/*/*.py \
--replace-quiet '#!/usr/bin/env python3' '#!/usr/bin/env pypy3' \
--replace-quiet '#! /usr/bin/env python3' '#!/usr/bin/env pypy3'
chmod +x "test cases"/*/*/*.py "test cases"/*/*/*/*.py
''
else
null;
build-system = [ python3.pkgs.setuptools ];