2021-12-06 16:07:01 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fixDarwinDylibNames
|
|
|
|
, abseil-cpp
|
|
|
|
, autoconf
|
|
|
|
, aws-sdk-cpp
|
|
|
|
, boost
|
|
|
|
, brotli
|
|
|
|
, c-ares
|
|
|
|
, cmake
|
|
|
|
, crc32c
|
|
|
|
, curl
|
|
|
|
, flatbuffers
|
|
|
|
, gflags
|
|
|
|
, glog
|
|
|
|
, google-cloud-cpp
|
|
|
|
, grpc
|
|
|
|
, gtest
|
|
|
|
, jemalloc
|
|
|
|
, libnsl
|
|
|
|
, lz4
|
|
|
|
, minio
|
|
|
|
, nlohmann_json
|
|
|
|
, openssl
|
|
|
|
, perl
|
|
|
|
, protobuf
|
|
|
|
, python3
|
|
|
|
, rapidjson
|
|
|
|
, re2
|
|
|
|
, snappy
|
|
|
|
, thrift
|
|
|
|
, tzdata
|
|
|
|
, utf8proc
|
|
|
|
, which
|
|
|
|
, zlib
|
|
|
|
, zstd
|
2021-01-05 17:05:55 +00:00
|
|
|
, enableShared ? !stdenv.hostPlatform.isStatic
|
2021-12-06 16:07:01 +00:00
|
|
|
, enableFlight ? !stdenv.isDarwin # libnsl is not supported on darwin
|
|
|
|
, enableJemalloc ? !(stdenv.isAarch64 && stdenv.isDarwin)
|
|
|
|
# boost/process is broken in 1.69 on darwin, but fixed in 1.70 and
|
|
|
|
# non-existent in older versions
|
|
|
|
# see https://github.com/boostorg/process/issues/55
|
|
|
|
, enableS3 ? (!stdenv.isDarwin) || (lib.versionOlder boost.version "1.69" || lib.versionAtLeast boost.version "1.70")
|
|
|
|
, enableGcs ? !stdenv.isDarwin # google-cloud-cpp is not supported on darwin
|
2021-01-05 17:05:55 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
assert lib.asserts.assertMsg
|
|
|
|
((enableS3 && stdenv.isDarwin) -> (lib.versionOlder boost.version "1.69" || lib.versionAtLeast boost.version "1.70"))
|
|
|
|
"S3 on Darwin requires Boost != 1.69";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
let
|
2020-09-25 04:45:31 +00:00
|
|
|
arrow-testing = fetchFromGitHub {
|
|
|
|
owner = "apache";
|
|
|
|
repo = "arrow-testing";
|
2021-12-06 16:07:01 +00:00
|
|
|
rev = "1d8525e109a12a8c67c489eba48715a199609153";
|
|
|
|
hash = "sha256-tesDW/1yRyhZtpLbPvCVEsocs6KtstYofxB5GiSMEFM=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
parquet-testing = fetchFromGitHub {
|
|
|
|
owner = "apache";
|
|
|
|
repo = "parquet-testing";
|
2021-12-06 16:07:01 +00:00
|
|
|
rev = "d4d485956a643c693b5549e1a62d52ca61c170f1";
|
|
|
|
hash = "sha256-GmOAS8gGhzDI0WzORMkWHRRUl/XBwmNen2d3VefZxxc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "arrow-cpp";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "6.0.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url =
|
|
|
|
"mirror://apache/arrow/arrow-${version}/apache-arrow-${version}.tar.gz";
|
2021-12-06 16:07:01 +00:00
|
|
|
hash = "sha256-N4az0t+VTQeLPmj5jS5a7Lqj+irM8HXXo6E8GHucUpQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
sourceRoot = "apache-arrow-${version}/cpp";
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
${if enableJemalloc then "ARROW_JEMALLOC_URL" else null} = jemalloc.src;
|
|
|
|
|
|
|
|
ARROW_MIMALLOC_URL = fetchFromGitHub {
|
2020-04-24 23:36:52 +00:00
|
|
|
# From
|
|
|
|
# ./cpp/cmake_modules/ThirdpartyToolchain.cmake
|
|
|
|
# ./cpp/thirdparty/versions.txt
|
2021-12-06 16:07:01 +00:00
|
|
|
owner = "microsoft";
|
|
|
|
repo = "mimalloc";
|
|
|
|
rev = "v1.7.2";
|
|
|
|
hash = "sha256-yHupYFgC8mJuLUSpuEAfwF7l6Ue4EiuO1Q4qN4T6wWc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
ARROW_XSIMD_URL = fetchFromGitHub {
|
|
|
|
owner = "xtensor-stack";
|
|
|
|
repo = "xsimd";
|
|
|
|
rev = "aeec9c872c8b475dedd7781336710f2dd2666cb2";
|
|
|
|
hash = "sha256-vWKdJkieKhaxyAJhijXUmD7NmNvMWd79PskQojulA1w=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
patches = [
|
|
|
|
# patch to fix python-test
|
|
|
|
./darwin.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
autoconf # for vendored jemalloc
|
|
|
|
flatbuffers
|
|
|
|
] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
|
|
|
buildInputs = [
|
|
|
|
boost
|
|
|
|
brotli
|
|
|
|
flatbuffers
|
|
|
|
gflags
|
|
|
|
glog
|
|
|
|
gtest
|
|
|
|
lz4
|
|
|
|
rapidjson
|
2021-02-05 17:12:51 +00:00
|
|
|
re2
|
2020-04-24 23:36:52 +00:00
|
|
|
snappy
|
|
|
|
thrift
|
2020-09-25 04:45:31 +00:00
|
|
|
utf8proc
|
2020-04-24 23:36:52 +00:00
|
|
|
zlib
|
|
|
|
zstd
|
2020-05-29 06:06:01 +00:00
|
|
|
] ++ lib.optionals enableShared [
|
|
|
|
python3.pkgs.python
|
|
|
|
python3.pkgs.numpy
|
2021-12-06 16:07:01 +00:00
|
|
|
] ++ lib.optionals enableFlight [
|
|
|
|
grpc
|
|
|
|
libnsl
|
|
|
|
openssl
|
|
|
|
protobuf
|
|
|
|
] ++ lib.optionals enableS3 [ aws-sdk-cpp openssl ]
|
|
|
|
++ lib.optionals enableGcs [
|
|
|
|
abseil-cpp
|
|
|
|
crc32c
|
|
|
|
curl
|
|
|
|
google-cloud-cpp
|
|
|
|
nlohmann_json
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs build-support/
|
2021-12-06 16:07:01 +00:00
|
|
|
substituteInPlace "src/arrow/vendored/datetime/tz.cpp" \
|
|
|
|
--replace 'discover_tz_dir();' '"${tzdata}/share/zoneinfo";'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON"
|
2020-09-25 04:45:31 +00:00
|
|
|
"-DARROW_BUILD_SHARED=${if enableShared then "ON" else "OFF"}"
|
|
|
|
"-DARROW_BUILD_STATIC=${if enableShared then "OFF" else "ON"}"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DARROW_BUILD_TESTS=ON"
|
2020-09-25 04:45:31 +00:00
|
|
|
"-DARROW_VERBOSE_THIRDPARTY_BUILD=ON"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DARROW_DEPENDENCY_SOURCE=SYSTEM"
|
2021-12-06 16:07:01 +00:00
|
|
|
"-DThrift_SOURCE=AUTO" # search for Thrift using pkg-config (ThriftConfig.cmake requires OpenSSL and libevent)
|
2020-09-25 04:45:31 +00:00
|
|
|
"-DARROW_DEPENDENCY_USE_SHARED=${if enableShared then "ON" else "OFF"}"
|
2021-05-03 20:48:10 +00:00
|
|
|
"-DARROW_COMPUTE=ON"
|
|
|
|
"-DARROW_CSV=ON"
|
|
|
|
"-DARROW_DATASET=ON"
|
2021-12-06 16:07:01 +00:00
|
|
|
"-DARROW_JEMALLOC=${if enableJemalloc then "ON" else "OFF"}"
|
2021-05-03 20:48:10 +00:00
|
|
|
"-DARROW_JSON=ON"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DARROW_PLASMA=ON"
|
|
|
|
# Disable Python for static mode because openblas is currently broken there.
|
|
|
|
"-DARROW_PYTHON=${if enableShared then "ON" else "OFF"}"
|
|
|
|
"-DARROW_USE_GLOG=ON"
|
|
|
|
"-DARROW_WITH_BROTLI=ON"
|
|
|
|
"-DARROW_WITH_LZ4=ON"
|
|
|
|
"-DARROW_WITH_SNAPPY=ON"
|
2020-09-25 04:45:31 +00:00
|
|
|
"-DARROW_WITH_UTF8PROC=ON"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DARROW_WITH_ZLIB=ON"
|
|
|
|
"-DARROW_WITH_ZSTD=ON"
|
2020-09-25 04:45:31 +00:00
|
|
|
"-DARROW_MIMALLOC=ON"
|
2020-04-24 23:36:52 +00:00
|
|
|
# Parquet options:
|
|
|
|
"-DARROW_PARQUET=ON"
|
|
|
|
"-DPARQUET_BUILD_EXECUTABLES=ON"
|
2021-12-06 16:07:01 +00:00
|
|
|
"-DARROW_FLIGHT=${if enableFlight then "ON" else "OFF"}"
|
|
|
|
"-DARROW_S3=${if enableS3 then "ON" else "OFF"}"
|
|
|
|
"-DARROW_GCS=${if enableGcs then "ON" else "OFF"}"
|
2020-04-24 23:36:52 +00:00
|
|
|
] ++ lib.optionals (!enableShared) [
|
|
|
|
"-DARROW_TEST_LINKAGE=static"
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
"-DCMAKE_SKIP_BUILD_RPATH=OFF" # needed for tests
|
|
|
|
"-DCMAKE_INSTALL_RPATH=@loader_path/../lib" # needed for tools executables
|
2021-12-06 16:07:01 +00:00
|
|
|
] ++ lib.optional (!stdenv.isx86_64) "-DARROW_USE_SIMD=OFF"
|
|
|
|
++ lib.optional enableS3 "-DAWSSDK_CORE_HEADER_FILE=${aws-sdk-cpp}/include/aws/core/Aws.h";
|
2021-05-03 20:48:10 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
doInstallCheck = true;
|
2021-12-06 16:07:01 +00:00
|
|
|
ARROW_TEST_DATA = lib.optionalString doInstallCheck "${arrow-testing}/data";
|
|
|
|
PARQUET_TEST_DATA = lib.optionalString doInstallCheck "${parquet-testing}/data";
|
2021-02-05 17:12:51 +00:00
|
|
|
GTEST_FILTER =
|
2021-12-06 16:07:01 +00:00
|
|
|
let
|
2021-02-05 17:12:51 +00:00
|
|
|
# Upstream Issue: https://issues.apache.org/jira/browse/ARROW-11398
|
|
|
|
filteredTests = lib.optionals stdenv.hostPlatform.isAarch64 [
|
|
|
|
"TestFilterKernelWithNumeric/3.CompareArrayAndFilterRandomNumeric"
|
|
|
|
"TestFilterKernelWithNumeric/7.CompareArrayAndFilterRandomNumeric"
|
|
|
|
"TestCompareKernel.PrimitiveRandomTests"
|
2021-12-06 16:07:01 +00:00
|
|
|
] ++ lib.optionals enableS3 [
|
|
|
|
"S3OptionsTest.FromUri"
|
|
|
|
"S3RegionResolutionTest.NonExistentBucket"
|
|
|
|
"S3RegionResolutionTest.PublicBucket"
|
|
|
|
"S3RegionResolutionTest.RestrictedBucket"
|
|
|
|
"TestMinioServer.Connect"
|
2022-01-07 04:07:37 +00:00
|
|
|
"TestS3FS.*"
|
2021-12-06 16:07:01 +00:00
|
|
|
"TestS3FSGeneric.*"
|
|
|
|
] ++ lib.optionals enableGcs [
|
|
|
|
"GcsFileSystem.FileSystemCompare"
|
|
|
|
"GcsIntegrationTest.*"
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
2021-12-06 16:07:01 +00:00
|
|
|
in
|
|
|
|
lib.optionalString doInstallCheck "-${builtins.concatStringsSep ":" filteredTests}";
|
|
|
|
installCheckInputs = [ perl which ] ++ lib.optional enableS3 minio;
|
2020-04-24 23:36:52 +00:00
|
|
|
installCheckPhase =
|
2021-12-06 16:07:01 +00:00
|
|
|
let
|
|
|
|
excludedTests = lib.optionals stdenv.isDarwin [
|
|
|
|
# Some plasma tests need to be patched to use a shorter AF_UNIX socket
|
|
|
|
# path on Darwin. See https://github.com/NixOS/nix/pull/1085
|
|
|
|
"plasma-external-store-tests"
|
|
|
|
"plasma-client-tests"
|
|
|
|
];
|
|
|
|
in
|
|
|
|
''
|
|
|
|
runHook preInstallCheck
|
|
|
|
|
|
|
|
ctest -L unittest \
|
|
|
|
--exclude-regex '^(${builtins.concatStringsSep "|" excludedTests})$'
|
|
|
|
|
|
|
|
runHook postInstallCheck
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-01 10:57:12 +00:00
|
|
|
meta = with lib; {
|
2021-12-06 16:07:01 +00:00
|
|
|
description = "A cross-language development platform for in-memory data";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://arrow.apache.org/";
|
2021-06-01 10:57:12 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.unix;
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ tobim veprbl cpcloud ];
|
|
|
|
};
|
|
|
|
passthru = {
|
|
|
|
inherit enableFlight enableJemalloc enableS3 enableGcs;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|