From 7074eda329f144971d60d3d47eb47f7545a6545b Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Sat, 13 May 2017 15:47:31 +0200 Subject: [PATCH 1/6] Version numbers are at a different place on macOS Change-Id: I1716dfaa7b26bb1f1c0ed353ae4207982b692667 --- python/CMakeLists.txt | 23 +++++++++++++++++------ python/setup.py | 7 ++++++- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index d8287108d4c..2fc18115815 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -234,12 +234,23 @@ function(bundle_arrow_lib library_path) configure_file(${${library_path}} ${BUILD_OUTPUT_ROOT_DIRECTORY}/${LIBRARY_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} COPYONLY) - configure_file(${${library_path}}.${ARROW_ABI_VERSION} - ${BUILD_OUTPUT_ROOT_DIRECTORY}/${LIBRARY_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${ARROW_ABI_VERSION} - COPYONLY) - configure_file(${${library_path}}.${ARROW_SO_VERSION} - ${BUILD_OUTPUT_ROOT_DIRECTORY}/${LIBRARY_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${ARROW_SO_VERSION} - COPYONLY) + + if (APPLE) + configure_file(${LIBRARY_NAME}.${ARROW_ABI_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX} + ${BUILD_OUTPUT_ROOT_DIRECTORY}/${LIBRARY_NAME}.${ARROW_ABI_VERSION}.${CMAKE_SHARED_LIBRARY_SUFFIX} + COPYONLY) + configure_file(${LIBRARY_NAME}.${ARROW_SO_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX} + ${BUILD_OUTPUT_ROOT_DIRECTORY}/${LIBRARY_NAME}.${ARROW_SO_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX} + COPYONLY) + else() + configure_file(${${library_path}}.${ARROW_ABI_VERSION} + ${BUILD_OUTPUT_ROOT_DIRECTORY}/${LIBRARY_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${ARROW_ABI_VERSION} + COPYONLY) + configure_file(${${library_path}}.${ARROW_SO_VERSION} + ${BUILD_OUTPUT_ROOT_DIRECTORY}/${LIBRARY_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${ARROW_SO_VERSION} + COPYONLY) + endif() + SET(ARROW_SHARED_LIB ${BUILD_OUTPUT_ROOT_DIRECTORY}/${LIBRARY_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}) endfunction(bundle_arrow_lib) diff --git a/python/setup.py b/python/setup.py index 148224afb05..3eb0a5ce029 100644 --- a/python/setup.py +++ b/python/setup.py @@ -219,7 +219,12 @@ def move_lib(lib_name): lib_filename = (shared_library_prefix + lib_name + shared_library_suffix) # Also copy libraries with ABI/SO version suffix - libs = glob.glob(pjoin(self.build_type, lib_filename) + '*') + if sys.platform == 'darwin': + lib_pattern = (shared_library_prefix + lib_name + + "*" + shared_library_suffix) + libs = = glob.glob(pjoin(self.build_type, lib_pattern)) + else: + libs = glob.glob(pjoin(self.build_type, lib_filename) + '*') # Longest suffix library should be copied, all others symlinked libs.sort(key=lambda s: -len(s)) print(libs, libs[0]) From 51a2b13f4ffc6b33c5b184b71de225035e06de8f Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Sat, 13 May 2017 15:57:46 +0200 Subject: [PATCH 2/6] Fix typo Change-Id: I2f184e4ee5a89c45d92d27c2cf1b76a9f4e8167b --- python/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/setup.py b/python/setup.py index 3eb0a5ce029..b2ac1578fdb 100644 --- a/python/setup.py +++ b/python/setup.py @@ -222,7 +222,7 @@ def move_lib(lib_name): if sys.platform == 'darwin': lib_pattern = (shared_library_prefix + lib_name + "*" + shared_library_suffix) - libs = = glob.glob(pjoin(self.build_type, lib_pattern)) + libs = glob.glob(pjoin(self.build_type, lib_pattern)) else: libs = glob.glob(pjoin(self.build_type, lib_filename) + '*') # Longest suffix library should be copied, all others symlinked From 5853b7c4f646125a0f733c9d8c93fd624e409cc9 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Sat, 13 May 2017 16:44:00 +0200 Subject: [PATCH 3/6] Prepend LIBARRY_DIR Change-Id: I0f024fcbe5c8aad3696fc90a5547ab96829b08a5 --- python/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 2fc18115815..4f60bcaf543 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -230,16 +230,17 @@ find_package(Arrow REQUIRED) include_directories(SYSTEM ${ARROW_INCLUDE_DIR}) function(bundle_arrow_lib library_path) + get_filename_component(LIBRARY_DIR ${${library_path}} DIRECTORY) get_filename_component(LIBRARY_NAME ${${library_path}} NAME_WE) configure_file(${${library_path}} ${BUILD_OUTPUT_ROOT_DIRECTORY}/${LIBRARY_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} COPYONLY) if (APPLE) - configure_file(${LIBRARY_NAME}.${ARROW_ABI_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX} + configure_file(${LIBRARY_DIR}/${LIBRARY_NAME}.${ARROW_ABI_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX} ${BUILD_OUTPUT_ROOT_DIRECTORY}/${LIBRARY_NAME}.${ARROW_ABI_VERSION}.${CMAKE_SHARED_LIBRARY_SUFFIX} COPYONLY) - configure_file(${LIBRARY_NAME}.${ARROW_SO_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX} + configure_file(${LIBRARY_DIR}/${LIBRARY_NAME}.${ARROW_SO_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX} ${BUILD_OUTPUT_ROOT_DIRECTORY}/${LIBRARY_NAME}.${ARROW_SO_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX} COPYONLY) else() From 4fa6d33642a03c11b2d17edf96371880517d9818 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Sat, 13 May 2017 17:27:19 +0200 Subject: [PATCH 4/6] Correct the amount of dots Change-Id: Icfd1a56cd01a15e4866fd7fb5b556d6b2e432491 --- python/CMakeLists.txt | 2 +- python/setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 4f60bcaf543..97b8a876d48 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -238,7 +238,7 @@ function(bundle_arrow_lib library_path) if (APPLE) configure_file(${LIBRARY_DIR}/${LIBRARY_NAME}.${ARROW_ABI_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX} - ${BUILD_OUTPUT_ROOT_DIRECTORY}/${LIBRARY_NAME}.${ARROW_ABI_VERSION}.${CMAKE_SHARED_LIBRARY_SUFFIX} + ${BUILD_OUTPUT_ROOT_DIRECTORY}/${LIBRARY_NAME}.${ARROW_ABI_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX} COPYONLY) configure_file(${LIBRARY_DIR}/${LIBRARY_NAME}.${ARROW_SO_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX} ${BUILD_OUTPUT_ROOT_DIRECTORY}/${LIBRARY_NAME}.${ARROW_SO_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX} diff --git a/python/setup.py b/python/setup.py index b2ac1578fdb..46cd62185f4 100644 --- a/python/setup.py +++ b/python/setup.py @@ -221,7 +221,7 @@ def move_lib(lib_name): # Also copy libraries with ABI/SO version suffix if sys.platform == 'darwin': lib_pattern = (shared_library_prefix + lib_name + - "*" + shared_library_suffix) + ".*." + shared_library_suffix) libs = glob.glob(pjoin(self.build_type, lib_pattern)) else: libs = glob.glob(pjoin(self.build_type, lib_filename) + '*') From e8d643fca5741622a8e8f96fbf909e1832e3d795 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Sat, 13 May 2017 17:50:13 +0200 Subject: [PATCH 5/6] Correct the amount of dots Change-Id: I62d27ecefc9ff66cf2ab57f1a2d00bd7d7846051 --- python/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/setup.py b/python/setup.py index 46cd62185f4..b216d4b5a89 100644 --- a/python/setup.py +++ b/python/setup.py @@ -221,7 +221,7 @@ def move_lib(lib_name): # Also copy libraries with ABI/SO version suffix if sys.platform == 'darwin': lib_pattern = (shared_library_prefix + lib_name + - ".*." + shared_library_suffix) + ".*" + shared_library_suffix) libs = glob.glob(pjoin(self.build_type, lib_pattern)) else: libs = glob.glob(pjoin(self.build_type, lib_filename) + '*') From bdc56519e465f82491f2dba57a92488db7aa7a64 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Sun, 14 May 2017 09:58:24 +0200 Subject: [PATCH 6/6] Correct the amount of dots Change-Id: I553429adf2da1e346365059404e927319482430f --- python/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/setup.py b/python/setup.py index b216d4b5a89..108a63fa92c 100644 --- a/python/setup.py +++ b/python/setup.py @@ -221,7 +221,7 @@ def move_lib(lib_name): # Also copy libraries with ABI/SO version suffix if sys.platform == 'darwin': lib_pattern = (shared_library_prefix + lib_name + - ".*" + shared_library_suffix) + ".*" + shared_library_suffix[1:]) libs = glob.glob(pjoin(self.build_type, lib_pattern)) else: libs = glob.glob(pjoin(self.build_type, lib_filename) + '*')