nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv, symlinkJoin, fetchurl, fetchFromGitHub, autoconf, boost, brotli, cmake, double-conversion, flatbuffers, gflags, glog, gtest, lz4, perl, python, rapidjson, snappy, thrift, which, zlib, zstd }:
2
3let
4 parquet-testing = fetchFromGitHub {
5 owner = "apache";
6 repo = "parquet-testing";
7 rev = "46ae2605c2de306f5740587107dcf333a527f2d1";
8 sha256 = "07ps745gas2zcfmg56m3vwl63yyzmalnxwb5dc40vd004cx5hdik";
9 };
10in
11
12stdenv.mkDerivation rec {
13 name = "arrow-cpp-${version}";
14 version = "0.12.0";
15
16 src = fetchurl {
17 url = "mirror://apache/arrow/arrow-${version}/apache-arrow-${version}.tar.gz";
18 sha256 = "163s4i2cywq95jgrxbaq48qwmww0ibkq61k1aad4w9z9vpjfgnil";
19 };
20
21 sourceRoot = "apache-arrow-${version}/cpp";
22
23 patches = [
24 # patch to fix python-test
25 ./darwin.patch
26 ];
27
28 nativeBuildInputs = [ cmake autoconf /* for vendored jemalloc */ ];
29 buildInputs = [ boost double-conversion glog python.pkgs.python python.pkgs.numpy ];
30
31 preConfigure = ''
32 substituteInPlace cmake_modules/FindThrift.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
33 substituteInPlace cmake_modules/FindBrotli.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
34 substituteInPlace cmake_modules/FindGLOG.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
35 substituteInPlace cmake_modules/FindLz4.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
36 substituteInPlace cmake_modules/FindSnappy.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
37
38 patchShebangs build-support/
39 '';
40
41 BROTLI_HOME = symlinkJoin { name="brotli-wrap"; paths = [ brotli.lib brotli.dev ]; };
42 DOUBLE_CONVERSION_HOME = double-conversion;
43 FLATBUFFERS_HOME = flatbuffers;
44 GFLAGS_HOME = gflags;
45 GLOG_HOME = glog;
46 GTEST_HOME = symlinkJoin { name="gtest-wrap"; paths = [ gtest gtest.dev ]; };
47 LZ4_HOME = symlinkJoin { name="lz4-wrap"; paths = [ lz4 lz4.dev ]; };
48 RAPIDJSON_HOME = rapidjson;
49 SNAPPY_HOME = symlinkJoin { name="snappy-wrap"; paths = [ snappy snappy.dev ]; };
50 THRIFT_HOME = thrift;
51 ZLIB_HOME = symlinkJoin { name="zlib-wrap"; paths = [ zlib zlib.dev ]; };
52 ZSTD_HOME = zstd;
53
54 cmakeFlags = [
55 "-DARROW_BUILD_TESTS=ON"
56 "-DARROW_PYTHON=ON"
57 "-DARROW_PARQUET=ON"
58 ];
59
60 doInstallCheck = true;
61 PARQUET_TEST_DATA = if doInstallCheck then "${parquet-testing}/data" else null;
62 installCheckInputs = [ perl which ];
63 installCheckPhase = (stdenv.lib.optionalString stdenv.isDarwin ''
64 for f in release/*-test; do
65 install_name_tool -add_rpath "$out"/lib "$f"
66 done
67 '') + ''
68 ctest -L unittest -V
69 '';
70
71 meta = {
72 description = "A cross-language development platform for in-memory data";
73 homepage = https://arrow.apache.org/;
74 license = stdenv.lib.licenses.asl20;
75 platforms = stdenv.lib.platforms.unix;
76 maintainers = with stdenv.lib.maintainers; [ veprbl ];
77 };
78}