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