From patchwork Fri Sep 2 15:23:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Garek Dyszel X-Patchwork-Id: 42148 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 0DFD627BBEA; Fri, 2 Sep 2022 16:28:13 +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=unavailable 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 7B18F27BBE9 for ; Fri, 2 Sep 2022 16:28:12 +0100 (BST) Received: from localhost ([::1]:45652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oU8aZ-0001wz-Ll for patchwork@mira.cbaines.net; Fri, 02 Sep 2022 11:28:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oU8aQ-0001sT-1X for guix-patches@gnu.org; Fri, 02 Sep 2022 11:28:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57725) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oU8aP-00079n-OY for guix-patches@gnu.org; Fri, 02 Sep 2022 11:28:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oU8aP-00082c-KO for guix-patches@gnu.org; Fri, 02 Sep 2022 11:28:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57540] [PATCH 3/6] gnu: Add coq-elpi. 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: Fri, 02 Sep 2022 15:28:01 +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.166213242630802 (code B ref 57540); Fri, 02 Sep 2022 15:28:01 +0000 Received: (at 57540) by debbugs.gnu.org; 2 Sep 2022 15:27:06 +0000 Received: from localhost ([127.0.0.1]:47470 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oU8ZV-00080k-RA for submit@debbugs.gnu.org; Fri, 02 Sep 2022 11:27:06 -0400 Received: from knopi.disroot.org ([178.21.23.139]:38318) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oU8ZT-00080b-TM for 57540@debbugs.gnu.org; Fri, 02 Sep 2022 11:27:04 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 41F324A034 for <57540@debbugs.gnu.org>; Fri, 2 Sep 2022 17:27:03 +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 UTF8SMTP id Rl_crPi7tJ6y for <57540@debbugs.gnu.org>; Fri, 2 Sep 2022 17:27:01 +0200 (CEST) Mime-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1662132183; bh=xLsE0++1plJqBOMf1U9BiTQLH7JqPn6HbYfGMquD+js=; h=Date:From:To:Subject; b=khPyUt/ZvYkIvuYp4J/4AgchBnJ5EHuurfgGK4oTss9IIF5ThGbJOOq6CYLkxGlbs BbWIn0nh0wQNSiSPeL6wvBApRiPpirNsO4QJEo+yzLqSWMlcbKFBwXP20NOdKdE5LA jPnfclY9zJhJ6zXp0vUgmEfme7hSosw0sZ2TYJN99zyn6TQy0hxFEyy5Tx1QmsCYDs rtrTCxImLRJA7nr4+BeTuSZzgQp3PQCUG9xan4stIRgmThyWTs+gSkz/20J3QA61QS TuWxgwMuRTtlhkMRIjLAmlKgS7McxGDwoo6iHFvUUkD2l5QMirJNzE6f/WsKW/onkp antAomnzuhrJA== Date: Fri, 02 Sep 2022 11:23:02 -0400 Message-ID: <3f2ba54de977b831ef53b6903ccf931f@disroot.org> X-Sender: garekdyszel@disroot.org 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) --- gnu/packages/coq.scm | 74 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) +`{{nat}}` is expanded to the type name of natural numbers, or `{{A -> +B}}` to the representation of a product by unfolding the `->` +notation. Finally it provides a way to define new vernacular commands +and new tactics.") + (license license:lgpl2.1))) diff --git a/gnu/packages/coq.scm b/gnu/packages/coq.scm index bbb34df..5a37432 100644 --- a/gnu/packages/coq.scm +++ b/gnu/packages/coq.scm @@ -685,3 +685,77 @@ (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) + (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. + ;; It does not affect + ;; the success of compliation. + (invoke "sed" "-i" "s|src/META.coq-elpi||g" + "_CoqProject") + #t)) + (replace 'check + (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-1.15 + 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.