On Tue, 7 Dec 2010, Bill Janssen wrote:

Here's a patch to jcc/setup.py.  With this it builds on both my 10.6 and
my 10.5 systems.

Bill

diff -u pylucene-3.0.3-1/jcc/setup.py.orig pylucene-3.0.3-1/jcc/setup.py
--- pylucene-3.0.3-1/jcc/setup.py.orig  2010-12-07 18:50:25.000000000 -0800
+++ pylucene-3.0.3-1/jcc/setup.py       2010-12-07 19:02:44.000000000 -0800
@@ -43,8 +43,23 @@
else:
    JAVAHOME = None

+if platform in ("darwin"):
+    # possibly we shouldn't overwrite the platform module in the first place
+    import platform as _platform
+    import re
+    JAVAHOME = None
+    path = ("/Developer/SDKs/MacOSX" +
+            re.match("[0-9]+\.[0-9]+", _platform.mac_ver()[0]).group(0) +
+            ".sdk/System/Library/Frameworks/JavaVM.framework/Versions/Current")
+    if os.path.exists(path):
+        JAVAHOME = path
+    else:
+        path = "/System/Library/Frameworks/JavaVM.framework/Versions/Current"
+        if os.path.isdir(path) and os.path.exists(os.path.join(path, "Headers", 
"jni.h")):
+            JAVAHOME = path
+
JDK = {
-    'darwin': 
'/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/JavaVM.framework/Versions/Current',
+    'darwin': JAVAHOME,
    'ipod': '/usr/include/gcc',
    'linux2': '/usr/lib/jvm/java-6-openjdk',
    'sunos5': '/usr/jdk/instances/jdk1.6.0',

With this patch, it's going to pick the 10.5 SDK on my system. I have apparently both installed under /Developer/SDKs. It'd be nice if it picked the latest one.

Andi..

Reply via email to