From lwhsu@csie.net  Tue Jun 30 23:14:55 2009
Return-Path: <lwhsu@csie.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CE16F1065670
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 30 Jun 2009 23:14:55 +0000 (UTC)
	(envelope-from lwhsu@csie.net)
Received: from lucky7.csie.net (lucky7.cs.nctu.edu.tw [140.113.17.237])
	by mx1.freebsd.org (Postfix) with ESMTP id 980D68FC1D
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 30 Jun 2009 23:14:54 +0000 (UTC)
	(envelope-from lwhsu@csie.net)
Received: from lucky7.csie.net (localhost [127.0.0.1])
	by lucky7.csie.net (Postfix) with ESMTP id CEEDB147C5B;
	Wed,  1 Jul 2009 05:56:12 +0800 (CST)
Received: by lucky7.csie.net (Postfix, from userid 1000)
	id CD294147C1B; Wed,  1 Jul 2009 05:56:12 +0800 (CST)
Message-Id: <20090630215612.CD294147C1B@lucky7.csie.net>
Date: Wed,  1 Jul 2009 05:56:12 +0800 (CST)
From: Li-Wen Hsu <lwhsu@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: perky@FreeBSD.org
Subject: [PATCH] x11-toolkits/py-tkinter: Fix building with python3*
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         136198
>Category:       ports
>Synopsis:       [PATCH] x11-toolkits/py-tkinter: Fix building with python3*
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    perky
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 30 23:20:01 UTC 2009
>Closed-Date:    Wed Jul 08 09:12:54 UTC 2009
>Last-Modified:  Wed Jul  8 09:20:03 UTC 2009
>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@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:
Responsible-Changed-From-To: freebsd-ports-bugs->perky 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Tue Jun 30 23:20:37 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=136198 
State-Changed-From-To: open->closed 
State-Changed-By: lwhsu 
State-Changed-When: Wed Jul 8 09:12:53 UTC 2009 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=136198 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/136198: commit references a PR
Date: Wed,  8 Jul 2009 09:10:12 +0000 (UTC)

 lwhsu       2009-07-08 09:10:02 UTC
 
   FreeBSD ports repository
 
   Modified files:
     x11-toolkits/py-tkinter Makefile 
   Added files:
     x11-toolkits/py-tkinter/files setup3.py 
   Log:
   - Fix building with python3*
   - Use checksum file under lang/python${PYTHON_SUFFIX}/,
     for removal lang/python/distinfo
   
   PR:             ports/136198
   Submitted by:   lwhsu
   Approved by:    perky
   
   Revision  Changes    Path
   1.18      +8 -2      ports/x11-toolkits/py-tkinter/Makefile
   1.1       +40 -0     ports/x11-toolkits/py-tkinter/files/setup3.py (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
