aboutsummaryrefslogtreecommitdiffstats
path: root/x11-toolkits/py-tkinter
diff options
context:
space:
mode:
authortg <tg@FreeBSD.org>2001-03-01 20:24:24 +0800
committertg <tg@FreeBSD.org>2001-03-01 20:24:24 +0800
commit0d4eb737b027cbe0d49dfc783d032ddef4b6359d (patch)
treeba6c25cc4172d920e429409ce398d3adf144df57 /x11-toolkits/py-tkinter
parentfacc47bf74a02699a46691cac6475e826d86dfbe (diff)
downloadfreebsd-ports-gnome-0d4eb737b027cbe0d49dfc783d032ddef4b6359d.tar.gz
freebsd-ports-gnome-0d4eb737b027cbe0d49dfc783d032ddef4b6359d.tar.zst
freebsd-ports-gnome-0d4eb737b027cbe0d49dfc783d032ddef4b6359d.zip
Use the py-distutils for building and installing.
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)]
+ )