summary refs log tree commit diff
diff options
context:
space:
mode:
authorNguyễn Gia Phong <mcsinyx@disroot.org>2023-07-03 19:50:22 +0900
committerNguyễn Gia Phong <cnx@loang.net>2023-08-04 17:30:22 +0900
commit9365489d2307441e606dad83179e278c201cf088 (patch)
treeecdd34894738a2fcad4048bc4c86a9c8830a4e5a
parent3475c110b4c9fe38650fc689de4a7c3068edaad1 (diff)
downloadguix-9365489d2307441e606dad83179e278c201cf088.tar.gz
gnu: Add klee
* gnu/packages/klee.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/klee.scm73
2 files changed, 74 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index c603c15d6c..5c1614503f 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -370,6 +370,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/kde-systemtools.scm		\
   %D%/packages/kde-utils.scm			\
   %D%/packages/kerberos.scm			\
+  %D%/packages/klee.scm				\
   %D%/packages/kodi.scm				\
   %D%/packages/language.scm			\
   %D%/packages/lean.scm				\
diff --git a/gnu/packages/klee.scm b/gnu/packages/klee.scm
new file mode 100644
index 0000000000..ea4d4ff439
--- /dev/null
+++ b/gnu/packages/klee.scm
@@ -0,0 +1,73 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2023 Nguyễn Gia Phong <cnx@loang.net>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages klee)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix gexp)
+  #:use-module (guix git-download)
+  #:use-module (guix packages)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages cpp)
+  #:use-module (gnu packages llvm)
+  #:use-module (gnu packages maths)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages python-xyz)
+  #:use-module (gnu packages sqlite)
+  #:use-module (guix licenses))
+
+(define-public klee
+  (package
+    (name "klee")
+    (version "3.0")
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference (url "https://github.com/klee/klee")
+                            (commit (string-append "v" version))))
+        (file-name (git-file-name name version))
+        (sha256
+          (base32 "0dj20nazkcq84ryr87dihvjznapsbl1n21sa8dhhnb0wsad5d6fb"))))
+    (build-system cmake-build-system)
+    (arguments
+      (list
+        #:configure-flags
+        #~(list "-DCMAKE_BUILD_TYPE=Release"
+                "-DKLEE_RUNTIME_BUILD_TYPE=Release"
+                (string-append "-DLLVMCC="
+                               #$(this-package-native-input "clang")
+                               "/bin/clang")
+                (string-append "-DLLVMCXX="
+                               #$(this-package-native-input "clang")
+                               "/bin/clang++")
+                "-DKLEE_ENABLE_TIMESTAMP=OFF"
+                "-DENABLE_KLEE_ASSERTS=ON"
+                "-DENABLE_POSIX_RUNTIME=ON"
+                "-DENABLE_UNIT_TESTS=ON"
+                "-DENABLE_SYSTEM_TESTS=ON"
+                "-Wno-dev")
+        #:test-target "check"))
+    (native-inputs
+      `(("clang" ,clang-toolchain-12)
+        ("googletest" ,googletest)
+        ("python-lit" ,python-lit)))
+    (inputs (list cryptominisat gperftools llvm-12
+                  python python-tabulate sqlite stp z3))
+    (home-page "https://klee.github.io")
+    (synopsis "Symbolic execution engine")
+    (description "@code{KLEE} is a symbolic virtual machine built on top of the LLVM compiler infrastructure.")
+    (license ncsa)))