godot-export-templates: strip export template file

Stripping reduces the template size from around 500MB to 40MB for Linux.
This is added explicitly here because mkDerivation does not automatically
strip binaries in the template directory.

This also impacts the size of the exported games and programs.
For example, here are the size of the `oh-my-git` package using this
template, without and with stripping:

```
❯ du -sh result*/
375M	result-oh-my-git-without-strip/
45M	result-oh-my-git-with-strip/
```

GitHub: closes https://github.com/NixOS/nixpkgs/issues/170470
This commit is contained in:
pacien 2022-04-26 21:38:07 +02:00 committed by Winter
parent d002312987
commit 81489719f7

View file

@ -10,6 +10,14 @@ godot.overrideAttrs (oldAttrs: rec {
mkdir -p "$out/share/godot/templates/${oldAttrs.version}.stable"
cp bin/godot.x11.opt.64 $out/share/godot/templates/${oldAttrs.version}.stable/linux_x11_64_release
'';
# https://docs.godotengine.org/en/stable/development/compiling/optimizing_for_size.html
# Stripping reduces the template size from around 500MB to 40MB for Linux.
# This also impacts the size of the exported games.
# This is added explicitly here because mkDerivation does not automatically
# strip binaries in the template directory.
stripAllList = (oldAttrs.stripAllList or []) ++ [ "share/godot/templates" ];
outputs = [ "out" ];
meta.description =
"Free and Open Source 2D and 3D game engine (export templates)";