From ed3bc16bc4c5f489b439c3b4f9c5e42b6a731dd4 Mon Sep 17 00:00:00 2001 From: Thomas Gellekum Date: Thu, 1 Mar 2001 12:24:24 +0000 Subject: Use the py-distutils for building and installing. --- x11-toolkits/py-tkinter/files/setup.py | 40 ++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 x11-toolkits/py-tkinter/files/setup.py (limited to 'x11-toolkits/py-tkinter/files/setup.py') 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)] + ) -- cgit v1.2.3