Skip to content
Snippets Groups Projects
release.nix 822 B
Newer Older
Jacek Galowicz's avatar
Jacek Galowicz committed
with import (import ./nixpkgs.nix) {};

let
  rpncalc = import ./default.nix;
  afl_rpncalc = rpncalc.overrideAttrs (_: {
    nativeBuildInputs = [ afl ];
    makeFlags = [ "fuzz_calc" ];
    doCheck = false;
  });
in {
  inherit rpncalc afl_rpncalc;
  sanitized = rpncalc.overrideAttrs (_: {
    CXXFLAGS = "-fsanitize=undefined -fsanitize=address";
  });

  fuzz_rpncalc = afl_rpncalc.overrideAttrs (o: {
    nativeBuildInputs = o.nativeBuildInputs ++ [ gnuplot which ];
    preConfigure = ''
      patchShebangs fuzz_seconds.sh
    '';
    postBuild = ''
      ./fuzz_seconds.sh 10
      afl-plot out graph
    '';
    installPhase = ''
      cp -r out $out
      cp -r graph $out/

      mkdir -p $out/nix-support
      echo report testlog $out graph/index.html > $out/nix-support/hydra-build-products
    '';
  });
}