about summary refs log tree commit diff
path: root/pkgs/applications/science/logic/opensmt
diff options
context:
space:
mode:
authorfreezeboy <freezeboy@users.noreply.github.com>2020-11-02 13:50:10 +0100
committerfreezeboy <freezeboy@users.noreply.github.com>2021-01-01 23:38:04 +0100
commit9fd99b5a32f66cc4199d9c86cecb8c8bb5090ad8 (patch)
treedca918ed9f97f3b7d1f193e454a84a9920dba978 /pkgs/applications/science/logic/opensmt
parent9b78f36021b3530773c4a2136c26862d32aef3f6 (diff)
opensmt: 20101017 -> 2.0.1
Diffstat (limited to 'pkgs/applications/science/logic/opensmt')
-rw-r--r--pkgs/applications/science/logic/opensmt/default.nix37
1 files changed, 25 insertions, 12 deletions
diff --git a/pkgs/applications/science/logic/opensmt/default.nix b/pkgs/applications/science/logic/opensmt/default.nix
index 03b3ce4ff0b77..1681d4545904f 100644
--- a/pkgs/applications/science/logic/opensmt/default.nix
+++ b/pkgs/applications/science/logic/opensmt/default.nix
@@ -1,25 +1,38 @@
-{ stdenv, fetchurl, automake, libtool, autoconf, intltool, perl
-, gmpxx, flex, bison
+{ stdenv, lib, fetchFromGitHub
+, cmake, libedit, gmpxx, bison, flex
+, enableReadline ? false, readline
+, gtest
 }:
 
 stdenv.mkDerivation rec {
   pname = "opensmt";
-  version = "20101017";
+  version = "2.0.1";
 
-  src = fetchurl {
-    url = "http://opensmt.googlecode.com/files/opensmt_src_${version}.tgz";
-    sha256 = "0xrky7ixjaby5x026v7hn72xh7d401w9jhccxjn0khhn1x87p2w1";
+  src = fetchFromGitHub {
+    owner = "usi-verification-and-security";
+    repo = "opensmt";
+    rev = "v${version}";
+    sha256 = "uoIcXWsxxRsIuFsou3RcN9e48lc7cWMgRPVJLFVslDE=";
   };
 
-  buildInputs = [ automake libtool autoconf intltool perl gmpxx flex bison ];
+  nativeBuildInputs = [ cmake bison flex ];
+  buildInputs = [ libedit gmpxx ]
+    ++ lib.optional enableReadline readline;
 
-  meta = with stdenv.lib; {
+  preConfigure = ''
+    substituteInPlace test/CMakeLists.txt \
+      --replace 'FetchContent_Populate' '#FetchContent_Populate'
+  '';
+  cmakeFlags = [
+    "-Dgoogletest_SOURCE_DIR=${gtest.src}"
+    "-Dgoogletest_BINARY_DIR=./gtest-build"
+  ];
+
+  meta = with lib; {
     description = "A satisfiability modulo theory (SMT) solver";
     maintainers = [ maintainers.raskin ];
     platforms = platforms.linux;
-    license = licenses.gpl3;
-    homepage = "http://code.google.com/p/opensmt/";
-    broken = true;
-    downloadPage = "http://code.google.com/p/opensmt/downloads/list";
+    license = if enableReadline then licenses.gpl2Plus else licenses.mit;
+    homepage = "https://github.com/usi-verification-and-security/opensmt";
   };
 }