From patchwork Fri Sep 2 15:24:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Garek Dyszel X-Patchwork-Id: 42152 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 71FE127BBEA; Fri, 2 Sep 2022 16:31:49 +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 BFE9427BBE9 for ; Fri, 2 Sep 2022 16:31:48 +0100 (BST) Received: from localhost ([::1]:43222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oU8e3-0005uv-U4 for patchwork@mira.cbaines.net; Fri, 02 Sep 2022 11:31:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46332) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oU8aQ-0001ty-Fa for guix-patches@gnu.org; Fri, 02 Sep 2022 11:28:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57726) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oU8aQ-00079z-74 for guix-patches@gnu.org; Fri, 02 Sep 2022 11:28:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oU8aQ-00082k-2I for guix-patches@gnu.org; Fri, 02 Sep 2022 11:28:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57540] [PATCH 4/6] gnu: Add coq-mathcomp-hierarchy-builder. 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:02 +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.166213247030894 (code B ref 57540); Fri, 02 Sep 2022 15:28:02 +0000 Received: (at 57540) by debbugs.gnu.org; 2 Sep 2022 15:27:50 +0000 Received: from localhost ([127.0.0.1]:47474 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oU8aE-00082D-A6 for submit@debbugs.gnu.org; Fri, 02 Sep 2022 11:27:50 -0400 Received: from knopi.disroot.org ([178.21.23.139]:50068) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oU8aC-000826-Rz for 57540@debbugs.gnu.org; Fri, 02 Sep 2022 11:27:49 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 4B0F049FE8 for <57540@debbugs.gnu.org>; Fri, 2 Sep 2022 17:27:48 +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 vUu1_jsXEIiR for <57540@debbugs.gnu.org>; Fri, 2 Sep 2022 17:27:46 +0200 (CEST) Mime-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1662132244; bh=bKftHjB2e8g573GX22ID6KFy+TVloCkAjNKhbXNj40M=; h=Date:From:To:Subject; b=YbmsRi6jzabmwD8G73KI/2Boym6ts4hcInmNklRpe0Jptc9ZKidC8mK/zu/zS8lY/ zM+j9tEXfy1XHlE44idcICSF0JWMs5cMnNpIJm6544+qxL+PxRJkoCTF1/abubFm1K kAEgVc/7e6c94i/0Eq7vsdT9Lq8tXwmqjnCGahPQd5uLOE4kgQgFe+aLhYukpncV29 wLnYxHonSflhgp4bTM11hKy80CneCHwUrtc1g4fsv21XF2fwlBg6Rymeq8CQQ7d0rp CnE7yyWjK5isCL6wXAnQwbOheOwHF3r6qVjEYPPqm+ICs4wUlpuNRnsYiYUZIyK6Zx WdL8PHllumDYA== Date: Fri, 02 Sep 2022 11:24:04 -0400 Message-ID: <1729554f0ccf90383607cbbcf1be7323@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-mathcomp-hierarchy-builder) --- gnu/packages/coq.scm | 75 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) +canonical structure instances and notations following the packed +classes discipline which is at the core of the Mathematical Components +library. All that complexity is hidden behind a few concepts and a few +declarative Coq commands.") + (home-page "https://math-comp.github.io/") + ;; MIT license + (license license:expat))) diff --git a/gnu/packages/coq.scm b/gnu/packages/coq.scm index 5a37432..bb4788a 100644 --- a/gnu/packages/coq.scm +++ b/gnu/packages/coq.scm @@ -759,3 +759,78 @@ (define-public coq-elpi notation. Finally it provides a way to define new vernacular commands and new tactics.") (license license:lgpl2.1))) + +(define-public coq-mathcomp-hierarchy-builder + (package + (name "coq-mathcomp-hierarchy-builder") + ;; 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.3.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/math-comp/hierarchy-builder") + (commit (string-append "v" version)) + (recursive? #t))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "17k7rlxdx43qda6i1yafpgc64na8br285cb0mbxy5wryafcdrkrc")))) + (build-system gnu-build-system) + (arguments + `(#:make-flags ,#~(list (string-append "COQBIN=" + #$(this-package-input "coq-core") + "/bin/") + (string-append "COQBININSTALL=" + (assoc-ref %outputs "out") "/bin/") + (string-append "DESTDIR=" + (assoc-ref %outputs "out")) + (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) + (replace 'build + (lambda* (#:key make-flags #:allow-other-keys) + (apply invoke "make" "build" make-flags))) + (replace 'check + (lambda* (#:key tests? make-flags #:allow-other-keys) + (when tests? + (apply invoke "make" "test-suite" make-flags))))))) + (inputs (list coq + coq-core + coq-mathcomp + which + ocaml + coq-elpi-1.14 + ocaml-elpi-1.15)) + (synopsis "Hierarchy structures for the Coq proof assistant") + (description + "Hierarchy Builder (HB) provides high level commands to declare a +hierarchy of algebraic structure (or interfaces if you prefer the +glossary of computer science) for the Coq system. + +Given a structure one can develop its theory, and that theory becomes +automatically applicable to all the examples of the structure. One can +also declare alternative interfaces, for convenience or backward +compatibility, and provide glue code linking these interfaces to the +structures part of the hierarchy. + +HB commands compile down to Coq modules, sections, records, coercions,