From 51ebf02edac4a39dcd95d51b3a3d333943854ea5 Mon Sep 17 00:00:00 2001 From: DonBraulio Date: Wed, 29 May 2019 18:02:22 -0300 Subject: [PATCH 1/2] Installation: improved search for libboost-python3 --- setup.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index fc0f2dc..d7120ff 100755 --- a/setup.py +++ b/setup.py @@ -14,14 +14,18 @@ from setuptools import setup, Extension import sys +import glob + def check_system(systems, message): import sys + if sys.platform in systems: return print(message) sys.exit(1) + OTHER_OS_MESSAGE = """ ***************************************************** * pyxpcconnection only works on Mac OS X * @@ -39,7 +43,20 @@ def check_system(systems, message): check_system(['darwin'], OTHER_OS_MESSAGE) if sys.version_info.major == 3: - boost_libs = ["boost_python-py34"] + found_lib = None + sub_version = sys.version_info.minor + general_search = "*boost_python*3*.a" + preferred_search = "*boost_python*3*{}*".format(sub_version) + for search_term in [preferred_search, general_search]: + results = glob.glob("/usr/local/lib/{}".format(search_term)) + if results: + found_lib = results[0] + if found_lib: + boost_libs = [found_lib] + else: + raise Exception( + "Boost library for python3 not found in /usr/local/lib. Please install boost-python3." + ) else: boost_libs = ["boost_python"] From 87f06effbc3979354438132ad2e38d7c600c2be0 Mon Sep 17 00:00:00 2001 From: DonBraulio Date: Wed, 29 May 2019 18:37:26 -0300 Subject: [PATCH 2/2] Package name changed from xpcconnection to pyxpcconnection, for compatibility with pygattosx --- setup.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index d7120ff..e4f2328 100755 --- a/setup.py +++ b/setup.py @@ -71,13 +71,13 @@ def check_system(systems, message): ] setup( - name = "xpcconnection", - version = "0.0.1", - author = "Matthew Else", - author_email = "matthew.else@arm.com", - description = "Python XPC Library for Mac OSX", - license = "Apache-2.0", - keywords = "ble", - url = "about:blank", + name="pyxpcconnection", + version="0.0.1", + author="Matthew Else", + author_email="matthew.else@arm.com", + description="Python XPC Library for Mac OSX", + license="Apache-2.0", + keywords="ble", + url="about:blank", ext_modules=modules, )