anchor.diff:  { stdenv, lib, fetchurl, fetchFromGitHub, fixDarwinDylibNames
  -, autoconf, boost, brotli, cmake, flatbuffers, gflags, glog, gtest, lz4
  -, perl, python3, rapidjson, re2, snappy, thrift, tzdata , utf8proc, which
  +, autoconf, boost, brotli, cmake, flatbuffers, gflags, glog, gtest, jemalloc
  +, lz4, perl, python3, rapidjson, re2, snappy, thrift, tzdata , utf8proc, which
   , zlib, zstd
   , enableShared ? !stdenv.hostPlatform.isStatic
   }:
  
positive.code:   };
    sourceRoot = "apache-arrow-${version}/cpp";
  
    ARROW_JEMALLOC_URL = fetchurl {
      # From
      # ./cpp/cmake_modules/ThirdpartyToolchain.cmake
      # ./cpp/thirdparty/versions.txt
      url =
        "https://github.com/jemalloc/jemalloc/releases/download/5.2.1/jemalloc-5.2.1.tar.bz2";
      hash = "sha256-NDMOXOJ2CZ4uiVDZM121qHVomkxqVnUe87HYxTf4h/Y=";
    };
  
    ARROW_MIMALLOC_URL = fetchurl {
      # From
      # ./cpp/cmake_modules/ThirdpartyToolchain.cmake
      # ./cpp/thirdparty/versions.txt
      url =
        "https://github.com/microsoft/mimalloc/archive/v1.7.2.tar.gz";
      hash = "sha256-sZEuNUVlpLaYQQ91g8D4OTSm27Ot5Uq33csVaTIJNr0=";
    };
  
    patches = [
  
negative.code:     "-DCMAKE_INSTALL_RPATH=@loader_path/../lib" # needed for tools executables
    ] ++ lib.optional (!stdenv.isx86_64) "-DARROW_USE_SIMD=OFF";
  
    doInstallCheck = true;
    ARROW_TEST_DATA =
      if doInstallCheck then "${arrow-testing}/data" else null;
  