mirror of
https://git.freebsd.org/ports.git
synced 2025-04-28 01:26:39 -04:00
x11-toolkits/py-tkinter: convert to USE_PYTHON=pep517
Note USES=tk limited to 8.6; 9.0 support is not expected until Python 3.14 PR: 268283
This commit is contained in:
parent
b7e75ada7e
commit
b4529dc744
4 changed files with 59 additions and 52 deletions
|
@ -1,34 +1,46 @@
|
|||
PORTNAME= tkinter
|
||||
DISTVERSION= ${PYTHON_DISTVERSION}
|
||||
PORTREVISION= 9
|
||||
PORTREVISION= 10
|
||||
CATEGORIES= x11-toolkits python
|
||||
MASTER_SITES= PYTHON/ftp/python/${DISTVERSION}
|
||||
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
|
||||
DISTNAME= Python-${DISTVERSION}
|
||||
DIST_SUBDIR= python
|
||||
|
||||
MAINTAINER= python@FreeBSD.org
|
||||
COMMENT= Python bindings to the Tk widget set (Python ${PYTHON_VER})
|
||||
|
||||
LICENSE= PSFL
|
||||
LICENSE_FILE= ${WRKDIR}/Python-${DISTVERSION}/LICENSE
|
||||
|
||||
PORTSCOUT= ignore:1
|
||||
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
|
||||
USE_PYTHON= distutils autoplist allflavors
|
||||
USES= compiler:c11 python tar:xz tk:86
|
||||
USE_PYTHON= allflavors autoplist pep517
|
||||
|
||||
DIST_SUBDIR= python
|
||||
DISTINFO_FILE= ${PORTSDIR}/lang/python${PYTHON_SUFFIX}/distinfo
|
||||
WRKSRC_SUBDIR= Modules
|
||||
|
||||
PYDISTUTILS_INSTALLARGS+= --install-lib ${PYTHON_LIBDIR}/lib-dynload
|
||||
SUB_LIST+= DISTVERSION=${DISTVERSION} \
|
||||
TK_VER=${TK_VER}
|
||||
SUB_FILES= pyproject.toml \
|
||||
setup.py
|
||||
PLIST_FILES= ${PYTHONPREFIX_LIBDIR:S;${PREFIX}/;;}/lib-dynload/_tkinter${PYTHON_EXT_SUFFIX}.so
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
PORTSCOUT= ignore:1
|
||||
|
||||
post-extract:
|
||||
@${SED} -e "s|%%TK_VER%%|${TK_VER}|" ${FILESDIR}/setup.py > ${WRKSRC}/setup.py
|
||||
pre-configure:
|
||||
@${MV} ${WRKDIR}/pyproject.toml ${WRKSRC}
|
||||
@${MV} ${WRKDIR}/setup.py ${WRKSRC}
|
||||
|
||||
post-install:
|
||||
# ${STRIP_CMD} ${STAGEDIR}${PYTHON_LIBDIR}/lib-dynload/_tkinter.cpython-${PYTHON_SUFFIX}.so
|
||||
${STRIP_CMD} ${STAGEDIR}${PYTHON_LIBDIR}/lib-dynload/_tkinter*.so
|
||||
@${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/_tkinter${PYTHON_EXT_SUFFIX}.so
|
||||
# lib-dynload is the expected location
|
||||
@${MKDIR} ${STAGEDIR}${PYTHONPREFIX_LIBDIR}/lib-dynload
|
||||
@(cd ${STAGEDIR}${PYTHONPREFIX_LIBDIR}/lib-dynload && ${LN} -s ../site-packages/_tkinter${PYTHON_EXT_SUFFIX}.so)
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
do-test:
|
||||
@${PYTHON_CMD} -c 'import tkinter' # minimal smoke test
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
|
11
x11-toolkits/py-tkinter/files/pyproject.toml.in
Normal file
11
x11-toolkits/py-tkinter/files/pyproject.toml.in
Normal file
|
@ -0,0 +1,11 @@
|
|||
[build-system]
|
||||
requires = ["setuptools", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "tkinter"
|
||||
version = "%%DISTVERSION%%"
|
||||
description = "Tk Extension to Python"
|
||||
|
||||
[tool.setuptools]
|
||||
packages = []
|
|
@ -1,40 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# To use:
|
||||
# python setup.py install
|
||||
#
|
||||
|
||||
import os, string
|
||||
|
||||
try:
|
||||
import distutils
|
||||
from distutils import sysconfig
|
||||
from distutils.command.install import install
|
||||
from distutils.core import setup, Extension
|
||||
except:
|
||||
raise SystemExit("Distutils problem")
|
||||
|
||||
install.sub_commands = [x for x in install.sub_commands if 'egg' not in x[0]]
|
||||
|
||||
tkversion = "%%TK_VER%%"
|
||||
prefix = sysconfig.PREFIX
|
||||
# Python 1.5 doesn't have os.getenv()?
|
||||
x11base = os.environ['LOCALBASE'] or '/usr/X11R6'
|
||||
inc_dirs = [prefix + "/include",
|
||||
prefix + "/include/tcl" + tkversion,
|
||||
prefix + "/include/tk" + tkversion,
|
||||
x11base + "/include"]
|
||||
lib_dirs = [prefix + "/lib", x11base + "/lib"]
|
||||
# use string.replace() for the benefit of Python 1.5 users
|
||||
libs = ["tcl" + tkversion.replace(".", ""),
|
||||
"tk" + tkversion.replace(".", ""),
|
||||
"X11"]
|
||||
|
||||
setup(name = "Tkinter",
|
||||
description = "Tk Extension to Python",
|
||||
|
||||
ext_modules = [Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'],
|
||||
define_macros=[('WITH_APPINIT', 1)],
|
||||
include_dirs = inc_dirs,
|
||||
libraries = libs,
|
||||
library_dirs = lib_dirs)]
|
||||
)
|
24
x11-toolkits/py-tkinter/files/setup.py.in
Normal file
24
x11-toolkits/py-tkinter/files/setup.py.in
Normal file
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import sysconfig
|
||||
from setuptools import setup, Extension
|
||||
|
||||
tkversion = "%%TK_VER%%"
|
||||
prefix = sysconfig.get_config_var('prefix')
|
||||
x11base = sys.prefix or '/usr/X11R6'
|
||||
inc_dirs = [prefix + "/include",
|
||||
prefix + "/include/tcl" + tkversion,
|
||||
prefix + "/include/tk" + tkversion,
|
||||
x11base + "/include"]
|
||||
lib_dirs = [prefix + "/lib", x11base + "/lib"]
|
||||
libs = ["tcl" + tkversion.replace(".", ""),
|
||||
"tk" + tkversion.replace(".", ""),
|
||||
"X11"]
|
||||
|
||||
setup(ext_modules = [Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'],
|
||||
define_macros=[('WITH_APPINIT', 1)],
|
||||
include_dirs = inc_dirs,
|
||||
libraries = libs,
|
||||
library_dirs = lib_dirs)]
|
||||
)
|
Loading…
Add table
Reference in a new issue