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
35 meta = with lib; {
36 description = "Formal verification tool for distributed software systems";
37 homepage = "https://spinroot.com/";
38 license = licenses.bsd3;
39 platforms = platforms.unix;
40 maintainers = with maintainers; [ pSub siraben ];
41 };
42}