1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-09 20:13:47 -05:00

Discover Tcl/Tk from Homebrew via pkgconfig for 3.11+ (#2501)

CPython 3.11+ dropped support for --with-tcl-tk-*
in favor of pure pkgconfig
This commit is contained in:
native-api
2022-10-29 22:48:13 +03:00
committed by GitHub
parent 44510a68f1
commit 5b0ac41dec
6 changed files with 70 additions and 61 deletions

View File

@@ -1580,9 +1580,12 @@ use_homebrew_tcltk() {
local tcltk_libdir="$(brew --prefix tcl-tk 2>/dev/null || true)"
if [ -d "$tcltk_libdir" ]; then
echo "python-build: use tcl-tk from homebrew"
local tcltk_version="$(sh -c '. '"$tcltk_libdir"'/lib/tclConfig.sh; echo $TCL_VERSION')"
package_option python configure --with-tcltk-libs="-L$tcltk_libdir/lib -ltcl$tcltk_version -ltk$tcltk_version"
package_option python configure --with-tcltk-includes="-I$tcltk_libdir/include"
if [[ -z "$PYTHON_BUILD_TCLTK_USE_PKGCONFIG" ]]; then
local tcltk_version="$(sh -c '. '"$tcltk_libdir"'/lib/tclConfig.sh; echo $TCL_VERSION')"
package_option python configure --with-tcltk-libs="-L$tcltk_libdir/lib -ltcl$tcltk_version -ltk$tcltk_version"
package_option python configure --with-tcltk-includes="-I$tcltk_libdir/include"
fi
export PKG_CONFIG_PATH="${tcltk_libdir}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
fi
}