cpython: fix _PYTHON_SYSCONFIGDATA_NAME on armv7l with musl (#240770)

Python always uses "gnu" prefixed ABI names, and this patch handles this by
doing a musl->gnu string replacement.

With pkgsCross.armv7l-hf-multiplatform.pkgsStatic, the previous name was:
_sysconfigdata__linux_arm-linux-gnu
Now, the corrected name is:
_sysconfigdata__linux_arm-linux-gnueabihf

authored by Ben Wolsieffer and committed by GitHub 02719f21 f54be2e5

+4 -2
+4 -2
pkgs/development/interpreters/python/cpython/default.nix
··· 184 184 if parsed.cpu.significantByte.name == "littleEndian" then "arm" else "armeb" 185 185 else if isx86_32 then "i386" 186 186 else parsed.cpu.name; 187 + # Python doesn't distinguish musl and glibc and always prefixes with "gnu" 188 + gnuAbiName = replaceStrings [ "musl" ] [ "gnu" ] parsed.abi.name; 187 189 pythonAbiName = 188 190 # python's build doesn't support every gnu<extension>, and doesn't 189 191 # differentiate between musl and glibc, so we list those supported in ··· 191 193 # https://github.com/python/cpython/blob/e488e300f5c01289c10906c2e53a8e43d6de32d8/configure.ac#L724 192 194 # Note: this is an approximation, as it doesn't take into account the CPU 193 195 # family, or the nixpkgs abi naming conventions. 194 - if elem parsed.abi.name [ 196 + if elem gnuAbiName [ 195 197 "gnux32" 196 198 "gnueabihf" 197 199 "gnueabi" ··· 199 201 "gnuabi64" 200 202 "gnuspe" 201 203 ] 202 - then parsed.abi.name 204 + then gnuAbiName 203 205 else "gnu"; 204 206 multiarch = 205 207 if isDarwin then "darwin"