From patchwork Wed Sep 7 18:33:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Garek Dyszel X-Patchwork-Id: 42277 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0221627BBEC; Wed, 7 Sep 2022 19:35:07 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4DA6A27BBE9 for ; Wed, 7 Sep 2022 19:35:06 +0100 (BST) Received: from localhost ([::1]:53788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oVztB-0005Lm-Ai for patchwork@mira.cbaines.net; Wed, 07 Sep 2022 14:35:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56458) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oVzsB-0004ff-HH for guix-patches@gnu.org; Wed, 07 Sep 2022 14:34:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39296) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oVzsB-0005Fq-7a for guix-patches@gnu.org; Wed, 07 Sep 2022 14:34:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oVzsB-0007yi-2W for guix-patches@gnu.org; Wed, 07 Sep 2022 14:34:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57540] [RFC PATCH v2 04/19] gnu: Add coq-elpi.* gnu/packages/coq.scm (coq-elpi): New variable. References: <79d544f7d8ba64b631a6f0f1d2ef0b08@disroot.org> In-Reply-To: <79d544f7d8ba64b631a6f0f1d2ef0b08@disroot.org> Resent-From: Garek Dyszel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 07 Sep 2022 18:34:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57540 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57540@debbugs.gnu.org Received: via spool by 57540-submit@debbugs.gnu.org id=B57540.166257561730562 (code B ref 57540); Wed, 07 Sep 2022 18:34:03 +0000 Received: (at 57540) by debbugs.gnu.org; 7 Sep 2022 18:33:37 +0000 Received: from localhost ([127.0.0.1]:56211 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oVzrk-0007wq-BL for submit@debbugs.gnu.org; Wed, 07 Sep 2022 14:33:36 -0400 Received: from knopi.disroot.org ([178.21.23.139]:44916) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oVzri-0007wj-Mt for 57540@debbugs.gnu.org; Wed, 07 Sep 2022 14:33:35 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 2519E40143 for <57540@debbugs.gnu.org>; Wed, 7 Sep 2022 20:33:34 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pFg9SNe1mnNz for <57540@debbugs.gnu.org>; Wed, 7 Sep 2022 20:33:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1662575611; bh=9hdvu8SoSfKBRc8s0Z7w+m5qGLkLMKWU7xm0RjbJafk=; h=From:To:Subject:Date; b=ht9Lbiho5hvF3cN59EYFrssx2kS4DgPRWX4vsVjZKeg58dDgI1B+eIwblKt24qW1/ Tn/1Ae/oClc8AmXuLuriVzoyIGnIqvtw+vrVJXXuf22JHvFojPJ1JaJbPXSe2RBfsl Zad3xu06q/qENTnHHZ2a1snDLuUXcHnjPoTrKsoHUzGxeA7tTU3jd89R74r8hQn3O7 GTerRi1mopOYw2ANG+USzI8/2d2G8PN6s4ZwAisDKSkWwf+gcRQ/rd4nHBfF5sVG0K DxgrC2Q3Z8L25+ewxPPXjLH4mrU2whdRUQj2OuD9cqICsPFWpr1o+KteGHfkoSWSau 2ibjdm29Oq8Kw== Date: Wed, 07 Sep 2022 14:33:27 -0400 Message-ID: <87o7vrvxu0.fsf@disroot.org> Mime-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Garek Dyszel X-ACL-Warn: , Garek Dyszel via Guix-patches X-Patchwork-Original-From: Garek Dyszel via Guix-patches via From: Garek Dyszel X-getmail-retrieved-from-mailbox: Patches * gnu/packages/coq.scm (coq-elpi): New variable. --- gnu/packages/coq.scm | 79 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/gnu/packages/coq.scm b/gnu/packages/coq.scm index bbb34df27d..5ae5392db4 100644 --- a/gnu/packages/coq.scm +++ b/gnu/packages/coq.scm @@ -8,6 +8,7 @@ ;;; Copyright © 2020 Robin Green ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021 Simon Tournier +;;; Copyright © 2022 Garek Dyszel ;;; ;;; This file is part of GNU Guix. ;;; @@ -685,3 +686,81 @@ (define-public coq-stdpp @end itemize") (home-page "https://gitlab.mpi-sws.org/iris/stdpp") (license license:bsd-3))) + +(define-public coq-elpi + (package + (name "coq-elpi") + ;; For more information on which version works with Coq 8.15, + ;; see the relevant issue: + ;; https://github.com/math-comp/hierarchy-builder/issues/297 + ;; Here we use + ;; coq-elpi 1.14.0 + ocaml-elpi 1.15.2 + + ;; coq-mathcomp-hierarchy-builder 1.3.0 (Coq 8.15) + (version "1.14.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/LPCIC/coq-elpi") + (commit (string-append "v" version)) + (recursive? #t))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1v2p5dlpviwzky2i14cj7gcgf8cr0j54bdm9fl5iz1ckx60j6nvp")))) + (build-system gnu-build-system) + (outputs '("out")) + (arguments + `(#:make-flags ,#~(list (string-append "COQBIN=" + #$(this-package-input "coq-core") + "/bin/") + (string-append "ELPIDIR=" + #$(this-package-input "ocaml-elpi") + "/lib/ocaml/site-lib/elpi") + (string-append "COQMF_COQLIB=" + (assoc-ref %outputs "out") + "/lib/ocaml/site-lib/coq") + (string-append "COQLIBINSTALL=" + (assoc-ref %outputs "out") + "/lib/coq/user-contrib")) + + #:phases (modify-phases %standard-phases + (delete 'configure) + (add-before 'build 'remove-extra-src-file + (lambda* (#:key outputs #:allow-other-keys) + ;; Remove the useless line "src/META.coq-elpi" + ;; in file _CoqProject. The file + ;; src/META.coq-elpi does not exist in the + ;; repository, so this line inhibits compilation + ;; unnecessarily. + (invoke "sed" "-i" "s|src/META.coq-elpi||g" + "_CoqProject"))) + (replace 'check + ;; Error when running the "check" phase: + ;; "make: *** No rule to make target 'check'. + ;; Stop." + ;; Tests run if we invoke "make test" instead. + (lambda* (#:key tests? make-flags #:allow-other-keys) + (when tests? + (apply invoke "make" "test" make-flags))))))) + (inputs (list python)) + (propagated-inputs (list ocaml + ocaml-stdlib-shims + ocaml-elpi + ocaml-zarith + coq-core + coq-stdlib)) + (home-page "https://github.com/LPCIC/coq-elpi") + (synopsis "Elpi extension language for Coq") + (description + "Coq-elpi provides a Coq plugin that embeds ELPI. It also +provides a way to embed Coq's terms into λProlog using the +Higher-Order Abstract Syntax approach and a way to read terms back. +In addition to that it exports to ELPI a set of Coq's primitives, e.g. +printing a message, accessing the environment of theorems and data +types, defining a new constant and so on. For convenience it also +provides a quotation and anti-quotation for Coq's syntax in λProlog. +E.g. @code{{{nat}}} is expanded to the type name of natural numbers, +or @code{{{A -> B}}} to the representation of a product by unfolding +the @code{->} notation. Finally it provides a way to define new +vernacular commands and new tactics.") + (license license:lgpl2.1)))