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
This commit is contained in:
Charlie Li 2025-03-09 20:02:09 -04:00
parent 104a9fb636
commit 7e633595cf
No known key found for this signature in database
GPG key ID: 678F936058415CCA
5 changed files with 17 additions and 23 deletions

View file

@ -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

View file

@ -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

View file

@ -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',

View file

@ -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
}
]

View file

@ -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