1{ stdenv, lib, fetchFromGitHub, makeWrapper, bison, gcc, tk, swarm, graphviz }:
2
3let
4 binPath = lib.makeBinPath [ gcc graphviz tk swarm ];
5in
6
7stdenv.mkDerivation rec {
8 pname = "spin";
9 version = "6.5.2";
10
11 src = fetchFromGitHub {
12 owner = "nimble-code";
13 repo = "Spin";
14 rev = "version-${version}";
15 sha256 = "sha256-drvQXfDZCZRycBZt/VNngy8zs4XVJg+d1b4dQXVcyFU=";
16 };
17
18 nativeBuildInputs = [ makeWrapper ];
19 buildInputs = [ bison ];
20
21 sourceRoot = "source/Src";
22
23 preBuild = ''
24 mkdir -p $out/bin
25 mkdir -p $out/share/man/man1
26 '';
27
28 enableParallelBuilding = true;
29 makeFlags = [ "DESTDIR=$(out)" ];
30
31 postInstall = ''
32 wrapProgram $out/bin/spin --prefix PATH : ${binPath}
33
34 mkdir -p $out/share/spin
35 cp $src/optional_gui/ispin.tcl $out/share/spin
36 makeWrapper $out/share/spin/ispin.tcl $out/bin/ispin \
37 --prefix PATH : $out/bin:${binPath}
38 '';
39
40 meta = with lib; {
41 description = "Formal verification tool for distributed software systems";
42 homepage = "https://spinroot.com/";
43 license = licenses.bsd3;
44 platforms = platforms.unix;
45 maintainers = with maintainers; [ pSub siraben ];
46 };
47}