nixpkgs/pkgs/development/libraries/arrow-cpp/default.nix

84 lines
2.8 KiB
Nix
Raw Normal View History

2018-12-30 20:05:24 +00: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}";
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";
sha256 = "0pc5pqr0dbnx8s1ji102dhw9bbrsq3ml4ac3mmi2022yfyizlf0q";
2018-03-16 20:19:24 +00:00
};
sourceRoot = "apache-arrow-${version}/cpp";
patches = [
# fix ARROW-3467
./double-conversion_cmake.patch
# patch to fix python-test
./darwin.patch
# facebook/zstd#1385
./zstd136.patch
];
2018-03-16 20:19:24 +00:00
nativeBuildInputs = [ cmake ];
buildInputs = [ boost double-conversion glog python.pkgs.python python.pkgs.numpy ];
2018-03-16 20:19:24 +00:00
preConfigure = ''
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
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
patchShebangs build-support/
2018-03-16 20:19:24 +00:00
'';
BROTLI_HOME = symlinkJoin { name="brotli-wrap"; paths = [ brotli.lib brotli.dev ]; };
DOUBLE_CONVERSION_HOME = double-conversion;
2018-03-16 20:19:24 +00:00
FLATBUFFERS_HOME = flatbuffers;
GFLAGS_HOME = gflags;
GLOG_HOME = glog;
2018-12-30 20:05:24 +00:00
GTEST_HOME = symlinkJoin { name="gtest-wrap"; paths = [ gtest gtest.dev ]; };
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 ]; };
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"
"-DARROW_PARQUET=ON"
2018-03-19 00:13:16 +00: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 ];
};
}