diff options
author | Domen Kožar <domen@dev.si> | 2023-06-12 18:39:12 +0100 |
---|---|---|
committer | Domen Kožar <domen@dev.si> | 2023-06-20 17:01:27 +0100 |
commit | d13769fd8e4a22bc302c37e428ea25959b8ceba9 (patch) | |
tree | ea1571df58d43e93f7f1b0058f4771bae063949a /pkgs/servers/clickhouse | |
parent | 940fcf2e5b12afb874cec5b454dac4fb5dc6af6b (diff) | |
download | nixlib-d13769fd8e4a22bc302c37e428ea25959b8ceba9.tar nixlib-d13769fd8e4a22bc302c37e428ea25959b8ceba9.tar.gz nixlib-d13769fd8e4a22bc302c37e428ea25959b8ceba9.tar.bz2 nixlib-d13769fd8e4a22bc302c37e428ea25959b8ceba9.tar.lz nixlib-d13769fd8e4a22bc302c37e428ea25959b8ceba9.tar.xz nixlib-d13769fd8e4a22bc302c37e428ea25959b8ceba9.tar.zst nixlib-d13769fd8e4a22bc302c37e428ea25959b8ceba9.zip |
clickhouse: build on darwin
Diffstat (limited to 'pkgs/servers/clickhouse')
-rw-r--r-- | pkgs/servers/clickhouse/default.nix | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/pkgs/servers/clickhouse/default.nix b/pkgs/servers/clickhouse/default.nix index 92955d9d8e91..12d2b3228304 100644 --- a/pkgs/servers/clickhouse/default.nix +++ b/pkgs/servers/clickhouse/default.nix @@ -1,5 +1,5 @@ { lib -, stdenv +, llvmPackages , fetchFromGitHub , cmake , ninja @@ -7,6 +7,8 @@ , perl , yasm , nixosTests +, darwin +, findutils # currently for BLAKE3 hash function , rustSupport ? true @@ -17,7 +19,13 @@ , rustPlatform }: -stdenv.mkDerivation rec { +let + inherit (llvmPackages) stdenv; + mkDerivation = ( + if stdenv.isDarwin + then darwin.apple_sdk_11_0.llvmPackages_15.stdenv + else llvmPackages.stdenv).mkDerivation; +in mkDerivation rec { pname = "clickhouse"; version = "23.3.3.52"; @@ -26,20 +34,16 @@ stdenv.mkDerivation rec { repo = "ClickHouse"; rev = "v${version}-lts"; fetchSubmodules = true; - hash = "sha256-yeoL3HA1wRDg2+t3FtrM4wBtuu94Lpe4xxGxc09duQI="; - name = "clickhouse-${rev}.tar.gz"; + hash = "sha256-fVwwMj0WbyCbe4WfpYMGVM6vXFgHsjg9MUZbNyd+a/w="; postFetch = '' - # compress to not exceed the 4GB output limit - # try to make a deterministic tarball - tar -I 'gzip -n' \ - --sort=name \ - --mtime=1970-01-01 \ - --owner=root --group=root \ - --numeric-owner --mode=go=rX,u+rw,a-s \ - --transform='s@^@source/@S' \ - -cf temp -C "$out" . - rm -r "$out" - mv temp "$out" + # delete files that make the source too big + rm -rf $out/contrib/llvm-project/llvm/test + rm -rf $out/contrib/llvm-project/clang/test + rm -rf $out/contrib/croaring/benchmarks + + # fix case insensitivity on macos https://github.com/NixOS/nixpkgs/issues/39308 + rm -rf $out/contrib/sysroot/linux-* + rm -rf $out/contrib/liburing/man ''; }; @@ -51,6 +55,10 @@ stdenv.mkDerivation rec { perl ] ++ lib.optionals stdenv.isx86_64 [ yasm + ] ++ lib.optionals stdenv.isDarwin [ + llvmPackages.bintools + findutils + darwin.bootstrap_cmds ] ++ lib.optionals rustSupport [ rustc cargo @@ -110,6 +118,9 @@ stdenv.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 '' + sed -i 's|gfind|find|' cmake/tools.cmake + sed -i 's|ggrep|grep|' cmake/tools.cmake '' + lib.optionalString rustSupport '' pushd contrib/corrosion/generator @@ -129,7 +140,7 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DENABLE_TESTS=OFF" - "-DENABLE_CCACHE=0" + "-DCOMPILER_CACHE=disabled" "-DENABLE_EMBEDDED_COMPILER=ON" "-DWERROR=OFF" ]; @@ -157,7 +168,7 @@ stdenv.mkDerivation rec { maintainers = with maintainers; [ orivej ]; # not supposed to work on 32-bit https://github.com/ClickHouse/ClickHouse/pull/23959#issuecomment-835343685 - platforms = lib.filter (x: (lib.systems.elaborate x).is64bit) platforms.linux; + platforms = lib.filter (x: (lib.systems.elaborate x).is64bit) (platforms.linux ++ platforms.darwin); broken = stdenv.buildPlatform != stdenv.hostPlatform; }; } |