Cleanups/fixes for the library issue conglomerate (#897)

* Python: Disable distribution of static library on linux and macos; add environment variable LIBUNICORN_PATH to let user specify location of native library; prevent build of native library if this option is enabled; closes #869

* Python: Update README.TXT to describe how to manage the building and usage of the native library
This commit is contained in:
Andrew Dutcher
2017-09-24 07:33:01 -07:00
committed by Nguyen Anh Quynh
parent 13007eb12a
commit 12642c2555
3 changed files with 22 additions and 8 deletions

View File

@ -71,13 +71,15 @@ def _load_lib(path):
_uc = None
# Loading attempts, in order
# - user-provided environment variable
# - pkg_resources can get us the path to the local libraries
# - we can get the path to the local libraries by parsing our filename
# - global load
# - python's lib directory
# - last-gasp attempt at some hardcoded paths on darwin and linux
_path_list = [pkg_resources.resource_filename(__name__, 'lib'),
_path_list = [os.getenv('LIBUNICORN_PATH', None),
pkg_resources.resource_filename(__name__, 'lib'),
os.path.join(os.path.split(__file__)[0], 'lib'),
'',
distutils.sysconfig.get_python_lib(),
@ -88,6 +90,7 @@ _path_list = [pkg_resources.resource_filename(__name__, 'lib'),
#print("-" * 80)
for _path in _path_list:
if _path is None: continue
_uc = _load_lib(_path)
if _uc is not None: break
else: