diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2023-10-09 18:00:59 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-09 18:00:59 +0000 |
commit | 75d4639be31d1dd1495f9002793394a152abc07e (patch) | |
tree | d1d7fd26e64300ae48bea2e83fe7f642235f48bd /pkgs/development/interpreters/python | |
parent | 5903dfbe6d6d614852c7f1865911f8a944babc61 (diff) | |
parent | 38aa96fc39c9719994f08100f791c27d31ee7892 (diff) |
Merge master into staging-next
Diffstat (limited to 'pkgs/development/interpreters/python')
-rw-r--r-- | pkgs/development/interpreters/python/cpython/default.nix | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index 6778dc460e058..4e60b15ba4cbf 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -195,25 +195,22 @@ let if parsed.cpu.significantByte.name == "littleEndian" then "arm" else "armeb" else if isx86_32 then "i386" else parsed.cpu.name; - # Python doesn't distinguish musl and glibc and always prefixes with "gnu" - gnuAbiName = replaceStrings [ "musl" ] [ "gnu" ] parsed.abi.name; - pythonAbiName = - # python's build doesn't support every gnu<extension>, and doesn't - # differentiate between musl and glibc, so we list those supported in - # here: + + pythonAbiName = let + # python's build doesn't match the nixpkgs abi in some cases. # https://github.com/python/cpython/blob/e488e300f5c01289c10906c2e53a8e43d6de32d8/configure.ac#L724 - # Note: this is an approximation, as it doesn't take into account the CPU - # family, or the nixpkgs abi naming conventions. - if elem gnuAbiName [ - "gnux32" - "gnueabihf" - "gnueabi" - "gnuabin32" - "gnuabi64" - "gnuspe" - ] - then gnuAbiName - else "gnu"; + nixpkgsPythonAbiMappings = { + "gnuabielfv2" = "gnu"; + "muslabielfv2" = "musl"; + }; + pythonAbi = nixpkgsPythonAbiMappings.${parsed.abi.name} or parsed.abi.name; + in + # Python <3.11 doesn't distinguish musl and glibc and always prefixes with "gnu" + if lib.versionOlder version "3.11" then + replaceStrings [ "musl" ] [ "gnu" ] pythonAbi + else + pythonAbi; + multiarch = if isDarwin then "darwin" else if isWindows then "" |