diff options
author | Charlie Li <vishwin@FreeBSD.org> | 2025-06-16 16:36:55 -0400 |
---|---|---|
committer | Charlie Li <vishwin@FreeBSD.org> | 2025-06-16 16:36:55 -0400 |
commit | 01d4d932425a82353ce3f6731407b3eb8c3e2069 (patch) | |
tree | 7086079a9e2f2db25213499d1ce1e0da486f17aa | |
parent | devel/boost-python-libs: reapply 0c610c4b35941436172bfede63e11a62454581b2 (diff) |
x11-toolkits/py-tkinter: fix build with Python 3.12+
Certain internal headers are included unconditionally starting with
Python 3.12, but this should have been built with the appropriate
preprocessor macros for internal headers set anyway. Also clean up
some duplicate directory definitions while here.
PR: 286298
Event: Kitchener-Waterloo Hackathon 202506
-rw-r--r-- | x11-toolkits/py-tkinter/Makefile | 3 | ||||
-rw-r--r-- | x11-toolkits/py-tkinter/files/setup.py.in | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/x11-toolkits/py-tkinter/Makefile b/x11-toolkits/py-tkinter/Makefile index 904493a8ddbb..4a859f2467f5 100644 --- a/x11-toolkits/py-tkinter/Makefile +++ b/x11-toolkits/py-tkinter/Makefile @@ -16,8 +16,9 @@ LICENSE_FILE= ${WRKDIR}/Python-${DISTVERSION}/LICENSE BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR} -USES= compiler:c11 python tar:xz tk:86 +USES= compiler:c11 python tar:xz tk:86 xorg USE_PYTHON= allflavors autoplist pep517 +USE_XORG= x11 DISTINFO_FILE= ${PORTSDIR}/lang/python${PYTHON_SUFFIX}/distinfo WRKSRC_SUBDIR= Modules diff --git a/x11-toolkits/py-tkinter/files/setup.py.in b/x11-toolkits/py-tkinter/files/setup.py.in index 493bf949a682..fbf905a2e27a 100644 --- a/x11-toolkits/py-tkinter/files/setup.py.in +++ b/x11-toolkits/py-tkinter/files/setup.py.in @@ -7,17 +7,18 @@ from setuptools import setup, Extension tkversion = "%%TK_VER%%" prefix = sysconfig.get_config_var('prefix') x11base = sys.prefix or '/usr/X11R6' -inc_dirs = [prefix + "/include", +inc_dirs = [sysconfig.get_path('include') + "/internal", prefix + "/include/tcl" + tkversion, prefix + "/include/tk" + tkversion, x11base + "/include"] -lib_dirs = [prefix + "/lib", x11base + "/lib"] +lib_dirs = [x11base + "/lib"] libs = ["tcl" + tkversion.replace(".", ""), "tk" + tkversion.replace(".", ""), "X11"] +macros = [('Py_BUILD_CORE_MODULE', 1), ('WITH_APPINIT', 1)] setup(ext_modules = [Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'], - define_macros=[('WITH_APPINIT', 1)], + define_macros=macros, include_dirs = inc_dirs, libraries = libs, library_dirs = lib_dirs)] |