nut: strip debug symbols from cgi-bin/

Noticed by Majiir Paktu as a `gcc` development bits in the closure.
The change remove 10 dependencies worth of 150MB from the closure:

Before:

    $ nix path-info -rsSh ./result-before | nl | tail -n1
       144  /nix/store/b0jsf912bix056gg3p1nz8lh3yasm82j-nut-2.8.0                             10.0M  567.7M

After:

    $ nix path-info -rsSh ./result | nl | tail -n1
       134  /nix/store/gniv2fpm7qxdiszqwhz81iyvxpc62n52-nut-2.8.0                              9.7M  343.8M
This commit is contained in:
Sergei Trofimovich 2023-09-23 08:06:29 +01:00
parent 0b0169e4f1
commit 3c555c6729

View File

@ -57,6 +57,10 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
# Add `cgi-bin` to the default list to avoid pulling in whole
# of `gcc` into build closure.
stripDebugList = [ "cgi-bin" "lib" "lib32" "lib64" "libexec" "bin" "sbin" ];
postInstall = ''
substituteInPlace $out/lib/systemd/system-shutdown/nutshutdown \
--replace /bin/sleep "${coreutils}/bin/sleep" \