diff options
author | Domen Kožar <domen@dev.si> | 2023-06-21 07:50:22 +0100 |
---|---|---|
committer | Domen Kožar <domen@dev.si> | 2023-06-21 13:01:20 +0100 |
commit | dea415130ab72179e264acdaa864578b8c8077f6 (patch) | |
tree | e5001811f988ce9176bae004895e1177c18ee4c8 /pkgs/servers/clickhouse | |
parent | 43be38bd783d957475c714a07c63a32fbe25a5fc (diff) |
clickhouse: compress tarball
Diffstat (limited to 'pkgs/servers/clickhouse')
-rw-r--r-- | pkgs/servers/clickhouse/default.nix | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/pkgs/servers/clickhouse/default.nix b/pkgs/servers/clickhouse/default.nix index 12d2b3228304e..ffa10568ffff7 100644 --- a/pkgs/servers/clickhouse/default.nix +++ b/pkgs/servers/clickhouse/default.nix @@ -34,7 +34,10 @@ in mkDerivation rec { repo = "ClickHouse"; rev = "v${version}-lts"; fetchSubmodules = true; - hash = "sha256-fVwwMj0WbyCbe4WfpYMGVM6vXFgHsjg9MUZbNyd+a/w="; + name = "clickhouse-${rev}.tar.gz"; + hash = if stdenv.isDarwin + then "sha256-VaUGbUyDilYPK4iBv/nICOsfeolNQeBSEtC71gBTkpE=" + else "sha256-NH+OW6zr8XBmJr68fX1WIy8Wt7cLWFMskIv7Be0TLEU="; postFetch = '' # delete files that make the source too big rm -rf $out/contrib/llvm-project/llvm/test @@ -44,6 +47,18 @@ in mkDerivation rec { # fix case insensitivity on macos https://github.com/NixOS/nixpkgs/issues/39308 rm -rf $out/contrib/sysroot/linux-* rm -rf $out/contrib/liburing/man + + # compress to not exceed the 2GB 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" ''; }; |