about summary refs log tree commit diff
path: root/pkgs/servers/clickhouse/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/servers/clickhouse/default.nix')
-rw-r--r--pkgs/servers/clickhouse/default.nix25
1 files changed, 13 insertions, 12 deletions
diff --git a/pkgs/servers/clickhouse/default.nix b/pkgs/servers/clickhouse/default.nix
index 4b5071be7bd2..609877ae1f9c 100644
--- a/pkgs/servers/clickhouse/default.nix
+++ b/pkgs/servers/clickhouse/default.nix
@@ -24,7 +24,7 @@
 let
   inherit (llvmPackages) stdenv;
   mkDerivation = (
-    if stdenv.isDarwin
+    if stdenv.hostPlatform.isDarwin
     then darwin.apple_sdk_11_0.llvmPackages_16.stdenv
     else llvmPackages.stdenv).mkDerivation;
 in mkDerivation rec {
@@ -83,10 +83,10 @@ in mkDerivation rec {
     python3
     perl
     llvmPackages.lld
-  ] ++ lib.optionals stdenv.isx86_64 [
+  ] ++ lib.optionals stdenv.hostPlatform.isx86_64 [
     nasm
     yasm
-  ] ++ lib.optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
     llvmPackages.bintools
     findutils
     darwin.bootstrap_cmds
@@ -96,7 +96,7 @@ in mkDerivation rec {
     rustPlatform.cargoSetupHook
   ];
 
-  buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
+  buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
 
   # their vendored version is too old and missing this patch: https://github.com/corrosion-rs/corrosion/pull/205
   corrosionSrc = if rustSupport then fetchFromGitHub {
@@ -133,9 +133,9 @@ in mkDerivation rec {
     pushd rust
     cargoDeps="$rustDeps" cargoSetupPostUnpackHook
     rustDepsCopy="$cargoDepsCopy"
-    cat .cargo/config >> .cargo/config.toml.in
-    cat .cargo/config >> skim/.cargo/config.toml.in
-    rm .cargo/config
+    cat .cargo/config.toml >> .cargo/config.toml.in
+    cat .cargo/config.toml >> skim/.cargo/config.toml.in
+    rm .cargo/config.toml
     popd
 
     popd
@@ -154,7 +154,7 @@ in mkDerivation rec {
       --replace 'git rev-parse --show-toplevel' '$src'
     substituteInPlace utils/check-style/check-style \
       --replace 'git rev-parse --show-toplevel' '$src'
-  '' + lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
     sed -i 's|gfind|find|' cmake/tools.cmake
     sed -i 's|ggrep|grep|' cmake/tools.cmake
   '' + lib.optionalString rustSupport ''
@@ -168,7 +168,7 @@ in mkDerivation rec {
     popd
 
     cargoSetupPostPatchHook() { true; }
-  '' + lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
     # Make sure Darwin invokes lld.ld64 not lld.
     substituteInPlace cmake/tools.cmake \
       --replace '--ld-path=''${LLD_PATH}' '-fuse-ld=lld'
@@ -178,15 +178,16 @@ in mkDerivation rec {
     "-DENABLE_TESTS=OFF"
     "-DCOMPILER_CACHE=disabled"
     "-DENABLE_EMBEDDED_COMPILER=ON"
-  ];
+  ] ++
+  lib.optional (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) "-DNO_ARMV81_OR_HIGHER=1";
 
   env = {
     NIX_CFLAGS_COMPILE =
       # undefined reference to '__sync_val_compare_and_swap_16'
-      lib.optionalString stdenv.isx86_64 " -mcx16" +
+      lib.optionalString stdenv.hostPlatform.isx86_64 " -mcx16" +
       # Silence ``-Wimplicit-const-int-float-conversion` error in MemoryTracker.cpp and
       # ``-Wno-unneeded-internal-declaration` TreeOptimizer.cpp.
-      lib.optionalString stdenv.isDarwin " -Wno-implicit-const-int-float-conversion -Wno-unneeded-internal-declaration";
+      lib.optionalString stdenv.hostPlatform.isDarwin " -Wno-implicit-const-int-float-conversion -Wno-unneeded-internal-declaration";
   };
 
   # https://github.com/ClickHouse/ClickHouse/issues/49988