about summary refs log tree commit diff
path: root/pkgs/applications/science/logic/z3
diff options
context:
space:
mode:
authorSergei Trofimovich <slyich@gmail.com>2022-01-02 10:57:30 +0000
committerAustin Seipp <aseipp@pobox.com>2022-01-02 12:45:59 -0600
commit369d7bb4ca21c311341d288d77fa53f260a6df07 (patch)
tree9ed6b052593de31065ef3b4c46a32c944d4c75c8 /pkgs/applications/science/logic/z3
parente4992cdd655925cfd1d554c73d76567f79edbff7 (diff)
z3: 4.8.12 -> 4.8.14
While at it added trivial updater plumbing.
Diffstat (limited to 'pkgs/applications/science/logic/z3')
-rw-r--r--pkgs/applications/science/logic/z3/default.nix22
1 files changed, 20 insertions, 2 deletions
diff --git a/pkgs/applications/science/logic/z3/default.nix b/pkgs/applications/science/logic/z3/default.nix
index 4153ba5f66fce..a820539eb9a31 100644
--- a/pkgs/applications/science/logic/z3/default.nix
+++ b/pkgs/applications/science/logic/z3/default.nix
@@ -10,6 +10,7 @@
 , ocaml ? null
 , findlib ? null
 , zarith ? null
+, writeScript
 }:
 
 assert javaBindings -> jdk != null;
@@ -19,13 +20,13 @@ with lib;
 
 stdenv.mkDerivation rec {
   pname = "z3";
-  version = "4.8.12";
+  version = "4.8.14";
 
   src = fetchFromGitHub {
     owner = "Z3Prover";
     repo = pname;
     rev = "z3-${version}";
-    sha256 = "1wbcdc7h3mag8infspvxxja2hiz4igjwxzvss2kqar1rjj4ivfx0";
+    sha256 = "jPSTVSndp/T7n+VxZ/g9Rjco00Up+9xeDIVkeLl1MTw=";
   };
 
   nativeBuildInputs = optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
@@ -67,6 +68,23 @@ stdenv.mkDerivation rec {
     ++ optional javaBindings "java"
     ++ optional ocamlBindings "ocaml";
 
+   passthru = {
+    updateScript = writeScript "update-z3" ''
+      #!/usr/bin/env nix-shell
+      #!nix-shell -i bash -p common-updater-scripts curl jq
+
+      set -eu -o pipefail
+
+      # Expect tags in format
+      #    [{name: "Nightly", ..., {name: "z3-vv.vv.vv", ...].
+      # Below we extract frst "z3-vv.vv" and drop "z3-" prefix.
+      newVersion="$(curl -s https://api.github.com/repos/Z3Prover/z3/releases |
+          jq 'first(.[].name|select(startswith("z3-"))|ltrimstr("z3-"))' --raw-output
+      )"
+      update-source-version ${pname} "$newVersion"
+    '';
+   };
+
   meta = with lib; {
     description = "A high-performance theorem prover and SMT solver";
     homepage = "https://github.com/Z3Prover/z3";