sloccount: Wrap shell scripts

This fixes the issue that when `sloccount` is invoked it would fail
due to missing PATH to companion scripts.
This commit is contained in:
xbreak 2019-05-16 14:15:40 +00:00
parent 3789eb8e3a
commit d54ea3e42b

View File

@ -1,4 +1,4 @@
{ fetchurl, stdenv, perl }:
{ fetchurl, stdenv, perl, makeWrapper }:
stdenv.mkDerivation rec {
name = "sloccount-2.26";
@ -8,6 +8,7 @@ stdenv.mkDerivation rec {
sha256 = "0ayiwfjdh1946asah861ah9269s5xkc8p5fv1wnxs9znyaxs4zzs";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ perl ];
# Make sure the Flex-generated files are newer than the `.l' files, so that
@ -40,6 +41,13 @@ stdenv.mkDerivation rec {
mkdir -p "$out/share/doc"
'';
postInstall = ''
for w in "$out/bin"/*; do
isScript "$w" || continue
wrapProgram "$w" --prefix PATH : "$out/bin"
done
'';
meta = {
description = "Set of tools for counting physical Source Lines of Code (SLOC)";