summaryrefslogtreecommitdiffstats
path: root/pkgs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2021-01-23 00:23:24 +0100
committerGitHub <noreply@github.com>2021-01-23 00:23:24 +0100
commite1c86b9a1d6c5d4855d1a1dd4e77237aacac0750 (patch)
tree79f321a5b23b709451a319f002c6dcceb6f9a7b5 /pkgs
parent994e221f166885b099ebb84df73f317d25485b96 (diff)
parent858eebe1f9bdb6c58bbd1b95055d03e97355d49c (diff)
Merge pull request #110293 from pjjw/python-extension-musl-fix
cpython: fix extensions when using a musl toolchain
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/interpreters/python/cpython/default.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix
index 2e4e2f1f6db5..347245f8a01b 100644
--- a/pkgs/development/interpreters/python/cpython/default.nix
+++ b/pkgs/development/interpreters/python/cpython/default.nix
@@ -125,9 +125,15 @@ let
if parsed.cpu.significantByte.name == "littleEndian" then "arm" else "armeb"
else if isx86_32 then "i386"
else parsed.cpu.name;
+ pythonAbiName =
+ # python's build doesn't differentiate between musl and glibc in its
+ # abi detection, our wrapper should match.
+ if stdenv.hostPlatform.isMusl then
+ replaceStrings [ "musl" ] [ "gnu" ] parsed.abi.name
+ else parsed.abi.name;
multiarch =
if isDarwin then "darwin"
- else "${multiarchCpu}-${parsed.kernel.name}-${parsed.abi.name}";
+ else "${multiarchCpu}-${parsed.kernel.name}-${pythonAbiName}";
abiFlags = optionalString (isPy36 || isPy37) "m";