aboutsummaryrefslogtreecommitdiff
path: root/x11-toolkits/py-tkinter
diff options
context:
space:
mode:
authorThomas Gellekum <tg@FreeBSD.org>2001-03-01 12:24:24 +0000
committerThomas Gellekum <tg@FreeBSD.org>2001-03-01 12:24:24 +0000
commited3bc16bc4c5f489b439c3b4f9c5e42b6a731dd4 (patch)
treecbe8b754ea48cc7d22ada76867a6ed6f3b90bd7f /x11-toolkits/py-tkinter
parent80d3dac31c3678282ddc342252ff57003aaa85fe (diff)
downloadports-ed3bc16bc4c5f489b439c3b4f9c5e42b6a731dd4.tar.gz
ports-ed3bc16bc4c5f489b439c3b4f9c5e42b6a731dd4.zip
Use the py-distutils for building and installing.
Notes
Notes: svn path=/head/; revision=38930
Diffstat (limited to 'x11-toolkits/py-tkinter')
-rw-r--r--x11-toolkits/py-tkinter/Makefile14
-rw-r--r--x11-toolkits/py-tkinter/files/Setup8
-rw-r--r--x11-toolkits/py-tkinter/files/setup.py40
3 files changed, 45 insertions, 17 deletions
diff --git a/x11-toolkits/py-tkinter/Makefile b/x11-toolkits/py-tkinter/Makefile
index 0c1e5dcd1350..cca76405fb7a 100644
--- a/x11-toolkits/py-tkinter/Makefile
+++ b/x11-toolkits/py-tkinter/Makefile
@@ -15,24 +15,20 @@ DISTFILES= ${PYTHON_DISTFILE}
MAINTAINER= tg@FreeBSD.org
+BUILD_DEPENDS= ${PYDISTUTILS}
LIB_DEPENDS= tk83.1:${PORTSDIR}/x11-toolkits/tk83
DIST_SUBDIR= python
USE_PYTHON= yes
WRKSRC= ${PYTHON_WRKSRC}/Modules
-CONFIGURE_ENV= PYTHON=${PYTHON_CMD}
-ALL_TARGET= sharedmods
-MAKE_FLAGS= OPT="${CFLAGS}"
post-extract:
- @${CP} ${FILESDIR}/Setup ${WRKSRC}
- @${CP} ${PYTHON_LIBDIR}/config/Makefile.pre.in ${WRKSRC}
+ @${CP} ${FILESDIR}/setup.py ${WRKSRC}
-do-configure:
- @(cd ${WRKSRC}; \
- ${SETENV} ${CONFIGURE_ENV} ${MAKE} -f Makefile.pre.in boot)
+do-build:
+ @(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} setup.py build)
do-install:
- ${INSTALL_DATA} ${WRKSRC}/_tkinter.so ${PYTHON_SITELIBDIR}
+ @(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} setup.py install)
.include <bsd.port.mk>
diff --git a/x11-toolkits/py-tkinter/files/Setup b/x11-toolkits/py-tkinter/files/Setup
deleted file mode 100644
index 6a90582bf2da..000000000000
--- a/x11-toolkits/py-tkinter/files/Setup
+++ /dev/null
@@ -1,8 +0,0 @@
-*shared*
-
-# The _tkinter module.
-#
-# The TKPATH variable is always enabled, to save you the effort.
-TKPATH=:lib-tk
-
-_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT -I${X11BASE}/include -I${PREFIX}/include/tcl8.3 -I${PREFIX}/include/tk8.3 -L${PREFIX}/lib -ltk83 -ltcl83 -L${X11BASE}/lib -lX11
diff --git a/x11-toolkits/py-tkinter/files/setup.py b/x11-toolkits/py-tkinter/files/setup.py
new file mode 100644
index 000000000000..f977531b6810
--- /dev/null
+++ b/x11-toolkits/py-tkinter/files/setup.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 = "8.3"
+prefix = sysconfig.PREFIX
+# Python 1.5 doesn't have os.getenv()?
+x11base = os.environ['X11BASE'] 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)]
+ )