diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index cc93f0ad..293e8cb9 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -44,7 +44,7 @@ sed "${sed_args[@]}" "s|/tools/host|${TOOLS_PATH}/host|g" ${TOOLS_PATH}/host/sha # We force linking of external static libraries by removing the shared # libraries. This is hacky. But we're building in a temporary container # and it gets the job done. -find ${TOOLS_PATH}/deps -name '*.so*' -exec rm {} \; +find ${TOOLS_PATH}/deps -name '*.so*' -a \! \( -name 'libtcl*.so*' -or -name 'libtk*.so*' \) -exec rm {} \; tar -xf Python-${PYTHON_VERSION}.tar.xz @@ -1253,6 +1253,7 @@ if [ -d "${TOOLS_PATH}/deps/lib/tcl8" ]; then if [[ "${PYBUILD_PLATFORM}" != macos* ]]; then cp -av ${TOOLS_PATH}/deps/lib/Tix8.4.3 ${ROOT}/out/python/install/lib/ + cp -av ${TOOLS_PATH}/deps/lib/lib*.so ${ROOT}/out/python/install/lib/ fi fi diff --git a/cpython-unix/build-tcl.sh b/cpython-unix/build-tcl.sh index 43a4a6ad..ef9d9ddc 100755 --- a/cpython-unix/build-tcl.sh +++ b/cpython-unix/build-tcl.sh @@ -22,21 +22,6 @@ if [ -n "${STATIC}" ]; then fi fi -patch -p1 << 'EOF' -diff --git a/unix/Makefile.in b/unix/Makefile.in ---- a/unix/Makefile.in -+++ b/unix/Makefile.in -@@ -1813,7 +1813,7 @@ configure-packages: - $$i/configure --with-tcl=../.. \ - --with-tclinclude=$(GENERIC_DIR) \ - $(PKG_CFG_ARGS) --libdir=$(PACKAGE_DIR) \ -- --enable-shared --enable-threads; ) || exit $$?; \ -+ --enable-shared=no --enable-threads; ) || exit $$?; \ - fi; \ - fi; \ - fi; \ -EOF - # Remove packages we don't care about and can pull in unwanted symbols. rm -rf pkgs/sqlite* pkgs/tdbc* @@ -48,12 +33,9 @@ CFLAGS="${CFLAGS}" CPPFLAGS="${CFLAGS}" LDFLAGS="${EXTRA_TARGET_LDFLAGS}" ./conf --build=${BUILD_TRIPLE} \ --host=${TARGET_TRIPLE} \ --prefix=/tools/deps \ - --enable-shared=no \ + --enable-shared \ --enable-threads make -j ${NUM_CPUS} make -j ${NUM_CPUS} install DESTDIR=${ROOT}/out make -j ${NUM_CPUS} install-private-headers DESTDIR=${ROOT}/out - -# For some reason libtcl*.a have weird permissions. Fix that. -chmod 644 ${ROOT}/out/tools/deps/lib/libtcl*.a diff --git a/cpython-unix/build-tk.sh b/cpython-unix/build-tk.sh index 2769a631..aa7a5b67 100755 --- a/cpython-unix/build-tk.sh +++ b/cpython-unix/build-tk.sh @@ -31,7 +31,7 @@ CFLAGS="${CFLAGS}" CPPFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" ./configure \ --host=${TARGET_TRIPLE} \ --prefix=/tools/deps \ --with-tcl=${TOOLS_PATH}/deps/lib \ - --enable-shared=no \ + --enable-shared \ --enable-threads \ ${EXTRA_CONFIGURE_FLAGS} @@ -53,7 +53,4 @@ touch wish make -j ${NUM_CPUS} install DESTDIR=${ROOT}/out make -j ${NUM_CPUS} install-private-headers DESTDIR=${ROOT}/out -# For some reason libtk*.a have weird permissions. Fix that. -chmod 644 /${ROOT}/out/tools/deps/lib/libtk*.a - rm ${ROOT}/out/tools/deps/bin/wish* diff --git a/cpython-unix/extension-modules.yml b/cpython-unix/extension-modules.yml index 4b834563..7498b949 100644 --- a/cpython-unix/extension-modules.yml +++ b/cpython-unix/extension-modules.yml @@ -676,40 +676,11 @@ _tkinter: - WITH_APPINIT includes-deps: - include/X11 + build-mode: shared links: - tcl8.6 - tk8.6 - # Without -ObjC, we get a crash: -[TKApplication tkProcessEvent:]: unrecognized selector sent to instance. - # See also https://core.tcl-lang.org/tk/tktview/85f316beb15108ac43b03fa6c8608e31f3ae5f92. - # This is apparently an issue with static linking Objective-C binaries. - linker-args: - - args: ["-ObjC"] - targets: - - .*-apple-darwin - links-conditional: - - name: X11 - targets: - - .*-unknown-linux-.* - - name: xcb - targets: - - .*-unknown-linux-.* - - name: Xau - targets: - - .*-unknown-linux-.* - # Many of these are dependencies of libtcl and libtk. - frameworks: - - AppKit - - ApplicationServices - - Carbon - - Cocoa - - CoreFoundation - - CoreServices - - CoreGraphics - - IOKit - - QuartzCore - - UniformTypeIdentifiers - _tokenize: minimum-python-version: "3.11" config-c-only: true diff --git a/src/validation.rs b/src/validation.rs index 5ab71708..42000334 100644 --- a/src/validation.rs +++ b/src/validation.rs @@ -822,7 +822,7 @@ const GLOBAL_EXTENSIONS_WINDOWS_PRE_3_13: &[&str] = &["_msi"]; const GLOBAL_EXTENSIONS_WINDOWS_NO_STATIC: &[&str] = &["_testinternalcapi", "_tkinter"]; /// Extension modules that should be built as shared libraries. -const SHARED_LIBRARY_EXTENSIONS: &[&str] = &["_crypt"]; +const SHARED_LIBRARY_EXTENSIONS: &[&str] = &["_crypt", "_tkinter"]; const PYTHON_VERIFICATIONS: &str = include_str!("verify_distribution.py");