lucene-pylucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject svn commit: r1723582 - in /lucene/pylucene/trunk/jcc: CHANGES helpers/darwin.py setup.py
Date Thu, 07 Jan 2016 16:24:07 GMT
Author: vajda
Date: Thu Jan  7 16:24:07 2016
New Revision: 1723582

URL: http://svn.apache.org/viewvc?rev=1723582&view=rev
Log:
 - monkeypatched customize_compiler to fix darwin linker error due to -Wl,-x
 - added check that MACOSX_DEPLOYMENT_TARGET is set to at least 10.5

Modified:
    lucene/pylucene/trunk/jcc/CHANGES
    lucene/pylucene/trunk/jcc/helpers/darwin.py
    lucene/pylucene/trunk/jcc/setup.py

Modified: lucene/pylucene/trunk/jcc/CHANGES
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/CHANGES?rev=1723582&r1=1723581&r2=1723582&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/CHANGES (original)
+++ lucene/pylucene/trunk/jcc/CHANGES Thu Jan  7 16:24:07 2016
@@ -1,3 +1,9 @@
+Version 2.21 ->
+--------------------
+ - monkeypatched customize_compiler to fix darwin linker error due to -Wl,-x
+ - added check that MACOSX_DEPLOYMENT_TARGET is set to at least 10.5
+ - 
+
 Version 2.20 -> 2.21
 --------------------
  - improved through-layer Python error handling (with Lee Skillen)

Modified: lucene/pylucene/trunk/jcc/helpers/darwin.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/helpers/darwin.py?rev=1723582&r1=1723581&r2=1723582&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/helpers/darwin.py (original)
+++ lucene/pylucene/trunk/jcc/helpers/darwin.py Thu Jan  7 16:24:07 2016
@@ -52,3 +52,14 @@ if sys.platform == "darwin":
         if os.path.exists(os.path.join(_path, "Headers", "jni.h")):
             JAVAFRAMEWORKS = _path
             print >>sys.stderr, 'found JAVAFRAMEWORKS =', JAVAFRAMEWORKS
+
+    # monkeypatch customize_compiler so that we can remove -Wl,-x from LDSHARED
+    # set in setuptools.command.build_ext.build_ext.setup_shlib_compiler
+    from distutils.sysconfig import customize_compiler, get_config_vars
+
+    def _customize_compiler(compiler):
+        get_config_vars()['LDSHARED'] = "gcc -dynamiclib -undefined dynamic_lookup"
+        customize_compiler(compiler)
+
+    from distutils import sysconfig
+    sysconfig.customize_compiler = _customize_compiler

Modified: lucene/pylucene/trunk/jcc/setup.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/setup.py?rev=1723582&r1=1723581&r2=1723582&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/setup.py (original)
+++ lucene/pylucene/trunk/jcc/setup.py Thu Jan  7 16:24:07 2016
@@ -188,7 +188,8 @@ try:
     if 'USE_DISTUTILS' in os.environ:
         raise ImportError
     from setuptools import setup, Extension
-    from pkg_resources import require
+    from pkg_resources import require, parse_version
+
     with_setuptools = require('setuptools')[0].parsed_version
 
     enable_shared = False
@@ -200,16 +201,13 @@ try:
             enable_shared = True
 
         elif platform == 'darwin':
+            if (parse_version(os.environ.get('MACOSX_DEPLOYMENT_TARGET', '')) <
+                parse_version('10.5')):
+              raise RuntimeError('''
+                       
+Please set the environment variable MACOSX_DEPLOYMENT_TARGET to at least 10.5.
+''')
             enable_shared = True
-            if with_setuptools >= with_setuptools_116:
-                # fix Library building by monkey-patching expected _config_vars
-                # into build_ext otherwise build_ext is using sysconfig's
-                # instead, wrongly
-                from setuptools.command import build_ext
-                from distutils.sysconfig import get_config_var
-                get_config_var("LDSHARED")  # ensure _config_vars is initialized
-                from distutils.sysconfig import _config_vars
-                build_ext._CONFIG_VARS = _config_vars
 
         elif platform == 'linux2':
             from helpers.linux import patch_setuptools



Mime
View raw message