From 49afc40622b34a5518e4b11062d62789c8ff5249 Mon Sep 17 00:00:00 2001 From: Konstantin Bogdanov Date: Fri, 5 Sep 2025 21:01:22 +0200 Subject: [PATCH] clickhouse, clickhouse-lts: fix darwin build --- pkgs/by-name/cl/clickhouse/generic.nix | 32 +++++++++++++++----------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/pkgs/by-name/cl/clickhouse/generic.nix b/pkgs/by-name/cl/clickhouse/generic.nix index 2fd4c47dd1cd..dd3378440f32 100644 --- a/pkgs/by-name/cl/clickhouse/generic.nix +++ b/pkgs/by-name/cl/clickhouse/generic.nix @@ -90,29 +90,33 @@ llvmPackages_19.stdenv.mkDerivation (finalAttrs: { dontCargoSetupPostUnpack = true; - # Should not be necessary after 25.9 - patches = lib.optional (lib.versions.majorMinor version == "25.8") (fetchpatch { - url = "https://github.com/ClickHouse/ClickHouse/commit/67a42b78cdf1c793e78c1adbcc34162f67044032.patch"; - sha256 = "7VF+JSztqTWD+aunCS3UVNxlRdwHc2W5fNqzDyeo3Fc="; - }); + patches = + lib.optional (lib.versions.majorMinor version == "25.8") (fetchpatch { + # Disable building WASM lexer + url = "https://github.com/ClickHouse/ClickHouse/commit/67a42b78cdf1c793e78c1adbcc34162f67044032.patch"; + sha256 = "7VF+JSztqTWD+aunCS3UVNxlRdwHc2W5fNqzDyeo3Fc="; + }) + ++ + + lib.optional (lib.versions.majorMinor version == "25.8" && stdenv.hostPlatform.isDarwin) + (fetchpatch { + # Do not intercept memalign on darwin + url = "https://github.com/ClickHouse/ClickHouse/commit/0cfd2dbe981727fb650f3b9935f5e7e7e843180f.patch"; + sha256 = "1iNYZbugX2g2dxNR1ZiUthzPnhLUR8g118aG23yhgUo="; + }); postPatch = '' patchShebangs src/ utils/ - - sed -i 's|/usr/bin/env perl|"${lib.getExe perl}"|' contrib/openssl-cmake/CMakeLists.txt - - substituteInPlace utils/list-licenses/list-licenses.sh \ - --replace-fail '$(git rev-parse --show-toplevel)' "$NIX_BUILD_TOP/$sourceRoot" - '' - + lib.optionalString (lib.versions.majorMinor version <= "25.6") '' - substituteInPlace src/Storages/System/StorageSystemLicenses.sh \ - --replace-fail '$(git rev-parse --show-toplevel)' "$NIX_BUILD_TOP/$sourceRoot" '' + lib.optionalString stdenv.hostPlatform.isDarwin '' substituteInPlace cmake/tools.cmake \ --replace-fail 'gfind' 'find' \ --replace-fail 'ggrep' 'grep' \ --replace-fail '--ld-path=''${LLD_PATH}' '-fuse-ld=lld' + + substituteInPlace utils/list-licenses/list-licenses.sh \ + --replace-fail 'gfind' 'find' \ + --replace-fail 'ggrep' 'grep' '' # Rust is handled by cmake + lib.optionalString rustSupport ''