ports/136198: [PATCH] x11-toolkits/py-tkinter: Fix building with python3*
Li-Wen Hsu
lwhsu at FreeBSD.org
Tue Jun 30 23:20:02 UTC 2009
>Number: 136198
>Category: ports
>Synopsis: [PATCH] x11-toolkits/py-tkinter: Fix building with python3*
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Tue Jun 30 23:20:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator: Li-Wen Hsu
>Release: FreeBSD 7.2-STABLE amd64
>Organization:
>Environment:
System: FreeBSD lucky7 7.2-STABLE FreeBSD 7.2-STABLE #0: Thu Jun 11 00:29:36 CST 2009
>Description:
- Fix building with python3*
- Use checksum file under lang/python${PYTHON_SUFFIX}/,
for removal lang/python/distinfo
Added file(s):
- files/setup3.py
Port maintainer (perky at FreeBSD.org) is cc'd.
Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:
>Fix:
--- py26-tkinter-2.6.2_3.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/x11-toolkits/py-tkinter/Makefile,v
retrieving revision 1.17
diff -u -u -r1.17 Makefile
--- Makefile 30 Mar 2009 20:19:19 -0000 1.17
+++ Makefile 30 Jun 2009 21:55:37 -0000
@@ -25,9 +25,15 @@
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>
Index: files/setup3.py
===================================================================
RCS file: files/setup3.py
diff -N files/setup3.py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ files/setup3.py 30 Jun 2009 21:55:37 -0000
@@ -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)]
+ )
--- py26-tkinter-2.6.2_3.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list