mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-28 02:40:50 +00:00
python3Packages.numpy: fix cross compilation
Add mesonEmulatorHook, along with a small hack to make it function
properly with meson-python.
(cherry picked from commit bad887d926)
This commit is contained in:
committed by
github-actions[bot]
parent
78e248d826
commit
43c623e660
@@ -11,6 +11,7 @@
|
||||
, cython_3
|
||||
, gfortran
|
||||
, meson-python
|
||||
, mesonEmulatorHook
|
||||
, pkg-config
|
||||
, xcbuild
|
||||
|
||||
@@ -96,6 +97,8 @@ in buildPythonPackage rec {
|
||||
pkg-config
|
||||
] ++ lib.optionals (stdenv.isDarwin) [
|
||||
xcbuild.xcrun
|
||||
] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
|
||||
mesonEmulatorHook
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
@@ -114,6 +117,11 @@ in buildPythonPackage rec {
|
||||
export OMP_NUM_THREADS=$((NIX_BUILD_CORES > 64 ? 64 : NIX_BUILD_CORES))
|
||||
'';
|
||||
|
||||
# HACK: copy mesonEmulatorHook's flags to the variable used by meson-python
|
||||
postConfigure = ''
|
||||
mesonFlags="$mesonFlags ''${mesonFlagsArray[@]}"
|
||||
'';
|
||||
|
||||
preBuild = ''
|
||||
ln -s ${cfg} site.cfg
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user