summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2010-06-01 10:13:25 +0000
committerLudovic Courtès <ludo@gnu.org>2010-06-01 10:13:25 +0000
commit80e7412199465546d817b2dfa120a71f19778298 (patch)
treebda3477fa76ec3b9967f7e4ae7d4b341e0913234 /pkgs/development
parent4036f1f614bf951baf610aa33e6c8de93dd7b246 (diff)
downloadnixpkgs-80e7412199465546d817b2dfa120a71f19778298.tar
nixpkgs-80e7412199465546d817b2dfa120a71f19778298.tar.gz
nixpkgs-80e7412199465546d817b2dfa120a71f19778298.tar.bz2
nixpkgs-80e7412199465546d817b2dfa120a71f19778298.tar.lz
nixpkgs-80e7412199465546d817b2dfa120a71f19778298.tar.xz
nixpkgs-80e7412199465546d817b2dfa120a71f19778298.tar.zst
nixpkgs-80e7412199465546d817b2dfa120a71f19778298.zip
sloccount: Fix non-determinism due to timestamps.
svn path=/nixpkgs/trunk/; revision=22077
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/tools/misc/sloccount/default.nix17
1 files changed, 16 insertions, 1 deletions
diff --git a/pkgs/development/tools/misc/sloccount/default.nix b/pkgs/development/tools/misc/sloccount/default.nix
index b25313f4355..906770e9066 100644
--- a/pkgs/development/tools/misc/sloccount/default.nix
+++ b/pkgs/development/tools/misc/sloccount/default.nix
@@ -10,10 +10,22 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ perl ];
 
+  # Make sure the Flex-generated files are newer than the `.l' files, so that
+  # Flex isn't needed to recompile them.
   patchPhase = ''
     for file in *
     do
-      substituteInPlace "$file" --replace "/usr/bin/perl" "${perl}/bin/perl"
+      if grep -q /usr/bin/perl "$file"
+      then
+          echo "patching \`$file'..."
+          substituteInPlace "$file" --replace \
+            "/usr/bin/perl" "${perl}/bin/perl"
+      fi
+    done
+
+    for file in *.l
+    do
+      touch "$(echo $file | sed -es'/\.l$/.c/g')"
     done
   '';
 
@@ -47,5 +59,8 @@ stdenv.mkDerivation rec {
     license = "GPLv2+";
 
     homepage = http://www.dwheeler.com/sloccount/;
+
+    maintainers = [ stdenv.lib.maintainers.ludo ];
+    platforms = stdenv.lib.platforms.all;
   };
 }