core/pkgs/by-name/ga/gawk/gawk-with-extensions.nix
2024-06-30 09:12:46 +01:00

21 lines
389 B
Nix

{
runCommand,
gawk,
extensions,
makeWrapper,
}:
runCommand "gawk-with-extensions"
{
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ gawk ] ++ extensions;
}
''
mkdir -p $out/bin
for i in ${gawk}/bin/*; do
name="$(basename "$i")"
makeWrapper $i $out/bin/$name \
--prefix AWKLIBPATH : "${gawk}/lib/gawk:''${AWKLIBPATH:-}"
done
''