@@ -38,6 +38,7 @@
3838, zstd
3939, enableShared ? !stdenv.hostPlatform.isStatic
4040, enableFlight ? !stdenv.isDarwin # libnsl is not supported on darwin
41+, enableJemalloc ? !(stdenv.isAarch64 && stdenv.isDarwin)
4142 # boost/process is broken in 1.69 on darwin, but fixed in 1.70 and
4243 # non-existent in older versions
4344 # see https://github.com/boostorg/process/issues/55
@@ -76,7 +77,7 @@ stdenv.mkDerivation rec {
7677 };
7778 sourceRoot = "apache-arrow-${version}/cpp";
7879
79− ARROW_JEMALLOC_URL = jemalloc.src;
80+ ${if enableJemalloc then "ARROW_JEMALLOC_URL" else null} = jemalloc.src;
8081
8182 ARROW_MIMALLOC_URL = fetchFromGitHub {
8283 # From
@@ -155,6 +156,7 @@ stdenv.mkDerivation rec {
155156 "-DARROW_COMPUTE=ON"
156157 "-DARROW_CSV=ON"
157158 "-DARROW_DATASET=ON"
159+ "-DARROW_JEMALLOC=${if enableJemalloc then "ON" else "OFF"}"
158160 "-DARROW_JSON=ON"
159161 "-DARROW_PLASMA=ON"
160162 # Disable Python for static mode because openblas is currently broken there.