[bug#33865] gnu: Add dedukti.

Message ID 87y38dwrlt.fsf@gmail.com
State Accepted
Headers show
Series [bug#33865] gnu: Add dedukti. | expand

Checks

Context Check Description
cbaines/applying patch fail Apply failed

Commit Message

Gabriel Hondet Dec. 25, 2018, 3:31 p.m. UTC
* gnu/packages/ocaml.scm (dedukti): New variable.
---
 gnu/packages/ocaml.scm | 58 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

Comments

Julien Lepiller Dec. 25, 2018, 5:50 p.m. UTC | #1
Pushed as 5895696e4c28938d9201e4527d3a007dd8b47e32.

I've slightly modified your patch to add a copyright line for yourself
and use the ocaml-build-system.

Patch

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 3b1ddcb5b..8962a7339 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -4989,3 +4989,61 @@  provides BigN, BigZ, BigQ that used to be part of Coq standard library.")
 simplifying the proofs of inequalities on expressions of real numbers for the
 Coq proof assistant.")
     (license license:cecill-c)))
+
+(define-public dedukti
+  (package
+    (name "dedukti")
+    (version "2.6.0")
+    (home-page "https://deducteam.github.io/")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/deducteam/dedukti.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0frl3diff033i4fmq304b8wbsdnc9mvlhmwd7a3zd699ng2lzbxb"))))
+    (inputs
+     `(("ocaml" ,ocaml)
+       ("menhir" ,ocaml-menhir)))
+    (native-inputs
+     `(("ocamlbuild" ,ocamlbuild)
+       ("ocamlfind" ,ocaml-findlib)))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           ;; Set ocamlfind environment vars
+           (lambda _
+             (let ((out (assoc-ref %outputs "out"))
+                   (libpath "/lib/ocaml/site-lib"))
+               (begin
+                 (setenv "OCAMLFIND_DESTDIR" (string-append out libpath))
+                 (mkdir-p (string-append out libpath "/dedukti"))
+                 (setenv "PREFIX" out)
+                 #t))))
+         (replace 'build
+           (lambda _
+             (invoke "make")))
+         (replace 'check
+           (lambda _
+             (invoke "make" "tests")))
+         (add-before 'install 'set-binpath
+           ;; Change binary path in the makefile
+           (lambda _
+             (let ((out (assoc-ref %outputs "out")))
+               (substitute* "GNUmakefile"
+                 (("BINDIR = (.*)$")
+                  (string-append "BINDIR = " out "/bin")))))))))
+    (synopsis "Proof-checker for the λΠ-calculus modulo theory, an extension of
+the λ-calculus")
+    (description "Dedukti is a proof-checker for the λΠ-calculus modulo
+theory.  The λΠ-calculus is an extension of the simply typed λ-calculus with
+dependent types.  The λΠ-calculus modulo theory is itself an extension of the
+λΠ-calculus where the context contains variable declaration as well as rewrite
+rules.  This system is not designed to develop proofs, but to check proofs
+developed in other systems.  In particular, it enjoys a minimalistic syntax.")
+    (license license:cecill-c)))