From d2b8d93276b7ed51bce07b378c346ce005b6a428 Mon Sep 17 00:00:00 2001 From: Robert Coup Date: Wed, 18 Jan 2023 20:32:55 +0000 Subject: [PATCH] python3: libcrypt doesn't need to be a dependency of libpython (#28887) Fixed upstream in Python3.11 via https://github.com/python/cpython/issues/89596 Backport here to Python3.10 so libpython doesn't have a needless system dependency on libcrypt (which is different on Linux between RH-based and Debian-based distros too). --- .../python3/0013-configure-no-libcrypt.patch | 42 +++++++++++++++++++ ports/python3/portfile.cmake | 1 + ports/python3/vcpkg.json | 2 +- versions/baseline.json | 2 +- versions/p-/python3.json | 5 +++ 5 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 ports/python3/0013-configure-no-libcrypt.patch diff --git a/ports/python3/0013-configure-no-libcrypt.patch b/ports/python3/0013-configure-no-libcrypt.patch new file mode 100644 index 00000000000..dfeb9b77b76 --- /dev/null +++ b/ports/python3/0013-configure-no-libcrypt.patch @@ -0,0 +1,42 @@ +diff --git a/configure b/configure +index 15c7c54b0953..70f28b0c7064 100755 +--- a/configure ++++ b/configure +@@ -13227,6 +13227,8 @@ done + + # We search for both crypt and crypt_r as one or the other may be defined + # This gets us our -lcrypt in LIBS when required on the target platform. ++# Save/restore LIBS to avoid linking libpython with libcrypt. ++LIBS_SAVE=$LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5 + $as_echo_n "checking for library containing crypt... " >&6; } + if ${ac_cv_search_crypt+:} false; then : +@@ -13368,6 +13370,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + fi + ++LIBS=$LIBS_SAVE + + for ac_func in clock_gettime + do : +diff --git a/configure.ac b/configure.ac +index 6c65b2914bf6..afdc68363cea 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -4085,6 +4085,8 @@ AC_CHECK_FUNCS(setpgrp, + + # We search for both crypt and crypt_r as one or the other may be defined + # This gets us our -lcrypt in LIBS when required on the target platform. ++# Save/restore LIBS to avoid linking libpython with libcrypt. ++LIBS_SAVE=$LIBS + AC_SEARCH_LIBS(crypt, crypt) + AC_SEARCH_LIBS(crypt_r, crypt) + +@@ -4099,6 +4101,7 @@ char *r = crypt_r("", "", &d); + [AC_DEFINE(HAVE_CRYPT_R, 1, [Define if you have the crypt_r() function.])], + []) + ) ++LIBS=$LIBS_SAVE + + AC_CHECK_FUNCS(clock_gettime, [], [ + AC_CHECK_LIB(rt, clock_gettime, [ diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake index b71449b49b8..14248aaaa70 100644 --- a/ports/python3/portfile.cmake +++ b/ports/python3/portfile.cmake @@ -17,6 +17,7 @@ set(PATCHES 0009-bz2d.patch 0010-dont-skip-rpath.patch 0012-force-disable-curses.patch + 0013-configure-no-libcrypt.patch # https://github.com/python/cpython/pull/28881 ) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") diff --git a/ports/python3/vcpkg.json b/ports/python3/vcpkg.json index 90cb9ec3189..a45ff7f8fdb 100644 --- a/ports/python3/vcpkg.json +++ b/ports/python3/vcpkg.json @@ -1,7 +1,7 @@ { "name": "python3", "version": "3.10.7", - "port-version": 4, + "port-version": 5, "description": "The Python programming language", "homepage": "https://github.com/python/cpython", "license": "Python-2.0", diff --git a/versions/baseline.json b/versions/baseline.json index d0218c57d94..d7d9f2e88f6 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6138,7 +6138,7 @@ }, "python3": { "baseline": "3.10.7", - "port-version": 4 + "port-version": 5 }, "qca": { "baseline": "2.3.4", diff --git a/versions/p-/python3.json b/versions/p-/python3.json index ad9548b34d8..b418509a714 100644 --- a/versions/p-/python3.json +++ b/versions/p-/python3.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "43e3e2453968d19d674b96aea99718541c96d852", + "version": "3.10.7", + "port-version": 5 + }, { "git-tree": "13185f7c713eeb0ec50990488e9ea2eef9a9a276", "version": "3.10.7",