diff --git a/A/Arrow/build_tarballs.jl b/A/Arrow/build_tarballs.jl new file mode 100644 index 00000000000..7a6bdec0cf3 --- /dev/null +++ b/A/Arrow/build_tarballs.jl @@ -0,0 +1,88 @@ +# Note that this script can accept some limited command-line arguments, run +# `julia build_tarballs.jl --help` to see a usage message. +using BinaryBuilder, Pkg + +name = "Arrow" +version = v"10.0.0" + +# Collection of sources required to complete build +sources = [ + ArchiveSource("https://github.com/apache/arrow/archive/refs/tags/apache-arrow-$(version).zip", + "42995abe620c41c42b8fbc486f1c63a1e5b1da534718ac66dbc790a88efeaa37") + DirectorySource("./bundled") +] + +# Bash recipe for building across all platforms +script = raw""" + +cd $WORKSPACE/srcdir/arrow-apache-arrow-* + +# Set toolchain for building external deps +for f in ${WORKSPACE}/srcdir/patches/*.patch; do + atomic_patch -p1 ${f} +done + +cd cpp && mkdir build_dir && cd build_dir + +# Ignore check for availibility on older macOS versions +if [[ "${target}" == x86_64-apple-darwin* ]]; then + CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" +fi + +CMAKE_FLAGS=(-DCMAKE_INSTALL_PREFIX=$prefix +-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} +-DARROW_CXXFLAGS="${CXXFLAGS}" +-DCMAKE_BUILD_TYPE=Release +-DARROW_BUILD_UTILITIES=OFF +-DARROW_WITH_UTF8PROC=OFF +-DARROW_DEPENDENCY_SOURCE=SYSTEM +-DARROW_VERBOSE_THIRDPARTY_BUILD=ON +-DARROW_BUILD_STATIC=OFF +-DARROW_DATASET=ON +-DARROW_COMPUTE=OFF +-DARROW_WITH_RE2=OFF +-DARROW_WITH_BZ2=ON +-DARROW_IPC=OFF +-DARROW_WITH_LZ4=ON +-DARROW_WITH_ZSTD=OFF +-DARROW_WITH_ZLIB=ON +-DARROW_WITH_SNAPPY=ON +-DARROW_THRIFT_USE_SHARED=ON +-DARROW_PARQUET=ON +-DPARQUET_BUILD_EXECUTABLES=OFF +-DARROW_SIMD_LEVEL=NONE +-DARROW_USE_XSIMD=OFF +-DARROW_JEMALLOC=OFF +-Dxsimd_SOURCE=AUTO) + +cmake .. "${CMAKE_FLAGS[@]}" + +make -j${nproc} + +make install +""" + +# These are the platforms we will build for by default, unless further +# platforms are passed in on the command line +platforms = expand_cxxstring_abis(supported_platforms()) + +# The products that we will ensure are always built +products = [ + LibraryProduct("libparquet", :libparquet), + LibraryProduct("libarrow", :libarrow) +] + +# Dependencies that must be installed before this package can be built +dependencies = [ + Dependency("boost_jll", compat="=1.76.0") + Dependency("Zlib_jll") + Dependency("Bzip2_jll", compat="1.0.8") + Dependency("Lz4_jll") + Dependency("Thrift_jll") + Dependency("snappy_jll") + Dependency("CompilerSupportLibraries_jll"; platforms=filter(!Sys.isapple, platforms)) +] + +# Build the tarballs, and possibly a `build.jl` as well. +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; + julia_compat="1.6", preferred_gcc_version=v"8") diff --git a/A/Arrow/bundled/patches/cxxflags.patch b/A/Arrow/bundled/patches/cxxflags.patch new file mode 100644 index 00000000000..7d85334a5d9 --- /dev/null +++ b/A/Arrow/bundled/patches/cxxflags.patch @@ -0,0 +1,15 @@ +diff --git a/cpp/cmake_modules/SetupCxxFlags.cmake b/cpp/cmake_modules/SetupCxxFlags.cmake +index cef4eb0b1..97f866938 100644 +--- a/cpp/cmake_modules/SetupCxxFlags.cmake ++++ b/cpp/cmake_modules/SetupCxxFlags.cmake +@@ -29,7 +29,9 @@ if(NOT DEFINED ARROW_CPU_FLAG) + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64|arm64") + set(ARROW_CPU_FLAG "armv8") + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "armv7") +- set(ARROW_CPU_FLAG "armv7") ++ set(ARROW_CPU_FLAG "armv7") ++ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "armv6") ++ set(ARROW_CPU_FLAG "armv7") # Prevents another patch, will add -latomic to linker + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "powerpc|ppc") + set(ARROW_CPU_FLAG "ppc") + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "s390x") diff --git a/A/Arrow/bundled/patches/thrift.patch b/A/Arrow/bundled/patches/thrift.patch new file mode 100644 index 00000000000..a66201bbaf4 --- /dev/null +++ b/A/Arrow/bundled/patches/thrift.patch @@ -0,0 +1,12 @@ +diff --git a/cpp/cmake_modules/FindThrift.cmake b/cpp/cmake_modules/FindThrift.cmake +index 2f20a5cb5..2d1e728aa 100644 +--- a/cpp/cmake_modules/FindThrift.cmake ++++ b/cpp/cmake_modules/FindThrift.cmake +@@ -146,6 +146,7 @@ if(Thrift_FOUND) + endif() + set_target_properties(thrift::thrift + PROPERTIES IMPORTED_LOCATION "${THRIFT_LIB}" ++ IMPORTED_IMPLIB "${THRIFT_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${THRIFT_INCLUDE_DIR}") + if(WIN32 AND NOT MSVC_TOOLCHAIN) + # We don't need this for Visual C++ because Thrift uses diff --git a/A/Arrow/bundled/patches/toolchain.patch b/A/Arrow/bundled/patches/toolchain.patch new file mode 100644 index 00000000000..33f3a559ac6 --- /dev/null +++ b/A/Arrow/bundled/patches/toolchain.patch @@ -0,0 +1,14 @@ +diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake +index b7cd31f3d..676f9b93b 100644 +--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake ++++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake +@@ -753,8 +753,7 @@ endif() + # directory. This leads to issues if the variables are exported in a subshell + # and the invocation of make/ninja is in distinct subshell without the same + # environment (CC/CXX). +-set(EP_COMMON_TOOLCHAIN -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} +- -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}) ++set(EP_COMMON_TOOLCHAIN -DCMAKE_TOOLCHAIN_FILE=$ENV{CMAKE_TARGET_TOOLCHAIN}) + + if(CMAKE_AR) + set(EP_COMMON_TOOLCHAIN ${EP_COMMON_TOOLCHAIN} -DCMAKE_AR=${CMAKE_AR})