clickhouse, clickhouse-lts: fix darwin build (#440536)

This commit is contained in:
misuzu
2025-09-06 14:09:23 +03:00
committed by GitHub
+18 -14
View File
@@ -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 ''