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 "7.7.12.16")
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