python3Packages.pyarrow: fix darwin build for when a build flag is false

nix-repl> with import <nixpkgs> {}; stdenv.mkDerivation { name="test"; true = true; false = false; }
«derivation /nix/store/2xk4hhfnaqymwq0iw9hxi5a34a8dbywz-test.drv»

nix show-derivation /nix/store/2xk4hhfnaqymwq0iw9hxi5a34a8dbywz-test.drv | grep -E '(true|false)'
      "false": "",
      "true": "1"

  File "setup.py", line 77, in strtobool
    raise ValueError("invalid truth value %r" % (val,))
ValueError: invalid truth value ''
This commit is contained in:
Dmitry Kalinkin 2021-12-02 05:32:04 -05:00
parent e9e53499b2
commit e5690827b5
No known key found for this signature in database
GPG Key ID: 5157B3EC8B2CA333

View File

@ -1,6 +1,8 @@
{ lib, stdenv, buildPythonPackage, python, isPy3k, arrow-cpp, cmake, cython, hypothesis, numpy, pandas, pytestCheckHook, pytest-lazy-fixture, pkg-config, setuptools-scm, six }:
let
zero_or_one = cond: if cond then 1 else 0;
_arrow-cpp = arrow-cpp.override { python3 = python; };
in
@ -18,9 +20,9 @@ buildPythonPackage rec {
PYARROW_BUILD_TYPE = "release";
PYARROW_WITH_DATASET = true;
PYARROW_WITH_FLIGHT = _arrow-cpp.enableFlight;
PYARROW_WITH_PARQUET = true;
PYARROW_WITH_DATASET = zero_or_one true;
PYARROW_WITH_FLIGHT = zero_or_one _arrow-cpp.enableFlight;
PYARROW_WITH_PARQUET = zero_or_one true;
PYARROW_CMAKE_OPTIONS = [
"-DCMAKE_INSTALL_RPATH=${ARROW_HOME}/lib"