quebex

A software analysis framework built around the QBE intermediate language

git clone https://git.8pit.net/quebex.git

  1;; SPDX-FileCopyrightText: 2025 Sören Tempel <soeren+git@soeren-tempel.net>
  2;;
  3;; SPDX-License-Identifier: GPL-3.0-only
  4
  5(define-module (quebex-packages)
  6  #:use-module (guix) ; XXX: this helps 'current-source-directory'
  7  #:use-module ((guix licenses) #:prefix license:)
  8  #:use-module (gnu packages c)
  9  #:use-module (gnu packages haskell)
 10  #:use-module (gnu packages haskell-apps)
 11  #:use-module (gnu packages haskell-check)
 12  #:use-module (gnu packages haskell-xyz)
 13  #:use-module (gnu packages maths)
 14  #:use-module (guix build-system haskell)
 15  #:use-module (guix download)
 16  #:use-module (guix gexp)
 17  #:use-module (guix git-download)
 18  #:use-module (guix packages))
 19
 20(define-public ghc-simple-smt
 21  (package
 22    (name "ghc-simple-smt")
 23    (version "0.9.8")
 24    (source
 25     (origin
 26       (method url-fetch)
 27       (uri (hackage-uri "simple-smt" version))
 28       (sha256
 29        (base32 "0imimkpzbd013gadkg7sc05jr70lffaij4ijzk368iw8xgvgxyf9"))))
 30    (build-system haskell-build-system)
 31    (properties '((upstream-name . "simple-smt")))
 32    (home-page "https://github.com/yav/simple-smt")
 33    (synopsis "Simple way to interact with an SMT solver process.")
 34    (description
 35     "This package provides a simple way to interact with an SMT solver process.")
 36    (license license:bsd-3)))
 37
 38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 39
 40(define %srcdir
 41  (string-append (current-source-directory) "/../.."))
 42
 43(define-public quebex-syntax
 44  (package
 45    (name "quebex-syntax")
 46    (version "0.1.0.0")
 47    (source (local-file (string-append %srcdir "/quebex-syntax")
 48                        "git-checkout"
 49                        #:recursive? #t))
 50    (build-system haskell-build-system)
 51    (inputs (list ghc-9.2))
 52    (native-inputs
 53      (list
 54        qbe
 55        ghc-tasty
 56        ghc-tasty-hunit
 57        ghc-tasty-golden))
 58    (synopsis "Parser library for the QBE intermediate language")
 59    (description "")
 60    (home-page "https://git.8pit.net/quebex")
 61    (license (list license:expat license:bsd-2 license:gpl3))))
 62
 63(define-public quebex
 64  (package
 65    (name "quebex")
 66    (version "0.1.0.0")
 67    (source (local-file (string-append %srcdir "/quebex")
 68                        "git-checkout"
 69                        #:recursive? #t))
 70    (build-system haskell-build-system)
 71    (inputs (list ghc-9.2))
 72    (native-inputs
 73      (list
 74        quebex-syntax
 75        ghc-tasty
 76        ghc-tasty-hunit))
 77    (synopsis "Analysis library for the QBE intermediate language")
 78    (description "")
 79    (home-page "https://git.8pit.net/quebex")
 80    (license (list license:expat license:gpl3))))
 81
 82(define-public quebex-symex
 83  (package
 84    (name "quebex-symex")
 85    (version "0.1.0.0")
 86    (source (local-file (string-append %srcdir "/quebex-symex")
 87                        "git-checkout"
 88                        #:recursive? #t))
 89    (build-system haskell-build-system)
 90    (inputs (list ghc-9.2))
 91    (propagated-inputs (list bitwuzla)) ;; TODO: Wrapper on quebex-cli?
 92    (native-inputs
 93      (list
 94        quebex
 95        quebex-syntax
 96        ghc-tasty
 97        ghc-tasty-hunit
 98        ghc-tasty-golden
 99        ghc-tasty-quickcheck
100        ghc-simple-smt))
101    (synopsis "Symbolic executor for the QBE intermediate language")
102    (description "")
103    (home-page "https://git.8pit.net/quebex")
104    (license (list license:expat license:gpl3))))
105
106(define-public quebex-cli
107  (package
108    (name "quebex-cli")
109    (version "0.1.0.0")
110    (source (local-file (string-append %srcdir "/quebex-cli")
111                        "git-checkout"
112                        #:recursive? #t))
113    (build-system haskell-build-system)
114    (inputs (list ghc-9.2))
115    (native-inputs
116      (list
117        quebex
118        quebex-syntax
119        quebex-symex
120        ghc-optparse-applicative))
121    (synopsis "Command line utilities for Quebex")
122    (description "")
123    (home-page "https://git.8pit.net/quebex")
124    (license (list license:gpl3))))