mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-30 01:17:28 +03:00
Merge pull request #268587 from tpwrules/numpy-fix-cross
python3Packages.numpy: fix cross compilation
This commit is contained in:
commit
82afea34b9
@ -11,6 +11,7 @@
|
||||
, cython_3
|
||||
, gfortran
|
||||
, meson-python
|
||||
, mesonEmulatorHook
|
||||
, pkg-config
|
||||
, xcbuild
|
||||
|
||||
@ -83,6 +84,10 @@ in buildPythonPackage rec {
|
||||
rm numpy/core/tests/test_cython.py
|
||||
|
||||
patchShebangs numpy/_build_utils/*.py
|
||||
|
||||
# remove needless reference to full Python path stored in built wheel
|
||||
substituteInPlace numpy/meson.build \
|
||||
--replace 'py.full_path()' "'python'"
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
@ -92,6 +97,8 @@ in buildPythonPackage rec {
|
||||
pkg-config
|
||||
] ++ lib.optionals (stdenv.isDarwin) [
|
||||
xcbuild.xcrun
|
||||
] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
|
||||
mesonEmulatorHook
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
@ -110,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
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user