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 (take 2)
Date Fri, 10 Dec 2010 14:10:41 GMT
Andi Vajda <vajda@apache.org> wrote:

> If I switch to Mike's recommendation then 10.6 is broken out of the box.
> I don't know what developer package he's referring to. Can you please
> send me the URL ?

Here's what his message said:

``It may be necessary to install the "Java for Mac OS X 10.6 Update 3
Developer Package" or "Java for Mac OS X 10.5 Update 8 Developer
Package" from <http://connect.apple.com> under the "Java" section, to
ensure the native headers are present in the JavaVM.framework. We are
aware that this has caused some inconvenience for otherwise native
projects that make use of the JNI API, and we are leaning towards just
shipping the headers in the regular customer software update package.''

That's the "developer package" he's referring to.

> Yes, your patch should work on both but would it not be obsoleted by
> the next time Apple moves these headers around again and setup.py is
> reverted back to the /System value in consequence ?
>
> I really want the latest up to date Mac OS X setup to build out of the
> box

Sure, me too!

> ...and it seems that the current setup.py settings are the only way
> unless your patch get added ?

My patch soft-codes the location of the SDK, so that it works with both
10.5 and 10.6.  Though, after hearing from Swingler, I'd revise it as
follows (I just did this in Emacs, haven't tested it):

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 = "/System/Library/Frameworks/JavaVM.framework/"
+    if os.path.isdir(path) and os.path.exists(os.path.join(path, "Headers", "jni.h")):
+        JAVAHOME = os.path.join(path, "Home")
+    else:
+        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
+
 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',

In other words, first look for the headers where Apple says they should
be, then if they aren't there, look in the Developer SDK, but the SDK
for the current version of OS X.

Philosophically, I see little point in avoiding the use of an actual
programming language that using setup.py gives you.  Otherwise, might as
well use another Makefile.

Bill

Mime
View raw message