python.pkgs.pyarrow: fix for python3

This commit is contained in:
Dmitry Kalinkin 2018-04-08 19:59:38 -04:00
parent cdf612bc0d
commit 671e9bd3bf
No known key found for this signature in database
GPG Key ID: 5157B3EC8B2CA333
2 changed files with 12 additions and 7 deletions

View File

@ -1,4 +1,4 @@
{ stdenv, symlinkJoin, fetchurl, boost, brotli, cmake, flatbuffers, gtest, gflags, lz4, pythonPackages, rapidjson, snappy, zlib, zstd }:
{ stdenv, symlinkJoin, fetchurl, boost, brotli, cmake, flatbuffers, gtest, gflags, lz4, python, rapidjson, snappy, zlib, zstd }:
stdenv.mkDerivation rec {
name = "arrow-cpp-${version}";
@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
sourceRoot = "apache-arrow-${version}/cpp";
nativeBuildInputs = [ cmake ];
buildInputs = [ boost pythonPackages.python pythonPackages.numpy ];
buildInputs = [ boost python.pkgs.python python.pkgs.numpy ];
preConfigure = ''
substituteInPlace cmake_modules/FindBrotli.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY

View File

@ -1,4 +1,9 @@
{ lib, buildPythonPackage, fetchurl, arrow-cpp, cmake, cython, futures, numpy, pandas, pytest, pytestrunner, parquet-cpp, pkgconfig, setuptools_scm, six }:
{ lib, buildPythonPackage, python, isPy3k, fetchurl, arrow-cpp, cmake, cython, futures, numpy, pandas, pytest, pytestrunner, parquet-cpp, pkgconfig, setuptools_scm, six }:
let
_arrow-cpp = arrow-cpp.override { inherit python;};
_parquet-cpp = parquet-cpp.override { arrow-cpp = _arrow-cpp; };
in
buildPythonPackage rec {
pname = "pyarrow";
@ -12,7 +17,7 @@ buildPythonPackage rec {
sourceRoot = "apache-arrow-${version}/python";
nativeBuildInputs = [ cmake cython pkgconfig setuptools_scm ];
propagatedBuildInputs = [ futures numpy six ];
propagatedBuildInputs = [ numpy six ] ++ lib.optionals (!isPy3k) [ futures ];
checkInputs = [ pandas pytest pytestrunner ];
PYARROW_BUILD_TYPE = "release";
@ -23,7 +28,7 @@ buildPythonPackage rec {
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}")'
substituteInPlace cmake_modules/FindParquet.cmake --replace 'set(PARQUET_ABI_VERSION "1.0.0")' 'set(PARQUET_ABI_VERSION "${_parquet-cpp.version}")'
'';
preCheck = ''
@ -45,8 +50,8 @@ buildPythonPackage rec {
substituteInPlace pyarrow/tests/test_feather.py --replace "test_deserialize_buffer_in_different_process" "_disabled"
'';
ARROW_HOME = arrow-cpp;
PARQUET_HOME = parquet-cpp;
ARROW_HOME = _arrow-cpp;
PARQUET_HOME = _parquet-cpp;
setupPyBuildFlags = ["--with-parquet" ];