From 97738d7a1715d8022fd9d6e11e45586a56d9bdec Mon Sep 17 00:00:00 2001 From: emilylange Date: Sun, 15 Oct 2023 23:48:48 +0200 Subject: chromium: delete unused paths in source tarball to stay below hydra limit. At the time of writing, the hydra.nixos.org's output limit is 3 GB. The latest chromium tarball, however, is slightly above that. To work around this, recompress the original `tar.xz` into a `tar.zstd` and delete two unreasonably big and unused directories. Bringing it down to roughtly 2.2 GB. Unfortunately, this change breaks the `update.py` script. Resolves the current channel-blocker. --- .../networking/browsers/chromium/common.nix | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'pkgs/applications/networking/browsers/chromium/common.nix') diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix index 562fbbbb3061f..c527731bb6921 100644 --- a/pkgs/applications/networking/browsers/chromium/common.nix +++ b/pkgs/applications/networking/browsers/chromium/common.nix @@ -1,4 +1,5 @@ { stdenv, lib, fetchurl, fetchpatch +, fetchzip, zstd , buildPackages , pkgsBuildBuild , pkgsBuildTarget @@ -152,9 +153,30 @@ let inherit (upstream-info) version; inherit packageName buildType buildPath; - src = fetchurl { + src = fetchzip { + name = "chromium-${version}.tar.zstd"; url = "https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${version}.tar.xz"; inherit (upstream-info) sha256; + + nativeBuildInputs = [ zstd ]; + + postFetch = '' + echo removing unused code from tarball to stay under hydra limit + rm -r $out/third_party/{rust-src,llvm} + + echo moving remains out of \$out + mv $out source + + echo recompressing final contents into new tarball + # try to make a deterministic tarball + tar \ + --use-compress-program "zstd -T$NIX_BUILD_CORES" \ + --sort name \ + --mtime 1970-01-01 \ + --owner=root --group=root \ + --numeric-owner --mode=go=rX,u+rw,a-s \ + -cf $out source + ''; }; nativeBuildInputs = [ -- cgit 1.4.1