about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBen Siraphob <bensiraphob@gmail.com>2022-02-08 11:32:52 -0600
committerBen Siraphob <bensiraphob@gmail.com>2022-02-08 11:33:03 -0600
commit82834c600d9b27af2fd1e3cc55dca14e2e54c32a (patch)
treeb2a5ef8d68d8d76f128f813a10eec35e065985e2
parent78f6b5cb05fce7ae4ecb4d372a61112d57004bb8 (diff)
spin: 6.4.9 -> 6.5.2
-rw-r--r--pkgs/development/tools/analysis/spin/default.nix52
1 files changed, 24 insertions, 28 deletions
diff --git a/pkgs/development/tools/analysis/spin/default.nix b/pkgs/development/tools/analysis/spin/default.nix
index 5f0c7bffe94fe..62026d527810e 100644
--- a/pkgs/development/tools/analysis/spin/default.nix
+++ b/pkgs/development/tools/analysis/spin/default.nix
@@ -1,46 +1,42 @@
-{ stdenv, lib, fetchurl, makeWrapper, bison, gcc
-, withISpin ? true, tk, swarm, graphviz }:
+{ stdenv, lib, fetchFromGitHub, makeWrapper, bison, gcc, tk, swarm, graphviz }:
 
 let
-  binPath = lib.makeBinPath [ gcc ];
-  ibinPath = lib.makeBinPath [ gcc tk swarm graphviz tk ];
+  binPath = lib.makeBinPath [ gcc graphviz tk swarm ];
+in
 
-in stdenv.mkDerivation rec {
+stdenv.mkDerivation rec {
   pname = "spin";
-  version = "6.4.9";
-  url-version = lib.replaceChars ["."] [""] version;
-
-  src = fetchurl {
-    # The homepage is behind CloudFlare anti-DDoS protection, which blocks cURL.
-    # Dropbox mirror from developers:
-    # https://www.dropbox.com/sh/fgzipzp4wpo3qc1/AADZPqS4aoR-pjNF6OQXRLQHa
-    # (note that this URL doesn't work aross versions and hash should come from official site)
-    url = "https://www.dropbox.com/sh/fgzipzp4wpo3qc1/AABtxFePMJmPxsxSvU5cpxh8a/spin${url-version}.tar.gz?raw=1";
-    sha256 = "07b7wk3qyfnp4pgwicqd33l7i1krzyihx0cf9zkv81ywaklf5vll";
+  version = "6.5.2";
+
+  src = fetchFromGitHub {
+    owner = "nimble-code";
+    repo = "Spin";
+    rev = "version-${version}";
+    sha256 = "sha256-drvQXfDZCZRycBZt/VNngy8zs4XVJg+d1b4dQXVcyFU=";
   };
 
   nativeBuildInputs = [ makeWrapper ];
   buildInputs = [ bison ];
 
-  sourceRoot = "Spin/Src${version}";
+  sourceRoot = "source/Src";
+
+  preBuild = ''
+    mkdir -p $out/bin
+    mkdir -p $out/share/man/man1
+  '';
 
-  installPhase = ''
-    install -Dm644 ../Man/spin.1 $out/share/man/man1/spin.1
+  enableParallelBuilding = true;
+  makeFlags = [ "DESTDIR=$(out)" ];
 
-    install -Dm755 spin $out/bin/spin
-    wrapProgram $out/bin/spin \
-      --prefix PATH : ${binPath}
-  '' + lib.optionalString withISpin ''
-    install -Dm755 ../iSpin/ispin.tcl $out/bin/ispin
-    wrapProgram $out/bin/ispin \
-      --prefix PATH ':' "$out/bin:${ibinPath}"
+  postInstall = ''
+    wrapProgram $out/bin/spin --prefix PATH : ${binPath}
   '';
 
   meta = with lib; {
     description = "Formal verification tool for distributed software systems";
     homepage = "https://spinroot.com/";
-    license = licenses.free;
-    platforms = platforms.linux ++ platforms.darwin;
-    maintainers = with maintainers; [ pSub ];
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ pSub siraben ];
   };
 }