google-cloud-sdk: compact all the JSON

This reduces output size by 20 MiB.
This commit is contained in:
edef 2020-01-31 08:53:02 +00:00
parent dbaafbbf73
commit b7641eaa5a

View File

@ -7,7 +7,7 @@
# 3) used by `google-cloud-sdk` only on GCE guests # 3) used by `google-cloud-sdk` only on GCE guests
# #
{ stdenv, lib, fetchurl, makeWrapper, python, openssl, with-gce ? false }: { stdenv, lib, fetchurl, makeWrapper, python, openssl, jq, with-gce ? false }:
let let
pythonEnv = python.withPackages (p: with p; [ pythonEnv = python.withPackages (p: with p; [
@ -38,6 +38,8 @@ in stdenv.mkDerivation rec {
buildInputs = [ python makeWrapper ]; buildInputs = [ python makeWrapper ];
nativeBuildInputs = [ jq ];
patches = [ patches = [
./gcloud-path.patch ./gcloud-path.patch
]; ];
@ -81,6 +83,12 @@ in stdenv.mkDerivation rec {
# remove tests and test data # remove tests and test data
find $out -name tests -type d -exec rm -rf '{}' + find $out -name tests -type d -exec rm -rf '{}' +
# compact all the JSON
find $out -name \*.json | while read path; do
jq -c . $path > $path.min
mv $path.min $path
done
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {