316316# RHEL 8 (supported until 2029) and below, including Fedora 33 and below, do not
317317# ship an /etc/ssl/cert.pem or a hashed /etc/ssl/cert/ directory. Patch to look at
318318# /etc/pki/tls/cert.pem instead, if that file exists and /etc/ssl/cert.pem does not.
319- patch -p1 -i ${ROOT} /patch-cpython-redhat-cert-file.patch
319+ if [[ " ${TARGET_TRIPLE} " =~ linux ]]; then
320+ patch -p1 -i " ${ROOT} /patch-cpython-redhat-cert-file.patch"
321+ fi
320322
321323# Cherry-pick an upstream change in Python 3.15 to build _asyncio as
322324# static (which we do anyway in our own fashion) and more importantly to
@@ -1361,10 +1363,12 @@ if [ -d "${TOOLS_PATH}/deps/usr/share/terminfo" ]; then
13611363 cp -av " ${TOOLS_PATH} /deps/usr/share/terminfo" " ${ROOT} /out/python/install/share/"
13621364fi
13631365
1364- # Copy a fallback CA bundle. Python will prefer the host trust store when one
1365- # exists and use this only for minimal environments without root certificates.
1366- mkdir -p " ${ROOT} /out/python/install/etc/ssl"
1367- cp -av " ${TOOLS_PATH} /deps/share/certifi/cacert.pem" " ${ROOT} /out/python/install/etc/ssl/cert.pem"
1366+ # Copy a Linux fallback CA bundle. Python will prefer the host trust store when
1367+ # one exists and use this only for minimal environments without root certificates.
1368+ if [[ " ${TARGET_TRIPLE} " =~ linux ]]; then
1369+ mkdir -p " ${ROOT} /out/python/install/etc/ssl"
1370+ cp -av " ${TOOLS_PATH} /deps/share/certifi/cacert.pem" " ${ROOT} /out/python/install/etc/ssl/cert.pem"
1371+ fi
13681372
13691373# config.c defines _PyImport_Inittab and extern references to modules, which
13701374# downstream consumers may want to strip. We bundle config.c and config.c.in so
@@ -1391,5 +1395,7 @@ find "${ROOT}/out/python/install/lib/pkgconfig" -name \*.pc -type f -exec \
13911395 sed " ${sed_args[@]} " ' s|^prefix=/install|prefix=${pcfiledir}/../..|' {} +
13921396
13931397mkdir " ${ROOT} /out/python/licenses"
1394- cp " ${ROOT} /LICENSE" " ${ROOT} /out/python/licenses/"
1398+ if [[ " ${TARGET_TRIPLE} " =~ linux ]]; then
1399+ cp " ${ROOT} /LICENSE" " ${ROOT} /out/python/licenses/"
1400+ fi
13951401cp " ${ROOT} " /LICENSE.* .txt " ${ROOT} /out/python/licenses/"
0 commit comments