summary refs log tree commit diff
path: root/pkgs/applications/science/logic/avy/default.nix
blob: 78ed641a809a202e70b237bf21513ce5aced9177 (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
48
49
50
51
52
53
{ stdenv, fetchgit, cmake, zlib, boost }:

stdenv.mkDerivation {
  pname = "avy";
  version = "2017.10.16";

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

  buildInputs = [ cmake zlib boost.out boost.dev ];
  NIX_CFLAGS_COMPILE = toString ([ "-Wno-narrowing" ]
    # Squelch endless stream of warnings on same few things
    ++ stdenv.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}
  '';

  patches =
    [ ./0001-no-static-boost-libs.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     = stdenv.lib.licenses.mit;
    maintainers = with stdenv.lib.maintainers; [ thoughtpolice ];
    platforms   = stdenv.lib.platforms.linux;
    # See pkgs/applications/science/logic/glucose/default.nix
    # (The error is different due to glucose-fenv.patch, but the same)
    badPlatforms = [ "aarch64-linux" ];
  };
}