guix-more/more/packages/smt.scm

smt.scm

1
;;; GNU Guix --- Functional package management for GNU
2
;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
3
;;;
4
;;; This file is part of GNU Guix.
5
;;;
6
;;; GNU Guix is free software; you can redistribute it and/or modify it
7
;;; under the terms of the GNU General Public License as published by
8
;;; the Free Software Foundation; either version 3 of the License, or (at
9
;;; your option) any later version.
10
;;;
11
;;; GNU Guix is distributed in the hope that it will be useful, but
12
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
;;; GNU General Public License for more details.
15
;;;
16
;;; You should have received a copy of the GNU General Public License
17
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
18
19
(define-module (more packages smt)
20
  #:use-module (guix packages)
21
  #:use-module (guix download)
22
  #:use-module (guix build-system gnu)
23
  #:use-module (guix build-system python)
24
  #:use-module ((guix licenses) #:prefix license:)
25
  #:use-module (gnu packages)
26
  #:use-module (gnu packages maths)
27
  #:use-module (gnu packages ocaml)
28
  #:use-module (gnu packages python)
29
  #:use-module (more packages python))
30
31
(define-public python2-z3-solver
32
  (package
33
    (inherit z3)
34
    (name "python2-z3-solver")
35
    (build-system python-build-system)
36
    (propagated-inputs
37
     `(("z3" ,z3)))
38
    (arguments
39
     `(#:python ,python-2
40
       #:phases
41
       (modify-phases %standard-phases
42
         (add-before 'build 'prepare
43
           (lambda* (#:key inputs #:allow-other-keys)
44
             (system* "python" "scripts/mk_make.py")
45
             (copy-file "build/python/z3/z3core.py" "src/api/python/z3/z3core.py")
46
             (copy-file "build/python/z3/z3consts.py" "src/api/python/z3/z3consts.py")
47
             (chdir "src/api/python")
48
             (substitute* "z3/z3core.py"
49
               (("_dirs = \\[")
50
                (string-append "_dirs = ['" (assoc-ref inputs "z3")
51
                                            "/lib', ")))
52
             (substitute* "MANIFEST.in"
53
               ((".*") ""))
54
             (substitute* "setup.py"
55
               (("self.execute\\(.*") "\n")
56
               (("scripts=.*") "\n")))))))))
57
58
(define-public python2-claripy
59
  (package
60
    (name "python2-claripy")
61
    (version "6.7.7.27")
62
    (source (origin
63
              (method url-fetch)
64
              (uri (pypi-uri "claripy" version))
65
              (sha256
66
               (base32
67
                "1jrnww0lpfi65g83pbdkig951r4jrhri67dn4n67viz897q73736"))
68
              (modules '((guix build utils)))
69
              (snippet
70
               `(substitute* "setup.py"
71
                  (("angr-only-z3-custom==9002") "z3-solver")))))
72
    (build-system python-build-system)
73
    (propagated-inputs
74
     `(("ana" ,python2-ana)
75
       ("z3" ,python2-z3-solver)))
76
    (arguments
77
     `(#:python ,python-2))
78
    (home-page "https://github.com/angr/claripy")
79
    (synopsis "Claripy is a abstracted constraint-solving wrapper")
80
    (description "Claripy is a abstracted constraint-solving wrapper.")
81
    (license license:bsd-2)))
82
83
(define-public why3
84
  (package
85
    (name "why3")
86
    (version "0.87.3")
87
    (source (origin
88
              (method url-fetch)
89
              (uri (string-append "https://gforge.inria.fr/frs/download.php/file/36398/why3-"
90
                                  version ".tar.gz"))
91
              (sha256
92
               (base32
93
                "1fn9v6w1ilkrm2n4rz31w8qvjnchyvwxiqs67z3f59b5k99wb2ka"))))
94
    (build-system gnu-build-system)
95
    (native-inputs
96
     `(("ocaml" ,ocaml)))
97
    (propagated-inputs
98
     `(("menhir" ,ocaml-menhir)))
99
    (arguments
100
     `(#:tests? #f)) ;; Need Alt-Ergo
101
       ;#:phases
102
       ;(modify-phases %standard-phases
103
       ;  (replace 'check
104
       ;    (lambda _
105
       ;      (zero? (system* "make" ;"test-ocaml-extraction"
106
       ;                      "test-runstrat" "test-coq-tactic.opt"
107
       ;                      "test-coq-tactic.byte" "test-session.opt"
108
       ;                      "test-session.byte" "test-api-mlw.opt"
109
       ;                      "test-api-mlw.byte" "test-api-mlw-tree.opt"
110
       ;                      "test-mlw-tree.byte" "test-api-logic.opt"
111
       ;                      "test-api-logic.byte")))))))
112
    (home-page "http://why3.lri.fr")
113
    (synopsis "")
114
    (description "")
115
    (license license:lgpl2.1)))
116