anchor.diff:      cmake
       autoconf # for vendored jemalloc
       flatbuffers
  -  ] ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
  +  ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
     buildInputs = [
       boost
       brotli
  
positive.code:     # Disable Python for static mode because openblas is currently broken there.
      "-DARROW_PYTHON=${if enableShared then "ON" else "OFF"}"
      "-Duriparser_SOURCE=SYSTEM"
    ] ++ stdenv.lib.optionals (!enableShared) [
      "-DARROW_BUILD_SHARED=OFF"
      "-DARROW_TEST_LINKAGE=static"
      "-DOPENSSL_USE_STATIC_LIBS=ON"
    ] ++ stdenv.lib.optional (!stdenv.isx86_64) "-DARROW_USE_SIMD=OFF";
  
    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{,s}; do
        install_name_tool -add_rpath "$out"/lib  "$f"
      done
    '')
    + (let
      excludedTests = stdenv.lib.optionals stdenv.isDarwin [
        # Some plasma tests need to be patched to use a shorter AF_UNIX socket
        # path on Darwin. See https://github.com/NixOS/nix/pull/1085
        "plasma-external-store-tests"
  
negative.code:   patches = [
      # patch to fix python-test
      ./darwin.patch
    ] ++ lib.optionals (!enableShared) [
      # The shared jemalloc lib is unused and breaks in static mode due to missing -fpic.
      ./jemalloc-disable-shared.patch
    ];
  