Blob Blame History Raw
--- apache-arrow-4.0.1/cpp/cmake_modules/ThirdpartyToolchain.cmake.orig	2022-01-13 08:22:59.432680621 -0500
+++ apache-arrow-4.0.1/cpp/cmake_modules/ThirdpartyToolchain.cmake	2022-01-13 11:11:47.280058819 -0500
@@ -333,14 +333,6 @@
   set(${_VARIABLE_NAME} ${_VARIABLE_VALUE})
 endforeach()
 
-if(DEFINED ENV{ARROW_ABSL_URL})
-  set(ABSL_SOURCE_URL "$ENV{ARROW_ABSL_URL}")
-else()
-  set_urls(
-    ABSL_SOURCE_URL
-    "https://github.com/abseil/abseil-cpp/archive/${ARROW_ABSL_BUILD_VERSION}.tar.gz")
-endif()
-
 if(DEFINED ENV{ARROW_AWS_C_COMMON_URL})
   set(AWS_C_COMMON_SOURCE_URL "$ENV{ARROW_AWS_C_COMMON_URL}")
 else()
@@ -415,16 +407,6 @@
     )
 endif()
 
-if(DEFINED ENV{ARROW_CARES_URL})
-  set(CARES_SOURCE_URL "$ENV{ARROW_CARES_URL}")
-else()
-  set_urls(
-    CARES_SOURCE_URL
-    "https://c-ares.haxx.se/download/c-ares-${ARROW_CARES_BUILD_VERSION}.tar.gz"
-    "https://github.com/ursa-labs/thirdparty/releases/download/latest/cares-${ARROW_CARES_BUILD_VERSION}.tar.gz"
-    )
-endif()
-
 if(DEFINED ENV{ARROW_GBENCHMARK_URL})
   set(GBENCHMARK_SOURCE_URL "$ENV{ARROW_GBENCHMARK_URL}")
 else()
@@ -455,16 +437,6 @@
     )
 endif()
 
-if(DEFINED ENV{ARROW_GRPC_URL})
-  set(GRPC_SOURCE_URL "$ENV{ARROW_GRPC_URL}")
-else()
-  set_urls(
-    GRPC_SOURCE_URL
-    "https://github.com/grpc/grpc/archive/${ARROW_GRPC_BUILD_VERSION}.tar.gz"
-    "https://github.com/ursa-labs/thirdparty/releases/download/latest/grpc-${ARROW_GRPC_BUILD_VERSION}.tar.gz"
-    )
-endif()
-
 if(DEFINED ENV{ARROW_GTEST_URL})
   set(GTEST_SOURCE_URL "$ENV{ARROW_GTEST_URL}")
 else()
@@ -558,29 +530,6 @@
     )
 endif()
 
-if(DEFINED ENV{ARROW_THRIFT_URL})
-  set(THRIFT_SOURCE_URL "$ENV{ARROW_THRIFT_URL}")
-else()
-  set_urls(
-    THRIFT_SOURCE_URL
-    "http://www.apache.org/dyn/closer.cgi?action=download&filename=/thrift/${ARROW_THRIFT_BUILD_VERSION}/thrift-${ARROW_THRIFT_BUILD_VERSION}.tar.gz"
-    "https://downloads.apache.org/thrift/${ARROW_THRIFT_BUILD_VERSION}/thrift-${ARROW_THRIFT_BUILD_VERSION}.tar.gz"
-    "https://github.com/apache/thrift/archive/v${ARROW_THRIFT_BUILD_VERSION}.tar.gz"
-    "https://apache.claz.org/thrift/${ARROW_THRIFT_BUILD_VERSION}/thrift-${ARROW_THRIFT_BUILD_VERSION}.tar.gz"
-    "https://apache.cs.utah.edu/thrift/${ARROW_THRIFT_BUILD_VERSION}/thrift-${ARROW_THRIFT_BUILD_VERSION}.tar.gz"
-    "https://apache.mirrors.lucidnetworks.net/thrift/${ARROW_THRIFT_BUILD_VERSION}/thrift-${ARROW_THRIFT_BUILD_VERSION}.tar.gz"
-    "https://apache.osuosl.org/thrift/${ARROW_THRIFT_BUILD_VERSION}/thrift-${ARROW_THRIFT_BUILD_VERSION}.tar.gz"
-    "https://ftp.wayne.edu/apache/thrift/${ARROW_THRIFT_BUILD_VERSION}/thrift-${ARROW_THRIFT_BUILD_VERSION}.tar.gz"
-    "https://mirror.olnevhost.net/pub/apache/thrift/${ARROW_THRIFT_BUILD_VERSION}/thrift-${ARROW_THRIFT_BUILD_VERSION}.tar.gz"
-    "https://mirrors.gigenet.com/apache/thrift/${ARROW_THRIFT_BUILD_VERSION}/thrift-${ARROW_THRIFT_BUILD_VERSION}.tar.gz"
-    "https://mirrors.koehn.com/apache/thrift/${ARROW_THRIFT_BUILD_VERSION}/thrift-${ARROW_THRIFT_BUILD_VERSION}.tar.gz"
-    "https://mirrors.ocf.berkeley.edu/apache/thrift/${ARROW_THRIFT_BUILD_VERSION}/thrift-${ARROW_THRIFT_BUILD_VERSION}.tar.gz"
-    "https://mirrors.sonic.net/apache/thrift/${ARROW_THRIFT_BUILD_VERSION}/thrift-${ARROW_THRIFT_BUILD_VERSION}.tar.gz"
-    "https://us.mirrors.quenda.co/apache/thrift/${ARROW_THRIFT_BUILD_VERSION}/thrift-${ARROW_THRIFT_BUILD_VERSION}.tar.gz"
-    "https://github.com/ursa-labs/thirdparty/releases/download/latest/thrift-${ARROW_THRIFT_BUILD_VERSION}.tar.gz"
-    )
-endif()
-
 if(DEFINED ENV{ARROW_UTF8PROC_URL})
   set(ARROW_UTF8PROC_SOURCE_URL "$ENV{ARROW_UTF8PROC_URL}")
 else()
@@ -590,14 +539,6 @@
     )
 endif()
 
-if(DEFINED ENV{ARROW_XSIMD_URL})
-  set(XSIMD_SOURCE_URL "$ENV{ARROW_XSIMD_URL}")
-else()
-  set_urls(
-    XSIMD_SOURCE_URL
-    "https://github.com/xtensor-stack/xsimd/archive/${ARROW_XSIMD_BUILD_VERSION}.tar.gz")
-endif()
-
 if(DEFINED ENV{ARROW_ZLIB_URL})
   set(ZLIB_SOURCE_URL "$ENV{ARROW_ZLIB_URL}")
 else()
@@ -1104,8 +1045,8 @@
   set(GLOG_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
   set(GLOG_CMAKE_C_FLAGS "${EP_C_FLAGS} -fPIC")
   if(Threads::Threads)
-    set(GLOG_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -pthread -lpthread")
-    set(GLOG_CMAKE_C_FLAGS "${EP_C_FLAGS} -fPIC -pthread -lpthread")
+    set(GLOG_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -pthread")
+    set(GLOG_CMAKE_C_FLAGS "${EP_C_FLAGS} -fPIC -pthread")
   endif()
 
   if(APPLE)
@@ -1240,28 +1181,6 @@
     message(
       FATAL_ERROR "Building thrift using ExternalProject requires at least CMake 3.10")
   endif()
-  message("Building Apache Thrift from source")
-  set(THRIFT_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/thrift_ep-install")
-  set(THRIFT_INCLUDE_DIR "${THRIFT_PREFIX}/include")
-  set(THRIFT_CMAKE_ARGS
-      ${EP_COMMON_CMAKE_ARGS}
-      "-DCMAKE_INSTALL_PREFIX=${THRIFT_PREFIX}"
-      "-DCMAKE_INSTALL_RPATH=${THRIFT_PREFIX}/lib"
-      -DBUILD_COMPILER=OFF
-      -DBUILD_SHARED_LIBS=OFF
-      -DBUILD_TESTING=OFF
-      -DBUILD_EXAMPLES=OFF
-      -DBUILD_TUTORIALS=OFF
-      -DWITH_QT4=OFF
-      -DWITH_C_GLIB=OFF
-      -DWITH_JAVA=OFF
-      -DWITH_PYTHON=OFF
-      -DWITH_HASKELL=OFF
-      -DWITH_CPP=ON
-      -DWITH_STATIC_LIB=ON
-      -DWITH_LIBEVENT=OFF
-      # Work around https://gitlab.kitware.com/cmake/cmake/issues/18865
-      -DBoost_NO_BOOST_CMAKE=ON)
 
   # Thrift also uses boost. Forward important boost settings if there were ones passed.
   if(DEFINED BOOST_ROOT)
@@ -1271,57 +1190,10 @@
     list(APPEND THRIFT_CMAKE_ARGS "-DBoost_NAMESPACE=${Boost_NAMESPACE}")
   endif()
 
-  set(THRIFT_STATIC_LIB_NAME "${CMAKE_STATIC_LIBRARY_PREFIX}thrift")
-  if(MSVC)
-    if(ARROW_USE_STATIC_CRT)
-      set(THRIFT_STATIC_LIB_NAME "${THRIFT_STATIC_LIB_NAME}mt")
-      list(APPEND THRIFT_CMAKE_ARGS "-DWITH_MT=ON")
-    else()
-      set(THRIFT_STATIC_LIB_NAME "${THRIFT_STATIC_LIB_NAME}md")
-      list(APPEND THRIFT_CMAKE_ARGS "-DWITH_MT=OFF")
-    endif()
-  endif()
-  if(${UPPERCASE_BUILD_TYPE} STREQUAL "DEBUG")
-    set(THRIFT_STATIC_LIB_NAME "${THRIFT_STATIC_LIB_NAME}d")
-  endif()
-  set(THRIFT_STATIC_LIB
-      "${THRIFT_PREFIX}/lib/${THRIFT_STATIC_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}")
-
-  if(BOOST_VENDORED)
-    set(THRIFT_DEPENDENCIES ${THRIFT_DEPENDENCIES} boost_ep)
-  endif()
-
-  externalproject_add(thrift_ep
-                      URL ${THRIFT_SOURCE_URL}
-                      URL_HASH "MD5=${ARROW_THRIFT_BUILD_MD5_CHECKSUM}"
-                      BUILD_BYPRODUCTS "${THRIFT_STATIC_LIB}"
-                      CMAKE_ARGS ${THRIFT_CMAKE_ARGS}
-                      DEPENDS ${THRIFT_DEPENDENCIES} ${EP_LOG_OPTIONS})
-
-  add_library(thrift::thrift STATIC IMPORTED)
-  # The include directory must exist before it is referenced by a target.
-  file(MAKE_DIRECTORY "${THRIFT_INCLUDE_DIR}")
-  set_target_properties(thrift::thrift
-                        PROPERTIES IMPORTED_LOCATION "${THRIFT_STATIC_LIB}"
-                                   INTERFACE_INCLUDE_DIRECTORIES "${THRIFT_INCLUDE_DIR}")
-  add_dependencies(toolchain thrift_ep)
-  add_dependencies(thrift::thrift thrift_ep)
-  set(THRIFT_VERSION ${ARROW_THRIFT_BUILD_VERSION})
+  add_library(thrift INTERFACE IMPORTED)
 
-  list(APPEND ARROW_BUNDLED_STATIC_LIBS thrift::thrift)
 endmacro()
 
-if(ARROW_WITH_THRIFT)
-  # We already may have looked for Thrift earlier, when considering whether
-  # to build Boost, so don't look again if already found.
-  if(NOT Thrift_FOUND AND NOT THRIFT_FOUND)
-    # Thrift c++ code generated by 0.13 requires 0.11 or greater
-    resolve_dependency(Thrift REQUIRED_VERSION 0.11.0)
-  endif()
-  # TODO: Don't use global includes but rather target_include_directories
-  include_directories(SYSTEM ${THRIFT_INCLUDE_DIR})
-endif()
-
 # ----------------------------------------------------------------------
 # Protocol Buffers (required for ORC and Flight and Gandiva libraries)
 
@@ -1920,85 +1792,10 @@
 endif()
 
 macro(build_xsimd)
-  message(STATUS "Building xsimdxx from source")
-  set(ZSTD_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/xsimd_ep-install")
-
-  set(XSIMD_CMAKE_ARGS
-      ${EP_COMMON_TOOLCHAIN}
-      "-DCMAKE_INSTALL_PREFIX=${XSIMD_PREFIX}"
-      -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-      -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
-      -DXSIMD_BUILD_PROGRAMS=off
-      -DXSIMD_BUILD_SHARED=off
-      -DXSIMD_BUILD_STATIC=on
-      -DXSIMD_MULTITHREAD_SUPPORT=off)
-
-  if(MSVC)
-    set(XSIMD_STATIC_LIB "${XSIMD_PREFIX}/${CMAKE_INSTALL_LIBDIR}/xsimd_static.lib")
-    if(ARROW_USE_STATIC_CRT)
-      set(XSIMD_CMAKE_ARGS ${XSIMD_CMAKE_ARGS} "-DXSIMD_USE_STATIC_RUNTIME=on")
-    endif()
-  else()
-    # Only pass our C flags on Unix as on MSVC it leads to a
-    # "incompatible command-line options" error
-    set(XSIMD_CMAKE_ARGS
-        ${XSIMD_CMAKE_ARGS}
-        -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-        -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-        -DCMAKE_C_FLAGS=${EP_C_FLAGS}
-        -DCMAKE_CXX_FLAGS=${EP_CXX_FLAGS})
-  endif()
-
-  if(CMAKE_VERSION VERSION_LESS 3.7)
-    message(FATAL_ERROR "Building xsimd using ExternalProject requires at least CMake 3.7")
-  endif()
-
-  externalproject_add(xsimd_ep
-                      ${EP_LOG_OPTIONS}
-                      CMAKE_ARGS ${XSIMD_CMAKE_ARGS}
-                      SOURCE_SUBDIR "build/cmake"
-                      INSTALL_DIR ${XSIMD_PREFIX}
-                      URL ${XSIMD_SOURCE_URL}
-                      BUILD_BYPRODUCTS "${XSIMD_STATIC_LIB}")
-
-  file(MAKE_DIRECTORY "${XSIMD_PREFIX}/include")
-
-  add_library(xsimd::libxsimd STATIC IMPORTED)
-  set_target_properties(xsimd::libxsimd
-                        PROPERTIES IMPORTED_LOCATION "${XSIMD_STATIC_LIB}"
-                                   INTERFACE_INCLUDE_DIRECTORIES "${XSIMD_PREFIX}/include")
-
-  add_dependencies(toolchain xsimd_ep)
-  add_dependencies(xsimd::libxsimd xsimd_ep)
+  message(STATUS "Building xsimd from source")
 
-  list(APPEND ARROW_BUNDLED_STATIC_LIBS xsimd::libxsimd)
 endmacro()
 
-if(ARROW_WITH_XSIMD)
-  resolve_dependency(xsimd)
-
-  if(TARGET xsimd::libxsimd)
-    set(ARROW_XSIMD_LIBXSIMD xsimd::libxsimd)
-  else()
-    # "SYSTEM" source will prioritize cmake config, which exports
-    # xsimd::libxsimd_{static,shared}
-    if(ARROW_XSIMD_USE_SHARED)
-      if(TARGET xsimd::libxsimd_shared)
-        set(ARROW_XSIMD_LIBXSIMD xsimd::libxsimd_shared)
-      endif()
-    else()
-      if(TARGET xsimd::libxsimd_static)
-        set(ARROW_XSIMD_LIBXSIMD xsimd::libxsimd_static)
-      endif()
-    endif()
-  endif()
-
-  # TODO: Don't use global includes but rather target_include_directories
-  get_target_property(XSIMD_INCLUDE_DIR ${ARROW_XSIMD_LIBXSIMD}
-                      INTERFACE_INCLUDE_DIRECTORIES)
-  include_directories(SYSTEM ${XSIMD_INCLUDE_DIR})
-endif()
-
 macro(build_zlib)
   message(STATUS "Building ZLIB from source")
   set(ZLIB_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/zlib_ep/src/zlib_ep-install")
@@ -2347,37 +2144,8 @@
 
 macro(build_cares)
   message(STATUS "Building c-ares from source")
-  set(CARES_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/cares_ep-install")
-  set(CARES_INCLUDE_DIR "${CARES_PREFIX}/include")
 
-  # If you set -DCARES_SHARED=ON then the build system names the library
-  # libcares_static.a
-  set(
-    CARES_STATIC_LIB
-    "${CARES_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}cares${CMAKE_STATIC_LIBRARY_SUFFIX}"
-    )
-
-  set(CARES_CMAKE_ARGS
-      "${EP_COMMON_CMAKE_ARGS}"
-      -DCARES_STATIC=ON
-      -DCARES_SHARED=OFF
-      -DCMAKE_INSTALL_LIBDIR=lib
-      "-DCMAKE_INSTALL_PREFIX=${CARES_PREFIX}")
-
-  externalproject_add(cares_ep
-                      ${EP_LOG_OPTIONS}
-                      URL ${CARES_SOURCE_URL}
-                      CMAKE_ARGS ${CARES_CMAKE_ARGS}
-                      BUILD_BYPRODUCTS "${CARES_STATIC_LIB}")
-
-  file(MAKE_DIRECTORY ${CARES_INCLUDE_DIR})
-
-  add_dependencies(toolchain cares_ep)
-  add_library(c-ares::cares STATIC IMPORTED)
-  set_target_properties(c-ares::cares
-                        PROPERTIES IMPORTED_LOCATION "${CARES_STATIC_LIB}"
-                                   INTERFACE_INCLUDE_DIRECTORIES "${CARES_INCLUDE_DIR}")
-  add_dependencies(c-ares::cares cares_ep)
+  add_library(cares INTERFACE IMPORTED)
 
   if(APPLE)
     # libresolv must be linked from c-ares version 1.16.1
@@ -2386,8 +2154,6 @@
                           PROPERTIES INTERFACE_LINK_LIBRARIES "${LIBRESOLV_LIBRARY}")
   endif()
 
-  set(CARES_VENDORED TRUE)
-
   list(APPEND ARROW_BUNDLED_STATIC_LIBS c-ares::cares)
 endmacro()
 
@@ -2402,17 +2168,6 @@
 
   message(STATUS "Building gRPC from source")
 
-  # First need to build Abseil
-  set(ABSL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/absl_ep-install")
-  set(ABSL_CMAKE_ARGS
-      "${EP_COMMON_CMAKE_ARGS}"
-      -DABSL_RUN_TESTS=OFF
-      -DCMAKE_CXX_STANDARD=11
-      -DCMAKE_INSTALL_LIBDIR=lib
-      "-DCMAKE_INSTALL_PREFIX=${ABSL_PREFIX}")
-  set(ABSL_BUILD_BYPRODUCTS)
-  set(ABSL_LIBRARIES)
-
   # Abseil libraries gRPC depends on
   # Follows grpc++ package config template for link order of libraries
   # https://github.com/grpc/grpc/blob/v1.35.0/CMakeLists.txt#L16361
@@ -2440,23 +2195,10 @@
       raw_logging_internal)
 
   foreach(_ABSL_LIB ${_ABSL_LIBS})
-    set(
-      _ABSL_STATIC_LIBRARY
-      "${ABSL_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}absl_${_ABSL_LIB}${CMAKE_STATIC_LIBRARY_SUFFIX}"
-      )
-    add_library(absl::${_ABSL_LIB} STATIC IMPORTED)
-    set_target_properties(absl::${_ABSL_LIB}
-                          PROPERTIES IMPORTED_LOCATION ${_ABSL_STATIC_LIBRARY})
-    list(APPEND ABSL_BUILD_BYPRODUCTS ${_ABSL_STATIC_LIBRARY})
-    list(APPEND ABSL_LIBRARIES absl::${_ABSL_LIB})
+    add_library(absl_${_ABSL_LIB} INTERFACE IMPORTED)
+    list(APPEND ABSL_LIBRARIES absl_${_ABSL_LIB})
   endforeach()
 
-  externalproject_add(absl_ep
-                      ${EP_LOG_OPTIONS}
-                      URL ${ABSL_SOURCE_URL}
-                      CMAKE_ARGS ${ABSL_CMAKE_ARGS}
-                      BUILD_BYPRODUCTS ${ABSL_BUILD_BYPRODUCTS})
-
   set(GRPC_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/grpc_ep-prefix/src/grpc_ep-build")
   set(GRPC_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/grpc_ep-install")
   set(GRPC_HOME "${GRPC_PREFIX}")
@@ -2485,7 +2227,6 @@
 
   add_custom_target(grpc_dependencies)
 
-  add_dependencies(grpc_dependencies absl_ep)
   if(CARES_VENDORED)
     add_dependencies(grpc_dependencies cares_ep)
   endif()
@@ -2577,58 +2318,30 @@
   # Work around https://gitlab.kitware.com/cmake/cmake/issues/15052
   file(MAKE_DIRECTORY ${GRPC_INCLUDE_DIR})
 
-  add_library(gRPC::upb STATIC IMPORTED)
-  set_target_properties(gRPC::upb
-                        PROPERTIES IMPORTED_LOCATION "${GRPC_STATIC_LIBRARY_UPB}"
-                                   INTERFACE_INCLUDE_DIRECTORIES "${GRPC_INCLUDE_DIR}")
-
-  add_library(gRPC::gpr STATIC IMPORTED)
-  set_target_properties(gRPC::gpr
-                        PROPERTIES IMPORTED_LOCATION "${GRPC_STATIC_LIBRARY_GPR}"
-                                   INTERFACE_INCLUDE_DIRECTORIES "${GRPC_INCLUDE_DIR}")
+  add_library(upb INTERFACE IMPORTED)
 
-  add_library(gRPC::address_sorting STATIC IMPORTED)
-  set_target_properties(gRPC::address_sorting
-                        PROPERTIES IMPORTED_LOCATION
-                                   "${GRPC_STATIC_LIBRARY_ADDRESS_SORTING}"
-                                   INTERFACE_INCLUDE_DIRECTORIES "${GRPC_INCLUDE_DIR}")
+  add_library(gpr INTERFACE IMPORTED)
 
-  add_library(gRPC::grpc STATIC IMPORTED)
+  add_library(address_sorting INTERFACE IMPORTED)
+
+  add_library(grpc INTERFACE IMPORTED)
   set(GRPC_LINK_LIBRARIES
-      gRPC::gpr
-      gRPC::upb
-      gRPC::address_sorting
+      gpr
+      upb
+      address_sorting
       ${ABSL_LIBRARIES}
-      c-ares::cares
+      cares
       ZLIB::ZLIB
       Threads::Threads)
-  set_target_properties(gRPC::grpc
-                        PROPERTIES IMPORTED_LOCATION
-                                   "${GRPC_STATIC_LIBRARY_GRPC}"
-                                   INTERFACE_INCLUDE_DIRECTORIES
-                                   "${GRPC_INCLUDE_DIR}"
-                                   INTERFACE_LINK_LIBRARIES
-                                   "${GRPC_LINK_LIBRARIES}")
-
-  add_library(gRPC::grpc++ STATIC IMPORTED)
-  set(GRPCPP_LINK_LIBRARIES gRPC::grpc ${ARROW_PROTOBUF_LIBPROTOBUF})
-  set_target_properties(gRPC::grpc++
-                        PROPERTIES IMPORTED_LOCATION
-                                   "${GRPC_STATIC_LIBRARY_GRPCPP}"
-                                   INTERFACE_INCLUDE_DIRECTORIES
-                                   "${GRPC_INCLUDE_DIR}"
-                                   INTERFACE_LINK_LIBRARIES
-                                   "${GRPCPP_LINK_LIBRARIES}")
-
-  add_executable(gRPC::grpc_cpp_plugin IMPORTED)
-  set_target_properties(gRPC::grpc_cpp_plugin
-                        PROPERTIES IMPORTED_LOCATION ${GRPC_CPP_PLUGIN})
-
-  add_dependencies(grpc_ep grpc_dependencies)
-  add_dependencies(toolchain grpc_ep)
-  add_dependencies(gRPC::grpc++ grpc_ep)
-  add_dependencies(gRPC::grpc_cpp_plugin grpc_ep)
-  set(GRPC_VENDORED TRUE)
+
+  add_library(grpc++ INTERFACE IMPORTED)
+
+#  add_executable(gRPC::grpc_cpp_plugin IMPORTED)
+#  set_target_properties(gRPC::grpc_cpp_plugin
+#                        PROPERTIES IMPORTED_LOCATION ${GRPC_CPP_PLUGIN})
+
+#  add_dependencies(gRPC::grpc_cpp_plugin grpc_ep)
+#  set(GRPC_VENDORED TRUE)
 
   # ar -M rejects with the "libgrpc++.a" filename because "+" is a line
   # continuation character in these scripts, so we have to create a copy of the
@@ -2656,7 +2369,6 @@
   add_dependencies(gRPC::grpcpp_for_bundling grpc_copy_grpc++)
 
   list(APPEND ARROW_BUNDLED_STATIC_LIBS
-              ${ABSL_LIBRARIES}
               gRPC::address_sorting
               gRPC::gpr
               gRPC::grpc
@@ -2665,7 +2377,12 @@
 endmacro()
 
 if(ARROW_WITH_GRPC)
-  resolve_dependency(gRPC REQUIRED_VERSION 1.17.0)
+  set(ARROW_GRPC_REQUIRED_VERSION "1.17.0")
+  resolve_dependency(gRPC
+                     HAVE_ALT
+                     TRUE
+                     REQUIRED_VERSION
+                     ${ARROW_GRPC_REQUIRED_VERSION})
 
   # TODO: Don't use global includes but rather target_include_directories
   get_target_property(GRPC_INCLUDE_DIR gRPC::grpc++ INTERFACE_INCLUDE_DIRECTORIES)
--- apache-arrow-4.0.1/cpp/thirdparty/versions.txt.orig	2022-01-13 08:22:59.431680640 -0500
+++ apache-arrow-4.0.1/cpp/thirdparty/versions.txt	2022-01-13 11:12:24.990372196 -0500
@@ -24,7 +24,6 @@
 # format).
 
 # Abseil LTS branch, Sept 2020, Patch 2
-ARROW_ABSL_BUILD_VERSION=0f3bb466b868b523cf1dc9b2aaaed65c77b28862
 ARROW_AWSSDK_BUILD_VERSION=1.8.133
 ARROW_AWS_CHECKSUMS_BUILD_VERSION=v0.1.10
 ARROW_AWS_C_COMMON_BUILD_VERSION=v0.4.59
@@ -32,11 +31,9 @@
 ARROW_BOOST_BUILD_VERSION=1.75.0
 ARROW_BROTLI_BUILD_VERSION=v1.0.9
 ARROW_BZIP2_BUILD_VERSION=1.0.8
-ARROW_CARES_BUILD_VERSION=1.17.1
 ARROW_GBENCHMARK_BUILD_VERSION=v1.5.2
 ARROW_GFLAGS_BUILD_VERSION=v2.2.2
 ARROW_GLOG_BUILD_VERSION=v0.4.0
-ARROW_GRPC_BUILD_VERSION=v1.26.0
 ARROW_GTEST_BUILD_VERSION=1.10.0
 ARROW_JEMALLOC_BUILD_VERSION=5.2.1
 ARROW_LZ4_BUILD_VERSION=v1.9.3
@@ -51,10 +48,7 @@
 ARROW_RAPIDJSON_BUILD_VERSION=1a803826f1197b5e30703afe4b9c0e7dd48074f5
 ARROW_RE2_BUILD_VERSION=2021-02-02
 ARROW_SNAPPY_BUILD_VERSION=1.1.8
-ARROW_THRIFT_BUILD_VERSION=0.13.0
-ARROW_THRIFT_BUILD_MD5_CHECKSUM=38a27d391a2b03214b444cb13d5664f1
 ARROW_UTF8PROC_BUILD_VERSION=v2.6.1
-ARROW_XSIMD_BUILD_VERSION=e9234cd6e6f4428fc260073b2c34ffe86fda1f34
 ARROW_ZLIB_BUILD_VERSION=1.2.11
 ARROW_ZSTD_BUILD_VERSION=v1.4.8
 
@@ -63,16 +57,13 @@
 # generated archive file. The third field is the url of the project for the
 # given version.
 DEPENDENCIES=(
-  "ARROW_ABSL_URL absl-${ARROW_ABSL_BUILD_VERSION}.tar.gz https://github.com/abseil/abseil-cpp/archive/${ARROW_ABSL_BUILD_VERSION}.tar.gz"
   "ARROW_AWSSDK_URL aws-sdk-cpp-${ARROW_AWSSDK_BUILD_VERSION}.tar.gz https://github.com/aws/aws-sdk-cpp/archive/${ARROW_AWSSDK_BUILD_VERSION}.tar.gz"
   "ARROW_BOOST_URL boost-${ARROW_BOOST_BUILD_VERSION}.tar.gz https://github.com/ursa-labs/thirdparty/releases/download/latest/boost_${ARROW_BOOST_BUILD_VERSION//./_}.tar.gz"
   "ARROW_BROTLI_URL brotli-${ARROW_BROTLI_BUILD_VERSION}.tar.gz https://github.com/google/brotli/archive/${ARROW_BROTLI_BUILD_VERSION}.tar.gz"
   "ARROW_BZIP2_URL bzip2-${ARROW_BZIP2_BUILD_VERSION}.tar.gz https://sourceware.org/pub/bzip2/bzip2-${ARROW_BZIP2_BUILD_VERSION}.tar.gz"
-  "ARROW_CARES_URL cares-${ARROW_CARES_BUILD_VERSION}.tar.gz https://c-ares.haxx.se/download/c-ares-${ARROW_CARES_BUILD_VERSION}.tar.gz"
   "ARROW_GBENCHMARK_URL gbenchmark-${ARROW_GBENCHMARK_BUILD_VERSION}.tar.gz https://github.com/google/benchmark/archive/${ARROW_GBENCHMARK_BUILD_VERSION}.tar.gz"
   "ARROW_GFLAGS_URL gflags-${ARROW_GFLAGS_BUILD_VERSION}.tar.gz https://github.com/gflags/gflags/archive/${ARROW_GFLAGS_BUILD_VERSION}.tar.gz"
   "ARROW_GLOG_URL glog-${ARROW_GLOG_BUILD_VERSION}.tar.gz https://github.com/google/glog/archive/${ARROW_GLOG_BUILD_VERSION}.tar.gz"
-  "ARROW_GRPC_URL grpc-${ARROW_GRPC_BUILD_VERSION}.tar.gz https://github.com/grpc/grpc/archive/${ARROW_GRPC_BUILD_VERSION}.tar.gz"
   "ARROW_GTEST_URL gtest-${ARROW_GTEST_BUILD_VERSION}.tar.gz https://github.com/google/googletest/archive/release-${ARROW_GTEST_BUILD_VERSION}.tar.gz"
   "ARROW_JEMALLOC_URL jemalloc-${ARROW_JEMALLOC_BUILD_VERSION}.tar.bz2 https://github.com/jemalloc/jemalloc/releases/download/${ARROW_JEMALLOC_BUILD_VERSION}/jemalloc-${ARROW_JEMALLOC_BUILD_VERSION}.tar.bz2"
   "ARROW_LZ4_URL lz4-${ARROW_LZ4_BUILD_VERSION}.tar.gz https://github.com/lz4/lz4/archive/${ARROW_LZ4_BUILD_VERSION}.tar.gz"
@@ -82,9 +73,7 @@
   "ARROW_RAPIDJSON_URL rapidjson-${ARROW_RAPIDJSON_BUILD_VERSION}.tar.gz https://github.com/miloyip/rapidjson/archive/${ARROW_RAPIDJSON_BUILD_VERSION}.tar.gz"
   "ARROW_RE2_URL re2-${ARROW_RE2_BUILD_VERSION}.tar.gz https://github.com/google/re2/archive/${ARROW_RE2_BUILD_VERSION}.tar.gz"
   "ARROW_SNAPPY_URL snappy-${ARROW_SNAPPY_BUILD_VERSION}.tar.gz https://github.com/google/snappy/archive/${ARROW_SNAPPY_BUILD_VERSION}.tar.gz"
-  "ARROW_THRIFT_URL thrift-${ARROW_THRIFT_BUILD_VERSION}.tar.gz https://archive.apache.org/dist/thrift/${ARROW_THRIFT_BUILD_VERSION}/thrift-${ARROW_THRIFT_BUILD_VERSION}.tar.gz"
   "ARROW_UTF8PROC_URL utf8proc-${ARROW_UTF8PROC_BUILD_VERSION}.tar.gz https://github.com/JuliaStrings/utf8proc/archive/${ARROW_UTF8PROC_BUILD_VERSION}.tar.gz"
-  "ARROW_XSIMD_URL xsimd-${ARROW_XSIMD_BUILD_VERSION}.tar.gz https://github.com/xtensor-stack/xsimd/archive/${ARROW_XSIMD_BUILD_VERSION}.tar.gz"
   "ARROW_ZLIB_URL zlib-${ARROW_ZLIB_BUILD_VERSION}.tar.gz https://zlib.net/fossils/zlib-${ARROW_ZLIB_BUILD_VERSION}.tar.gz"
   "ARROW_ZSTD_URL zstd-${ARROW_ZSTD_BUILD_VERSION}.tar.gz https://github.com/facebook/zstd/archive/${ARROW_ZSTD_BUILD_VERSION}.tar.gz"
 )