summary refs log tree commit diff
path: root/pkgs/applications/science/logic/avy/default.nix
blob: f6f43f1b0bb3034488d66449d0bec5749aaead15 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{ lib, stdenv, fetchgit, cmake, zlib, boost }:

stdenv.mkDerivation rec {
  pname = "avy";
  version = "2019.05.01"; # date of cav19 tag

  src = fetchgit {
    url    = "https://bitbucket.org/arieg/extavy";
    rev    = "cav19";
    sha256 = "0qdzy9srxp5f38x4dbb3prnr9il6cy0kz80avrvd7fxqzy7wdlwy";
    fetchSubmodules = true;
  };

  nativeBuildInputs = [ cmake ];
  buildInputs = [ zlib boost.out boost.dev ];
  NIX_CFLAGS_COMPILE = toString ([ "-Wno-narrowing" ]
    # Squelch endless stream of warnings on same few things
    ++ lib.optionals stdenv.cc.isClang [
      "-Wno-empty-body"
      "-Wno-tautological-compare"
      "-Wc++11-compat-deprecated-writable-strings"
      "-Wno-deprecated"
    ]);

  prePatch = ''
    sed -i -e '1i#include <stdint.h>' abc/src/bdd/dsd/dsd.h
    substituteInPlace abc/src/bdd/dsd/dsd.h --replace \
               '((Child = Dsd_NodeReadDec(Node,Index))>=0);' \
               '((intptr_t)(Child = Dsd_NodeReadDec(Node,Index))>=0);'

    patch -p1 -d minisat -i ${./minisat-fenv.patch}
    patch -p1 -d glucose -i ${./glucose-fenv.patch}
  '';

  installPhase = ''
    mkdir -p $out/bin
    cp avy/src/{avy,avybmc} $out/bin/
  '';

  meta = {
    description = "AIGER model checking for Property Directed Reachability";
    homepage    = "https://arieg.bitbucket.io/avy/";
    license     = lib.licenses.mit;
    maintainers = with lib.maintainers; [ thoughtpolice ];
    platforms   = lib.platforms.linux;
  };
}