Skip to content

Instantly share code, notes, and snippets.

@derekbrokeit
Created December 17, 2012 03:21
Show Gist options
  • Save derekbrokeit/4315577 to your computer and use it in GitHub Desktop.
Save derekbrokeit/4315577 to your computer and use it in GitHub Desktop.
Build Python without OSX Tkinter Framework auto detection
diff --git a/setup.py b/setup.py
index 6b47451..51cc779 100644
--- a/setup.py
+++ b/setup.py
@@ -1702,9 +1702,9 @@ class PyBuildExt(build_ext):
# AquaTk is a separate method. Only one Tkinter will be built on
# Darwin - either AquaTk, if it is found, or X11 based Tk.
platform = self.get_platform()
- if (platform == 'darwin' and
- self.detect_tkinter_darwin(inc_dirs, lib_dirs)):
- return
+ # if (platform == 'darwin' and
+ # self.detect_tkinter_darwin(inc_dirs, lib_dirs)):
+ # return
# Assume we haven't found any of the libraries or include files
# The versions with dots are used on Unix, and the versions without
@@ -1793,6 +1793,8 @@ class PyBuildExt(build_ext):
if platform != "cygwin":
libs.append('X11')
+ include_dirs.append("/usr/local/include")
+ added_lib_dirs.append("/usr/local/lib")
ext = Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'],
define_macros=[('WITH_APPINIT', 1)] + defs,
include_dirs = include_dirs,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment