summary refs log tree commit diff
path: root/pkgs/development/tools/analysis/spin/default.nix
blob: b4fdd4c09d4ded23a8aa24992314d8e91b07863b (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
{stdenv, fetchurl, flex, yacc, tk }:

stdenv.mkDerivation {
  name = "spin-5.1.7";

  src = fetchurl {
    url = http://spinroot.com/spin/Src/spin517.tar.gz;
    sha256 = "03c6bmar4z13jx7dddb029f0qnmgl8x4hyfwn3qijjyd4dbliiw6";
  };

  buildInputs = [ flex yacc tk ];

  patchPhase = ''
    cd Src*
    sed -i -e 's/-DNXT/-DNXT -DCPP="\\"gcc -E -x c\\""/' makefile
  '';
  installPhase = ''
    mkdir -p $out/bin
    cp ../Xspin*/xsp* $out/bin/xspin
    sed -i -e '1s@^#!/bin/sh@#!${tk}/bin/wish@' \
      -e '/exec wish/d' $out/bin/xspin
    cp spin $out/bin
  '';

  meta = {
    description = "Formal verification tool for distributed software systems";
    homepage = http://spinroot.com/;
    license = "free";
  };
}