diff --git a/x11-toolkits/py-tkinter/Makefile b/x11-toolkits/py-tkinter/Makefile index f3e2c18fd926..c1d4ad3ca163 100644 --- a/x11-toolkits/py-tkinter/Makefile +++ b/x11-toolkits/py-tkinter/Makefile @@ -1,38 +1,35 @@ PORTNAME= tkinter DISTVERSION= ${PYTHON_DISTVERSION} -PORTREVISION= 8 +PORTREVISION= 9 CATEGORIES= x11-toolkits python MASTER_SITES= PYTHON/ftp/python/${DISTVERSION} PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} DISTNAME= Python-${DISTVERSION} MAINTAINER= python@FreeBSD.org COMMENT= Python bindings to the Tk widget set (Python ${PYTHON_VER}) LICENSE= PSFL PORTSCOUT= ignore:1 -USES= compiler:c11 python:2.7+ tar:xz tk +USES= compiler:c11 python tar:xz tk USE_PYTHON= distutils autoplist allflavors DIST_SUBDIR= python DISTINFO_FILE= ${PORTSDIR}/lang/python${PYTHON_SUFFIX}/distinfo WRKSRC_SUBDIR= Modules PYDISTUTILS_INSTALLARGS+= --install-lib ${PYTHON_LIBDIR}/lib-dynload .include post-extract: -.if ${PYTHON_REL} < 30000 @${SED} -e "s|%%TK_VER%%|${TK_VER}|" ${FILESDIR}/setup.py > ${WRKSRC}/setup.py -.else - @${SED} -e "s|%%TK_VER%%|${TK_VER}|" ${FILESDIR}/setup3.py > ${WRKSRC}/setup.py .endif post-install: # ${STRIP_CMD} ${STAGEDIR}${PYTHON_LIBDIR}/lib-dynload/_tkinter.cpython-${PYTHON_SUFFIX}.so ${STRIP_CMD} ${STAGEDIR}${PYTHON_LIBDIR}/lib-dynload/_tkinter*.so .include diff --git a/x11-toolkits/py-tkinter/files/setup.py b/x11-toolkits/py-tkinter/files/setup.py index 99dd0d7fd1cf..bcf53d093857 100644 --- a/x11-toolkits/py-tkinter/files/setup.py +++ b/x11-toolkits/py-tkinter/files/setup.py @@ -1,41 +1,40 @@ #!/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" + raise SystemExit("Distutils problem") -install.sub_commands = filter(lambda (cmd, avl): 'egg' not in cmd, - install.sub_commands) +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" + string.replace(tkversion, ".", ""), - "tk" + string.replace(tkversion, ".", ""), +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)] ) diff --git a/x11-toolkits/py-tkinter/files/setup3.py b/x11-toolkits/py-tkinter/files/setup3.py deleted file mode 100644 index bcf53d093857..000000000000 --- a/x11-toolkits/py-tkinter/files/setup3.py +++ /dev/null @@ -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)] - )