From a49ebbb7435b08509f05e894d37e93a5498a9d69 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Tue, 20 Mar 2018 18:19:39 -0400 Subject: [PATCH] parquet-cpp: init at 1.4.0 Also fix RPATH issues in pyarrow --- .../libraries/parquet-cpp/default.nix | 37 +++++++++++++++++++ .../python-modules/pyarrow/default.nix | 13 +++++-- pkgs/top-level/all-packages.nix | 2 + 3 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 pkgs/development/libraries/parquet-cpp/default.nix diff --git a/pkgs/development/libraries/parquet-cpp/default.nix b/pkgs/development/libraries/parquet-cpp/default.nix new file mode 100644 index 000000000000..e281e604380b --- /dev/null +++ b/pkgs/development/libraries/parquet-cpp/default.nix @@ -0,0 +1,37 @@ +{ stdenv, symlinkJoin, fetchurl, arrow-cpp, boost, cmake, gtest, snappy, thrift, zlib }: + +stdenv.mkDerivation rec { + name = "parquet-cpp-${version}"; + version = "1.4.0"; + + src = fetchurl { + url = "https://github.com/apache/parquet-cpp/archive/apache-${name}.tar.gz"; + sha256 = "1kn7pjzi5san5f05qbl8l8znqsa3f9cq9bflfr4s2jfwr7k9p2aj"; + }; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ boost ]; + + preConfigure = '' + substituteInPlace cmake_modules/FindThrift.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY + substituteInPlace cmake_modules/FindSnappy.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY + ''; + + ARROW_HOME = arrow-cpp; + THRIFT_HOME = thrift; + GTEST_HOME = gtest; + SNAPPY_HOME = symlinkJoin { name="snappy-wrap"; paths = [ snappy snappy.dev ]; }; + ZLIB_HOME = symlinkJoin { name="zlib-wrap"; paths = [ zlib.dev zlib.static ]; }; + + cmakeFlags = [ + "-DPARQUET_BUILD_BENCHMARKS=OFF" + ]; + + meta = { + description = "A C++ library to read and write the Apache Parquet columnar data format"; + homepage = http://parquet.apache.org; + license = stdenv.lib.licenses.asl20; + platforms = stdenv.lib.platforms.unix; + maintainers = with stdenv.lib.maintainers; [ veprbl ]; + }; +} diff --git a/pkgs/development/python-modules/pyarrow/default.nix b/pkgs/development/python-modules/pyarrow/default.nix index 8804953045e4..11c2868c3370 100644 --- a/pkgs/development/python-modules/pyarrow/default.nix +++ b/pkgs/development/python-modules/pyarrow/default.nix @@ -1,4 +1,4 @@ -{ lib, buildPythonPackage, fetchurl, arrow-cpp, cmake, cython, futures, numpy, pandas, pytest, pkgconfig, setuptools_scm, six }: +{ lib, buildPythonPackage, fetchurl, arrow-cpp, cmake, cython, futures, numpy, pandas, pytest, parquet-cpp, pkgconfig, setuptools_scm, six }: buildPythonPackage rec { pname = "pyarrow"; @@ -16,10 +16,14 @@ buildPythonPackage rec { checkInputs = [ pandas pytest ]; PYARROW_BUILD_TYPE = "release"; - PYARROW_BUNDLE_ARROW_CPP = 1; # sets RPATH on darwin + PYARROW_CMAKE_OPTIONS = "-DCMAKE_INSTALL_RPATH=${ARROW_HOME}/lib;${PARQUET_HOME}/lib"; preBuild = '' - substituteInPlace CMakeLists.txt --replace "''${ARROW_SO_VERSION}" '"0"' + substituteInPlace CMakeLists.txt --replace "\''${ARROW_ABI_VERSION}" '"0.0.0"' + substituteInPlace CMakeLists.txt --replace "\''${ARROW_SO_VERSION}" '"0"' + + # fix the hardcoded value + substituteInPlace cmake_modules/FindParquet.cmake --replace 'set(PARQUET_ABI_VERSION "1.0.0")' 'set(PARQUET_ABI_VERSION "${parquet-cpp.version}")' ''; preCheck = '' @@ -36,6 +40,9 @@ buildPythonPackage rec { ''; ARROW_HOME = arrow-cpp; + PARQUET_HOME = parquet-cpp; + + setupPyBuildFlags = ["--with-parquet" ]; meta = with lib; { description = "A cross-language development platform for in-memory data"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9ffabd197861..a81fe88b8a85 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10872,6 +10872,8 @@ with pkgs; paperkey = callPackage ../tools/security/paperkey { }; + parquet-cpp = callPackage ../development/libraries/parquet-cpp {}; + pangoxsl = callPackage ../development/libraries/pangoxsl { }; pcaudiolib = callPackage ../development/libraries/pcaudiolib {