summary refs log tree commit diff
path: root/pkgs/tools/security/afl
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2019-01-05 16:58:51 +0100
committerJörg Thalheim <joerg@thalheim.io>2019-01-05 17:22:24 +0100
commite2b79b10b57ac5b4484a94f4e54e87297d7c9591 (patch)
tree78571ba678cfda4ba47f8c1e490e88c2958933d7 /pkgs/tools/security/afl
parent5da3d039d4b6b5d46c39b3cd22223f02bb02bf3f (diff)
downloadnixpkgs-e2b79b10b57ac5b4484a94f4e54e87297d7c9591.tar
nixpkgs-e2b79b10b57ac5b4484a94f4e54e87297d7c9591.tar.gz
nixpkgs-e2b79b10b57ac5b4484a94f4e54e87297d7c9591.tar.bz2
nixpkgs-e2b79b10b57ac5b4484a94f4e54e87297d7c9591.tar.lz
nixpkgs-e2b79b10b57ac5b4484a94f4e54e87297d7c9591.tar.xz
nixpkgs-e2b79b10b57ac5b4484a94f4e54e87297d7c9591.tar.zst
nixpkgs-e2b79b10b57ac5b4484a94f4e54e87297d7c9591.zip
afl: various cleanups
Diffstat (limited to 'pkgs/tools/security/afl')
-rw-r--r--pkgs/tools/security/afl/default.nix23
1 files changed, 8 insertions, 15 deletions
diff --git a/pkgs/tools/security/afl/default.nix b/pkgs/tools/security/afl/default.nix
index 067d355fb90..c90d031e989 100644
--- a/pkgs/tools/security/afl/default.nix
+++ b/pkgs/tools/security/afl/default.nix
@@ -15,21 +15,18 @@ let
       url    = "http://lcamtuf.coredump.cx/afl/releases/${name}.tgz";
       sha256 = "0ig0ij4n1pwry5dw1hk4q88801jzzy2cric6y2gd6560j55lnqa3";
     };
+    enableParallelBuilding = true;
 
     # Note: libcgroup isn't needed for building, just for the afl-cgroup
     # script.
-    buildInputs  = [ makeWrapper llvm which ];
+    nativeBuildInputs = [ makeWrapper which ];
+    buildInputs = [ llvm ];
 
-    buildPhase   = ''
-      make PREFIX=$out
-      cd llvm_mode
-      make PREFIX=$out
-      cd ..
+    makeFlags = [ "PREFIX=$(out)" ];
+    postBuild = ''
+      make -C llvm_mode $makeFlags -j$NIX_BUILD_CORES
     '';
-    installPhase = ''
-      # Do the normal installation
-      make install PREFIX=$out
-
+    postInstall = ''
       # Install the custom QEMU emulator for binary blob fuzzing.
       cp ${afl-qemu}/bin/${qemu-exe-name} $out/bin/afl-qemu-trace
 
@@ -55,9 +52,7 @@ let
       done
     '';
 
-    passthru = {
-      qemu = afl-qemu;
-    };
+    passthru.qemu = afl-qemu;
 
     meta = {
       description = "Powerful fuzzer via genetic algorithms and instrumentation";
@@ -78,5 +73,3 @@ let
     };
   };
 in afl
-
-