aboutsummaryrefslogtreecommitdiff
path: root/x11-toolkits
diff options
context:
space:
mode:
authorLi-Wen Hsu <lwhsu@FreeBSD.org>2009-07-08 09:10:02 +0000
committerLi-Wen Hsu <lwhsu@FreeBSD.org>2009-07-08 09:10:02 +0000
commitb50a93688f34285b3efed037107fd652777872c7 (patch)
tree843722163d1cf9ccc08be144138e13027de02a51 /x11-toolkits
parentc240b6cc9f40a25789364059e409e9c9e9198352 (diff)
downloadports-b50a93688f34285b3efed037107fd652777872c7.tar.gz
ports-b50a93688f34285b3efed037107fd652777872c7.zip
Notes
Diffstat (limited to 'x11-toolkits')
-rw-r--r--x11-toolkits/py-tkinter/Makefile10
-rw-r--r--x11-toolkits/py-tkinter/files/setup3.py40
2 files changed, 48 insertions, 2 deletions
diff --git a/x11-toolkits/py-tkinter/Makefile b/x11-toolkits/py-tkinter/Makefile
index d3a7d10b52f0..fa8814c06556 100644
--- a/x11-toolkits/py-tkinter/Makefile
+++ b/x11-toolkits/py-tkinter/Makefile
@@ -25,9 +25,15 @@ PYDISTUTILS_PKGNAME= Tkinter
PYDISTUTILS_PKGVERSION= 0.0.0
USE_TK= 82+
WRKSRC= ${PYTHON_WRKSRC}/Modules
-MD5_FILE= ${PORTSDIR}/lang/python/distinfo
+MD5_FILE= ${PORTSDIR}/lang/python${PYTHON_SUFFIX}/distinfo
+
+.include <bsd.port.pre.mk>
post-extract:
+.if ${PYTHON_REL} < 300
@${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
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/x11-toolkits/py-tkinter/files/setup3.py b/x11-toolkits/py-tkinter/files/setup3.py
new file mode 100644
index 000000000000..25c3bbc672f2
--- /dev/null
+++ b/x11-toolkits/py-tkinter/files/setup3.py
@@ -0,0 +1,40 @@
+#!/usr/bin/env python
+# To use:
+# python setup.py install
+#
+
+__version__ = "$FreeBSD$"
+
+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")
+
+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)]
+ )