Discover Tcl/Tk reliably and use active version (#2106)
Link to the active version like other Homebrew deps -- this won't break when another binary-compatible version is installed. Use a discovery method that doesn't break when other versions are present alongside.
This commit is contained in:
parent
0915c5b7b6
commit
5963dc4f61
@ -1533,12 +1533,13 @@ use_xcode_sdk_zlib() {
|
|||||||
|
|
||||||
use_homebrew_tcltk() {
|
use_homebrew_tcltk() {
|
||||||
# get the version from the folder that homebrew versions
|
# get the version from the folder that homebrew versions
|
||||||
local tcltk_version_long="$(ls "$(brew --cellar tcl-tk)")"
|
local tcltk_libdir="$(brew --prefix tcl-tk 2>/dev/null || true)"
|
||||||
local tcltk_version="${tcltk_version_long%.*}"
|
if [ -d "$tcltk_libdir" ]; then
|
||||||
local tcltk_flags="--with-tcltk-includes=-I$tcltk_libdir/include --with-tcltk-libs=-L$tcltk_libdir/lib -ltcl$tcltk_version -ltk$tcltk_version"
|
echo "python-build: use tcl-tk from homebrew"
|
||||||
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-libs="-L$tcltk_libdir/lib -ltcl$tcltk_version -ltk$tcltk_version"
|
||||||
package_option python configure --with-tcltk-includes="-I$tcltk_libdir/include"
|
package_option python configure --with-tcltk-includes="-I$tcltk_libdir/include"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# FIXME: this function is a workaround for #1125
|
# FIXME: this function is a workaround for #1125
|
||||||
|
@ -242,18 +242,15 @@ OUT
|
|||||||
|
|
||||||
@test "tcl-tk is linked from Homebrew" {
|
@test "tcl-tk is linked from Homebrew" {
|
||||||
cached_tarball "Python-3.6.2"
|
cached_tarball "Python-3.6.2"
|
||||||
|
tcl_tk_version=8.6
|
||||||
# python build
|
|
||||||
tcl_tk_libdir="$TMP/homebrew-tcl-tk"
|
tcl_tk_libdir="$TMP/homebrew-tcl-tk"
|
||||||
tcl_tk_version_long="8.6.10"
|
mkdir -p "$tcl_tk_libdir/lib"
|
||||||
tcl_tk_version="${tcl_tk_version_long%.*}"
|
echo "TCL_VERSION='$tcl_tk_version'" >>"$tcl_tk_libdir/lib/tclConfig.sh"
|
||||||
mkdir -p "$tcl_tk_libdir"
|
|
||||||
mkdir -p "$tcl_tk_libdir/$tcl_tk_version_long"
|
|
||||||
|
|
||||||
# pyenv/pyenv#1026
|
stub uname false
|
||||||
stub uname false false
|
|
||||||
|
|
||||||
stub brew "--prefix tcl-tk : echo '$tcl_tk_libdir'" "--cellar tcl-tk : echo '$TMP/homebrew-tcl-tk'" false
|
for i in {1..2}; do stub brew "--prefix tcl-tk : echo '$tcl_tk_libdir'"; done
|
||||||
|
stub brew false
|
||||||
stub_make_install
|
stub_make_install
|
||||||
|
|
||||||
run_inline_definition <<DEF
|
run_inline_definition <<DEF
|
||||||
|
Loading…
x
Reference in New Issue
Block a user