lucene-pylucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Janssen <jans...@parc.com>
Subject Re: [VOTE] Release PyLucene 2.9.4-1 and 3.0.3-1
Date Tue, 07 Dec 2010 19:10:42 GMT
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',

Mime
View raw message