Repository: arrow
Updated Branches:
  refs/heads/master c7839e9fa -> 393f46abd


ARROW-1023: Python: Fix bundling of arrow-cpp for macOS

Author: Uwe L. Korn <uw...@xhochy.com>

Closes #683 from xhochy/macos-wheels and squashes the following commits:

bdc5651 [Uwe L. Korn] Correct the amount of dots
e8d643f [Uwe L. Korn] Correct the amount of dots
4fa6d33 [Uwe L. Korn] Correct the amount of dots
5853b7c [Uwe L. Korn] Prepend LIBARRY_DIR
51a2b13 [Uwe L. Korn] Fix typo
7074eda [Uwe L. Korn] Version numbers are at a different place on macOS


Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/393f46ab
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/393f46ab
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/393f46ab

Branch: refs/heads/master
Commit: 393f46abd0fb087ce7d53443b1fad374b82a3692
Parents: c7839e9
Author: Uwe L. Korn <uw...@xhochy.com>
Authored: Sun May 14 14:37:43 2017 -0400
Committer: Wes McKinney <wes.mckin...@twosigma.com>
Committed: Sun May 14 14:37:43 2017 -0400

----------------------------------------------------------------------
 python/CMakeLists.txt | 24 ++++++++++++++++++------
 python/setup.py       |  7 ++++++-
 2 files changed, 24 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/393f46ab/python/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index 123dd5d..ddd174c 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -230,16 +230,28 @@ 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)
-  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_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_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()
+    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)

http://git-wip-us.apache.org/repos/asf/arrow/blob/393f46ab/python/setup.py
----------------------------------------------------------------------
diff --git a/python/setup.py b/python/setup.py
index b38fca4..9374af3 100644
--- a/python/setup.py
+++ b/python/setup.py
@@ -214,7 +214,12 @@ class build_ext(_build_ext):
             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[1:])
+                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])

Reply via email to