about summary refs log tree commit diff
path: root/shell.nix
diff options
context:
space:
mode:
Diffstat (limited to 'shell.nix')
-rw-r--r--shell.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/shell.nix b/shell.nix
index d94ae88..52541b8 100644
--- a/shell.nix
+++ b/shell.nix
@@ -5,6 +5,26 @@
 
 with import <nixpkgs> { };
 let
+  binRenameHook = version: writeTextFile {
+    name = "bin-rename-hook";
+    text = ''
+      #!${runtimeShell}
+      renameBinaries() {
+        for i in $out/bin/*
+        do mv $i{,.${version}}
+        done
+      }
+      preDistPhases+=(renameBinaries)
+    '';
+    executable = true;
+    destination = "/nix-support/setup-hook";
+  };
+  cppcheck = version: commit: hash: callPackage ./cppcheck.nix {
+    inherit version;
+    inherit commit;
+    inherit hash;
+    binRenameHook = binRenameHook version;
+  };
   grep-2_6 = fetchurl {
     url = "mirror://gnu/grep/grep-2.6.tar.xz";
     hash = "sha256-YsNien9DBt1gBAED27fZ8SIOSlTFV9ndDEwy9t1itRE=";
@@ -20,9 +40,16 @@ let
       url = "http://git.savannah.gnu.org/cgit/grep.git/snapshot/grep-${commit}.tar.gz";
       inherit hash;
     };
+    binRenameHook = binRenameHook version;
   };
 in mkShell {
   packages = [
+    (cppcheck "9261.buggy"
+      "4943771e41f76edc64b273c6b257ecc0ba778a20"
+      "sha256-mcE9Nq/OfNiLgz3PuZEUplFRMc7E2D7ALuFdNFT6iQI=")
+    (cppcheck "9261.fixed"
+      "00fae7fb428b0b055135d6b972a1b52dd2c08d03"
+      "sha256-jJY06u07fzd9AOd1pr7xM7Qdm6oDW1ehGEqKlxxHT6s=")
     (grep "8f08d8e2.parent" grep-2_6
       "c1cb19fe67f4c83f9232087ae03c178905d62b0d"
       "sha256-tT3H9pehJ8X6XPf6qyhUvjKspQZXvCd2I4uQQuabOn8=")