9 aws-sdk-cpp-arrow ? aws-sdk-cpp.override {
51 enableShared ? !stdenv.hostPlatform.isStatic,
53 enableJemalloc ? !stdenv.isDarwin,
55 enableGcs ? !stdenv.isDarwin,
58 assert lib.asserts.assertMsg (
59 (enableS3 && stdenv.isDarwin)
60 -> (lib.versionOlder boost.version "1.69" || lib.versionAtLeast boost.version "1.70")
61 ) "S3 on Darwin requires Boost != 1.69";
64 arrow-testing = fetchFromGitHub {
65 name = "arrow-testing";
67 repo = "arrow-testing";
68 rev = "735ae7128d571398dd798d7ff004adebeb342883";
69 hash = "sha256-67KwnSt+EeEDvk+9kxR51tErL2wJqEPRITKb/dN+HMQ=";
72 parquet-testing = fetchFromGitHub {
73 name = "parquet-testing";
75 repo = "parquet-testing";
76 rev = "74278bc4a1122d74945969e6dec405abd1533ec3";
77 hash = "sha256-WbpndtAviph6+I/F2bevuMI9DkfSv4SMPgMaP98k6Qo=";
81 stdenv.mkDerivation (finalAttrs: {
85 src = fetchFromGitHub {
88 rev = "apache-arrow-17.0.0";
89 hash = "sha256-ZQqi1RFb4Ey0A0UVCThuIxM7DoFfkLwaeRAc2z8u9so=";
92 sourceRoot = "source/cpp";
94 # versions are all taken from
95 # https://github.com/apache/arrow/blob/apache-arrow-${version}/cpp/thirdparty/versions.txt
97 # jemalloc: arrow uses a custom prefix to prevent default allocator symbol
98 # collisions as well as custom build flags
99 ${if enableJemalloc then "ARROW_JEMALLOC_URL" else null} = fetchurl {
100 url = "https://github.com/jemalloc/jemalloc/releases/download/5.3.0/jemalloc-5.3.0.tar.bz2";
101 hash = "sha256-LbgtHnEZ3z5xt2QCGbbf6EeJvAU3mDw7esT3GJrs/qo=";
104 # mimalloc: arrow uses custom build flags for mimalloc
105 ARROW_MIMALLOC_URL = fetchFromGitHub {
109 hash = "sha256-u2ITXABBN/dwU+mCIbL3tN1f4c17aBuSdNTV+Adtohc=";
112 ARROW_XSIMD_URL = fetchFromGitHub {
113 owner = "xtensor-stack";
116 hash = "sha256-qElJYW5QDj3s59L3NgZj5zkhnUMzIP2mBa1sPks3/CE=";
119 ARROW_SUBSTRAIT_URL = fetchFromGitHub {
120 owner = "substrait-io";
123 hash = "sha256-V739IFTGPtbGPlxcOi8sAaYSDhNUEpITvN9IqdPReug=";
126 nativeBuildInputs = [
129 autoconf # for vendored jemalloc
131 ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
143 nlohmann_json # alternative JSON parser to rapidjson
144 protobuf # substrait requires protobuf
153 ++ lib.optionals enableFlight [
159 ++ lib.optionals enableS3 [
163 ++ lib.optionals enableGcs [
172 patchShebangs build-support/
173 substituteInPlace "src/arrow/vendored/datetime/tz.cpp" \
174 --replace 'discover_tz_dir();' '"${tzdata}/share/zoneinfo";'
179 "-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON"
180 "-DARROW_BUILD_SHARED=${if enableShared then "ON" else "OFF"}"
181 "-DARROW_BUILD_STATIC=${if enableShared then "OFF" else "ON"}"
182 "-DARROW_BUILD_TESTS=ON"
183 "-DARROW_BUILD_INTEGRATION=ON"
184 "-DARROW_BUILD_UTILITIES=ON"
185 "-DARROW_EXTRA_ERROR_CONTEXT=ON"
186 "-DARROW_VERBOSE_THIRDPARTY_BUILD=ON"
187 "-DARROW_DEPENDENCY_SOURCE=SYSTEM"
188 "-Dxsimd_SOURCE=AUTO"
189 "-DARROW_DEPENDENCY_USE_SHARED=${if enableShared then "ON" else "OFF"}"
193 "-DARROW_FILESYSTEM=ON"
194 "-DARROW_FLIGHT_SQL=${if enableFlight then "ON" else "OFF"}"
197 "-DARROW_JEMALLOC=${if enableJemalloc then "ON" else "OFF"}"
199 "-DARROW_USE_GLOG=ON"
200 "-DARROW_WITH_BACKTRACE=ON"
201 "-DARROW_WITH_BROTLI=ON"
202 "-DARROW_WITH_BZ2=ON"
203 "-DARROW_WITH_LZ4=ON"
204 "-DARROW_WITH_NLOHMANN_JSON=ON"
205 "-DARROW_WITH_SNAPPY=ON"
206 "-DARROW_WITH_UTF8PROC=ON"
207 "-DARROW_WITH_ZLIB=ON"
208 "-DARROW_WITH_ZSTD=ON"
209 "-DARROW_MIMALLOC=ON"
210 "-DARROW_SUBSTRAIT=ON"
211 "-DARROW_FLIGHT=${if enableFlight then "ON" else "OFF"}"
212 "-DARROW_FLIGHT_TESTING=${if enableFlight then "ON" else "OFF"}"
213 "-DARROW_S3=${if enableS3 then "ON" else "OFF"}"
214 "-DARROW_GCS=${if enableGcs then "ON" else "OFF"}"
217 "-DPARQUET_BUILD_EXECUTABLES=ON"
218 "-DPARQUET_REQUIRE_ENCRYPTION=ON"
220 ++ lib.optionals (!enableShared) [ "-DARROW_TEST_LINKAGE=static" ]
221 ++ lib.optionals stdenv.isDarwin [
222 "-DCMAKE_INSTALL_RPATH=@loader_path/../lib" # needed for tools executables
224 ++ lib.optionals (!stdenv.isx86_64) [ "-DARROW_USE_SIMD=OFF" ]
225 ++ lib.optionals enableS3 [
226 "-DAWSSDK_CORE_HEADER_FILE=${aws-sdk-cpp-arrow}/include/aws/core/Aws.h"
229 doInstallCheck = true;
230 ARROW_TEST_DATA = lib.optionalString finalAttrs.doInstallCheck "${arrow-testing}/data";
231 PARQUET_TEST_DATA = lib.optionalString finalAttrs.doInstallCheck "${parquet-testing}/data";
234 # Upstream Issue: https://issues.apache.org/jira/browse/ARROW-11398
236 lib.optionals stdenv.hostPlatform.isAarch64 [
237 "TestFilterKernelWithNumeric/3.CompareArrayAndFilterRandomNumeric"
238 "TestFilterKernelWithNumeric/7.CompareArrayAndFilterRandomNumeric"
239 "TestCompareKernel.PrimitiveRandomTests"
241 ++ lib.optionals enableS3 [
242 "S3OptionsTest.FromUri"
243 "S3RegionResolutionTest.NonExistentBucket"
244 "S3RegionResolutionTest.PublicBucket"
245 "S3RegionResolutionTest.RestrictedBucket"
246 "TestMinioServer.Connect"
250 ++ lib.optionals stdenv.isDarwin [
251 # TODO: revisit at 12.0.0 or when
252 # https://github.com/apache/arrow/commit/295c6644ca6b67c95a662410b2c7faea0920c989
254 # https://github.com/apache/arrow/pull/15288#discussion_r1071244661
255 "ExecPlanExecution.StressSourceSinkStopped"
258 lib.optionalString finalAttrs.doInstallCheck "-${lib.concatStringsSep ":" filteredTests}";
260 __darwinAllowLocalNetworking = true;
262 nativeInstallCheckInputs = [
266 ] ++ lib.optionals enableS3 [ minio ] ++ lib.optionals enableFlight [ python3 ];
273 # requires networking
275 "arrow-flight-integration-test"
279 runHook preInstallCheck
281 ctest -L unittest --exclude-regex '^(${lib.concatStringsSep "|" disabledTests})$'
283 runHook postInstallCheck
287 description = "Cross-language development platform for in-memory data";
288 homepage = "https://arrow.apache.org/docs/cpp/";
289 license = licenses.asl20;
290 platforms = platforms.unix;
291 maintainers = with maintainers; [
305 "arrow-flight-testing"
319 tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;