mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
python3Packages.librt: fix cross compilation
Signed-off-by: FlashOnFire_ <flashonfire.dev@gmail.com>
This commit is contained in:
parent
14b995ab3a
commit
0ddb2c508c
1 changed files with 13 additions and 0 deletions
|
|
@ -6,6 +6,7 @@
|
|||
mypy-extensions,
|
||||
python,
|
||||
pytest,
|
||||
stdenv,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
|
|
@ -23,6 +24,18 @@ buildPythonPackage rec {
|
|||
# https://github.com/mypyc/librt/blob/v0.7.8/.github/workflows/buildwheels.yml#L90-L93
|
||||
postPatch = ''
|
||||
cp -rv lib-rt/* .
|
||||
|
||||
# build_setup.py patches CCompiler.spawn to inject architecture-specific
|
||||
# SIMD flags based on platform.machine() (which returns the build arch instead
|
||||
# of the target arch). When cross-compiling, this causes the compiler to abort
|
||||
# with "unrecognized command-line option" errors.
|
||||
#
|
||||
# The patch below forces the use of the target architecture, in order
|
||||
# to keep SIMD flags for x86_64 targets while avoiding them elsewhere.
|
||||
substituteInPlace build_setup.py \
|
||||
--replace-fail \
|
||||
'X86_64 = platform.machine() in ("x86_64", "AMD64", "amd64")' \
|
||||
'X86_64 = ${if stdenv.hostPlatform.isx86_64 then "True" else "False"}'
|
||||
'';
|
||||
|
||||
build-system = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue