[Midnightbsd-cvs] mports [15522] trunk/x11-toolkits: add python tkinter port.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Wed Sep 25 21:27:13 EDT 2013


Revision: 15522
          http://svnweb.midnightbsd.org/mports/?rev=15522
Author:   laffer1
Date:     2013-09-25 21:27:12 -0400 (Wed, 25 Sep 2013)
Log Message:
-----------
add python tkinter port.

Modified Paths:
--------------
    trunk/x11-toolkits/Makefile

Added Paths:
-----------
    trunk/x11-toolkits/py-tkinter/
    trunk/x11-toolkits/py-tkinter/Makefile
    trunk/x11-toolkits/py-tkinter/files/
    trunk/x11-toolkits/py-tkinter/files/setup.py
    trunk/x11-toolkits/py-tkinter/files/setup3.py
    trunk/x11-toolkits/py-tkinter/pkg-descr

Modified: trunk/x11-toolkits/Makefile
===================================================================
--- trunk/x11-toolkits/Makefile	2013-09-26 01:24:06 UTC (rev 15521)
+++ trunk/x11-toolkits/Makefile	2013-09-26 01:27:12 UTC (rev 15522)
@@ -53,6 +53,7 @@
 SUBDIR += py-gnome2
 SUBDIR += py-gtk2
 SUBDIR += py-gtksourceview
+SUBDIR += py-tkinter
 SUBDIR += py-vte
 SUBDIR += qt33
 SUBDIR += qt4-gui

Added: trunk/x11-toolkits/py-tkinter/Makefile
===================================================================
--- trunk/x11-toolkits/py-tkinter/Makefile	                        (rev 0)
+++ trunk/x11-toolkits/py-tkinter/Makefile	2013-09-26 01:27:12 UTC (rev 15522)
@@ -0,0 +1,39 @@
+# $MidnightBSD$
+# $FreeBSD: head/x11-toolkits/py-tkinter/Makefile 326662 2013-09-07 17:21:55Z sunpoet $
+
+PORTNAME=	tkinter
+PORTVERSION=	${PYTHON_PORTVERSION}
+CATEGORIES=	x11-toolkits python
+MASTER_SITES=	${PYTHON_MASTER_SITES}
+MASTER_SITE_SUBDIR=	${PYTHON_MASTER_SITE_SUBDIR}
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+DISTFILES=	${PYTHON_DISTFILE}
+
+MAINTAINER=	ports at MidnightBSD.org
+COMMENT=	Python bindings to the Tk widget set
+
+USE_PYTHON=	yes
+USE_PYDISTUTILS=yes
+USE_TK=		yes
+USE_XZ=		yes
+
+DIST_SUBDIR=	python
+DISTINFO_FILE=	${PORTSDIR}/lang/python${PYTHON_SUFFIX}/distinfo
+WRKSRC=		${PYTHON_WRKSRC}/Modules
+
+PYDISTUTILS_INSTALLARGS+=	--install-lib ${PYTHON_LIBDIR}/lib-dynload
+PYDISTUTILS_NOEGGINFO=	yes
+PYDISTUTILS_PKGNAME=	Tkinter
+
+PLIST_FILES=	%%PYTHON_LIBDIR%%/lib-dynload/_tkinter.so
+
+.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.post.mk>

Added: trunk/x11-toolkits/py-tkinter/files/setup.py
===================================================================
--- trunk/x11-toolkits/py-tkinter/files/setup.py	                        (rev 0)
+++ trunk/x11-toolkits/py-tkinter/files/setup.py	2013-09-26 01:27:12 UTC (rev 15522)
@@ -0,0 +1,43 @@
+#!/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"
+
+install.sub_commands = filter(lambda (cmd, avl): 'egg' not in cmd,
+                              install.sub_commands)
+
+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, ".", ""),
+        "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)]
+      )

Added: trunk/x11-toolkits/py-tkinter/files/setup3.py
===================================================================
--- trunk/x11-toolkits/py-tkinter/files/setup3.py	                        (rev 0)
+++ trunk/x11-toolkits/py-tkinter/files/setup3.py	2013-09-26 01:27:12 UTC (rev 15522)
@@ -0,0 +1,42 @@
+#!/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")
+
+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)]
+      )

Added: trunk/x11-toolkits/py-tkinter/pkg-descr
===================================================================
--- trunk/x11-toolkits/py-tkinter/pkg-descr	                        (rev 0)
+++ trunk/x11-toolkits/py-tkinter/pkg-descr	2013-09-26 01:27:12 UTC (rev 15522)
@@ -0,0 +1 @@
+Python bindings to the Tk widget set.



More information about the Midnightbsd-cvs mailing list