2018-10-13 09:12:26 +01:00
|
|
|
{ stdenv, symlinkJoin, fetchurl, fetchFromGitHub, boost, brotli, cmake, double-conversion, flatbuffers, gflags, glog, gtest, lz4, perl, python, rapidjson, snappy, thrift, which, zlib, zstd }:
|
|
|
|
|
|
|
|
let
|
|
|
|
parquet-testing = fetchFromGitHub {
|
|
|
|
owner = "apache";
|
|
|
|
repo = "parquet-testing";
|
|
|
|
rev = "46ae2605c2de306f5740587107dcf333a527f2d1";
|
|
|
|
sha256 = "07ps745gas2zcfmg56m3vwl63yyzmalnxwb5dc40vd004cx5hdik";
|
|
|
|
};
|
|
|
|
in
|
2018-03-16 20:19:24 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "arrow-cpp-${version}";
|
2018-10-13 09:12:26 +01:00
|
|
|
version = "0.11.0";
|
2018-03-16 20:19:24 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://apache/arrow/arrow-${version}/apache-arrow-${version}.tar.gz";
|
2018-10-13 09:12:26 +01:00
|
|
|
sha256 = "0pc5pqr0dbnx8s1ji102dhw9bbrsq3ml4ac3mmi2022yfyizlf0q";
|
2018-03-16 20:19:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = "apache-arrow-${version}/cpp";
|
|
|
|
|
2018-10-13 09:12:26 +01:00
|
|
|
patches = [
|
|
|
|
# fix ARROW-3467
|
|
|
|
./double-conversion_cmake.patch
|
|
|
|
|
|
|
|
# patch to fix python-test
|
|
|
|
./darwin.patch
|
2018-10-24 09:50:01 +01:00
|
|
|
|
|
|
|
# facebook/zstd#1385
|
|
|
|
./zstd136.patch
|
2018-10-13 09:12:26 +01:00
|
|
|
];
|
2018-10-03 23:37:12 +01:00
|
|
|
|
2018-03-16 20:19:24 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2018-10-13 09:12:26 +01:00
|
|
|
buildInputs = [ boost double-conversion glog python.pkgs.python python.pkgs.numpy ];
|
2018-03-16 20:19:24 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
2018-10-13 09:12:26 +01:00
|
|
|
substituteInPlace cmake_modules/FindThrift.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
|
2018-03-16 20:19:24 +00:00
|
|
|
substituteInPlace cmake_modules/FindBrotli.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
|
2018-10-13 09:12:26 +01:00
|
|
|
substituteInPlace cmake_modules/FindGLOG.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
|
2018-03-16 20:19:24 +00:00
|
|
|
substituteInPlace cmake_modules/FindLz4.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
|
|
|
|
substituteInPlace cmake_modules/FindSnappy.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
|
2018-10-13 09:12:26 +01:00
|
|
|
|
|
|
|
patchShebangs build-support/
|
2018-03-16 20:19:24 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
BROTLI_HOME = symlinkJoin { name="brotli-wrap"; paths = [ brotli.lib brotli.dev ]; };
|
2018-10-13 09:12:26 +01:00
|
|
|
DOUBLE_CONVERSION_HOME = double-conversion;
|
2018-03-16 20:19:24 +00:00
|
|
|
FLATBUFFERS_HOME = flatbuffers;
|
|
|
|
GFLAGS_HOME = gflags;
|
2018-10-13 09:12:26 +01:00
|
|
|
GLOG_HOME = glog;
|
|
|
|
GTEST_HOME = gtest;
|
2018-03-16 20:19:24 +00:00
|
|
|
LZ4_HOME = symlinkJoin { name="lz4-wrap"; paths = [ lz4 lz4.dev ]; };
|
|
|
|
RAPIDJSON_HOME = rapidjson;
|
|
|
|
SNAPPY_HOME = symlinkJoin { name="snappy-wrap"; paths = [ snappy snappy.dev ]; };
|
2018-10-13 09:12:26 +01:00
|
|
|
THRIFT_HOME = thrift;
|
|
|
|
ZLIB_HOME = symlinkJoin { name="zlib-wrap"; paths = [ zlib zlib.dev ]; };
|
2018-03-16 20:19:24 +00:00
|
|
|
ZSTD_HOME = zstd;
|
|
|
|
|
2018-03-19 00:13:16 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DARROW_PYTHON=ON"
|
2018-10-13 09:12:26 +01:00
|
|
|
"-DARROW_PARQUET=ON"
|
2018-03-19 00:13:16 +00:00
|
|
|
];
|
|
|
|
|
2018-10-13 09:12:26 +01:00
|
|
|
doInstallCheck = true;
|
|
|
|
PARQUET_TEST_DATA = if doInstallCheck then "${parquet-testing}/data" else null;
|
|
|
|
installCheckInputs = [ perl which ];
|
|
|
|
installCheckPhase = (stdenv.lib.optionalString stdenv.isDarwin ''
|
|
|
|
for f in release/*-test; do
|
|
|
|
install_name_tool -add_rpath "$out"/lib "$f"
|
|
|
|
done
|
|
|
|
'') + ''
|
|
|
|
ctest -L unittest -V
|
|
|
|
'';
|
|
|
|
|
2018-03-16 20:19:24 +00:00
|
|
|
meta = {
|
|
|
|
description = "A cross-language development platform for in-memory data";
|
|
|
|
homepage = https://arrow.apache.org/;
|
|
|
|
license = stdenv.lib.licenses.asl20;
|
|
|
|
platforms = stdenv.lib.platforms.unix;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ veprbl ];
|
|
|
|
};
|
|
|
|
}
|