mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 04:05:40 +03:00
meson: fix build when using pypy
This commit is contained in:
parent
233f899f64
commit
7ecebd4a14
1 changed files with 34 additions and 5 deletions
|
@ -10,6 +10,7 @@
|
||||||
pkg-config,
|
pkg-config,
|
||||||
python3,
|
python3,
|
||||||
replaceVars,
|
replaceVars,
|
||||||
|
writeShellScriptBin,
|
||||||
zlib,
|
zlib,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
@ -66,12 +67,34 @@ python3.pkgs.buildPythonApplication rec {
|
||||||
./007-freebsd-pkgconfig-path.patch
|
./007-freebsd-pkgconfig-path.patch
|
||||||
];
|
];
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
nativeBuildInputs = [ installShellFiles ];
|
nativeBuildInputs = [ installShellFiles ];
|
||||||
|
|
||||||
nativeCheckInputs = [
|
nativeCheckInputs =
|
||||||
ninja
|
[
|
||||||
pkg-config
|
ninja
|
||||||
];
|
pkg-config
|
||||||
|
]
|
||||||
|
++ lib.optionals python3.isPyPy [
|
||||||
|
# Several tests hardcode python3.
|
||||||
|
(writeShellScriptBin "python3" ''exec pypy3 "$@"'')
|
||||||
|
];
|
||||||
|
|
||||||
checkInputs =
|
checkInputs =
|
||||||
[
|
[
|
||||||
|
@ -116,9 +139,15 @@ python3.pkgs.buildPythonApplication rec {
|
||||||
# pch doesn't work quite right on FreeBSD, I think
|
# pch doesn't work quite right on FreeBSD, I think
|
||||||
''test cases/common/13 pch''
|
''test cases/common/13 pch''
|
||||||
]
|
]
|
||||||
|
++ lib.optionals python3.isPyPy [
|
||||||
|
# fails for unknown reason
|
||||||
|
''test cases/python/4 custom target depends extmodule''
|
||||||
|
]
|
||||||
))
|
))
|
||||||
++ [
|
++ [
|
||||||
''HOME="$TMPDIR" python ./run_project_tests.py''
|
''HOME="$TMPDIR" ${
|
||||||
|
if python3.isPyPy then python3.interpreter else "python"
|
||||||
|
} ./run_project_tests.py''
|
||||||
"runHook postCheck"
|
"runHook postCheck"
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue