summary refs log tree commit diff
path: root/pkgs/development/tools/analysis/spin/default.nix
blob: 6cf84434cdeca9f8a5a475bb366b359bd21d0b3d (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
{ stdenv, lib, fetchFromGitHub, makeWrapper, bison, gcc, tk, swarm, graphviz }:

let
  binPath = lib.makeBinPath [ gcc graphviz tk swarm ];
in

stdenv.mkDerivation rec {
  pname = "spin";
  version = "6.5.2";

  src = fetchFromGitHub {
    owner = "nimble-code";
    repo = "Spin";
    rev = "version-${version}";
    sha256 = "sha256-drvQXfDZCZRycBZt/VNngy8zs4XVJg+d1b4dQXVcyFU=";
  };

  nativeBuildInputs = [ makeWrapper ];
  buildInputs = [ bison ];

  sourceRoot = "source/Src";

  preBuild = ''
    mkdir -p $out/bin
    mkdir -p $out/share/man/man1
  '';

  enableParallelBuilding = true;
  makeFlags = [ "DESTDIR=$(out)" ];

  postInstall = ''
    wrapProgram $out/bin/spin --prefix PATH : ${binPath}

    mkdir -p $out/share/spin
    cp $src/optional_gui/ispin.tcl $out/share/spin
    makeWrapper $out/share/spin/ispin.tcl $out/bin/ispin \
      --prefix PATH : $out/bin:${binPath}
  '';

  meta = with lib; {
    description = "Formal verification tool for distributed software systems";
    homepage = "https://spinroot.com/";
    license = licenses.bsd3;
    platforms = platforms.unix;
    maintainers = with maintainers; [ pSub siraben ];
  };
}