git: 7e633595cf9d - main - lang/python27: re-add _tkinter into the distribution

From: Charlie Li <vishwin_at_FreeBSD.org>
Date: Mon, 10 Mar 2025 19:29:19 UTC
The branch main has been updated by vishwin:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7e633595cf9df9a557a7d3b421b73e74ab0c057f

commit 7e633595cf9df9a557a7d3b421b73e74ab0c057f
Author:     Charlie Li <vishwin@FreeBSD.org>
AuthorDate: 2025-03-10 00:02:09 +0000
Commit:     Charlie Li <vishwin@FreeBSD.org>
CommitDate: 2025-03-10 19:28:13 +0000

    lang/python27: re-add _tkinter into the distribution
    
    x11-toolkits/py-tkinter is otherwise built separately, ie disabled
    in the main Python distribution build, due to circular (build)
    dependencies with Python itself in lang/tk*. Since this Python
    version is never default anymore, having been EOLed for years among
    other things, it is safe to re-add _tkinter as part of the main
    distribution build. Also update pkg-message to reflect extension
    module ports unavailability.
    
    This is to benefit the only remaining consumer, games/renpy, as
    x11-toolkits/py-tkinter transitions to Python 3+ only. The relevant
    OPTION has been removed as having _tkinter always present makes the
    option a no-op.
    
    PR: 268283
---
 games/renpy/Makefile               |  8 +++-----
 lang/python27/Makefile             |  4 ++--
 lang/python27/files/patch-setup.py | 18 +++++++++---------
 lang/python27/pkg-message          |  9 ++-------
 lang/python27/pkg-plist            |  1 +
 5 files changed, 17 insertions(+), 23 deletions(-)

diff --git a/games/renpy/Makefile b/games/renpy/Makefile
index 804cb8185fe4..4243c7d9a68e 100644
--- a/games/renpy/Makefile
+++ b/games/renpy/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	renpy
 PORTVERSION=	7.4.11
 DISTVERSIONSUFFIX=-sdk
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	games devel
 MASTER_SITES=	https://www.renpy.org/dl/${PORTVERSION}/
 
@@ -53,15 +53,13 @@ DESKTOP_ENTRIES="Ren'Py" \
 		"Development;Game;AdventureGame;" \
 		""
 
-OPTIONS_DEFAULT=TKINTER DIST
-OPTIONS_DEFINE=	DOCS DIST EXAMPLES TKINTER
+OPTIONS_DEFAULT=DIST
+OPTIONS_DEFINE=	DOCS DIST EXAMPLES
 
 DIST_DESC=	Distribution runtimes for Windows, OS X, Linux
 DIST_VARS=	LICENSE+="ART20 PSFL" \
 		PORTDATA+="lib renpy.app renpy.exe renpy-32.exe renpy.sh"
 EXAMPLES_VARS=	PORTDATA+="the_question tutorial"
-TKINTER_DESC=	Install Tkinter to allow choosing Projects Directory
-TKINTER_RUN_DEPENDS=${PYTHON_PKGNAMEPREFIX}tkinter>0:x11-toolkits/py-tkinter@${PY_FLAVOR}
 
 post-extract:
 	@${FIND} ${WRKSRC}/lib ${WRKSRC}/renpy.app -type d -empty -delete
diff --git a/lang/python27/Makefile b/lang/python27/Makefile
index 245835f5be22..149977e9f2b6 100644
--- a/lang/python27/Makefile
+++ b/lang/python27/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	python
 DISTVERSION=	${PYTHON_DISTVERSION}
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	lang python
 MASTER_SITES=	PYTHON/ftp/python/${DISTVERSION}
 PKGNAMESUFFIX=	27
@@ -16,7 +16,7 @@ LICENSE=	PSFL
 DEPRECATED=	EOLed upstream
 EXPIRATION_DATE=	2020-12-31
 
-USES=		cpe ncurses pathfix pkgconfig readline shebangfix ssl tar:xz
+USES=		cpe ncurses pathfix pkgconfig readline shebangfix ssl tar:xz tk:86
 PATHFIX_MAKEFILEIN=	Makefile.pre.in
 USE_LDCONFIG=	yes
 GNU_CONFIGURE=	yes
diff --git a/lang/python27/files/patch-setup.py b/lang/python27/files/patch-setup.py
index e3223582a88d..4073b2c14719 100644
--- a/lang/python27/files/patch-setup.py
+++ b/lang/python27/files/patch-setup.py
@@ -5,9 +5,9 @@
 
 # Description: ossaudiodev detection fix backport
 
---- setup.py.orig	2017-04-22 03:42:03 UTC
+--- setup.py.orig	2020-04-19 21:13:39 UTC
 +++ setup.py
-@@ -15,6 +15,7 @@ from distutils.core import Extension, se
+@@ -15,6 +15,7 @@ from distutils.command.install_lib import install_lib
  from distutils.command.build_ext import build_ext
  from distutils.command.install import install
  from distutils.command.install_lib import install_lib
@@ -15,16 +15,16 @@
  from distutils.spawn import find_executable
  
  cross_compiling = "_PYTHON_HOST_PLATFORM" in os.environ
-@@ -33,7 +34,7 @@ host_platform = get_platform()
+@@ -33,7 +34,7 @@ COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig
  COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS"))
  
  # This global variable is used to hold the list of modules to be disabled.
 -disabled_module_list = []
-+disabled_module_list = ["_bsddb", "_sqlite3", "_tkinter", "gdbm", "mpz"]
++disabled_module_list = ["_bsddb", "_sqlite3", "gdbm", "mpz"]
  
  def add_dir_to_list(dirlist, dir):
      """Add the directory 'dir' to the list 'dirlist' (at the front) if
-@@ -1234,7 +1235,7 @@ class PyBuildExt(build_ext):
+@@ -1280,7 +1281,7 @@ class PyBuildExt(build_ext):
                  sysroot = macosx_sdk_root()
                  f = os.path.join(sysroot, f[1:])
  
@@ -33,7 +33,7 @@
              data = open(f).read()
              m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data)
              if m is not None:
-@@ -1624,9 +1625,10 @@ class PyBuildExt(build_ext):
+@@ -1665,9 +1666,10 @@ class PyBuildExt(build_ext):
          else:
              missing.append('linuxaudiodev')
  
@@ -47,7 +47,7 @@
              exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
          else:
              missing.append('ossaudiodev')
-@@ -2200,6 +2202,22 @@ class PyBuildInstallLib(install_lib):
+@@ -2290,6 +2292,22 @@ class PyBuildInstallLib(install_lib):
      def is_chmod_supported(self):
          return hasattr(os, 'chmod')
  
@@ -70,7 +70,7 @@
  SUMMARY = """
  Python is an interpreted, interactive, object-oriented programming
  language. It is often compared to Tcl, Perl, Scheme or Java.
-@@ -2245,7 +2263,9 @@ def main():
+@@ -2335,7 +2353,9 @@ def main():
            platforms = ["Many"],
  
            # Build info
@@ -81,7 +81,7 @@
                        'install_lib':PyBuildInstallLib},
            # The struct module is defined here, because build_ext won't be
            # called unless there's at least one extension module defined.
-@@ -2253,8 +2273,7 @@ def main():
+@@ -2343,8 +2363,7 @@ def main():
  
            # Scripts to install
            scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle',
diff --git a/lang/python27/pkg-message b/lang/python27/pkg-message
index 4dfd83b9274b..a7f33cdbf52c 100644
--- a/lang/python27/pkg-message
+++ b/lang/python27/pkg-message
@@ -1,13 +1,8 @@
 [
 { type: install
   message: <<EOM
-Note that some standard Python modules are provided as separate ports
-as they require additional dependencies. They are available as:
-
-bsddb           databases/py-bsddb
-gdbm            databases/py-gdbm
-sqlite3         databases/py-sqlite3
-tkinter         x11-toolkits/py-tkinter
+Only the tkinter standard extension module is included or supported;
+the previous ports now only support Python 3+.
 EOM
 }
 ]
diff --git a/lang/python27/pkg-plist b/lang/python27/pkg-plist
index d6b52910f39c..16380119587e 100644
--- a/lang/python27/pkg-plist
+++ b/lang/python27/pkg-plist
@@ -1926,6 +1926,7 @@ lib/python2.7/lib-dynload/_socket.so
 lib/python2.7/lib-dynload/_ssl.so
 lib/python2.7/lib-dynload/_struct.so
 lib/python2.7/lib-dynload/_testcapi.so
+lib/python2.7/lib-dynload/_tkinter.so
 lib/python2.7/lib-dynload/array.so
 lib/python2.7/lib-dynload/audioop.so
 lib/python2.7/lib-dynload/binascii.so