From patchwork Fri Dec 16 13:25:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: pukkamustard X-Patchwork-Id: 45355 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 ABA0E27BBEB; Fri, 16 Dec 2022 13:27:03 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,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 5C8BE27BBE9 for ; Fri, 16 Dec 2022 13:27:01 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6Aj0-0005mb-Ic; Fri, 16 Dec 2022 08:26:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6Aiz-0005kL-3F for guix-patches@gnu.org; Fri, 16 Dec 2022 08:26:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6Aiy-00078f-4g for guix-patches@gnu.org; Fri, 16 Dec 2022 08:26:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p6Aix-000340-VU for guix-patches@gnu.org; Fri, 16 Dec 2022 08:26:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60120] [PATCH 04/28] guix: ocaml: Add package-with-ocaml5.0. Resent-From: pukkamustard Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 16 Dec 2022 13:26:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60120 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60120@debbugs.gnu.org Cc: pukkamustard Received: via spool by 60120-submit@debbugs.gnu.org id=B60120.167119714911602 (code B ref 60120); Fri, 16 Dec 2022 13:26:03 +0000 Received: (at 60120) by debbugs.gnu.org; 16 Dec 2022 13:25:49 +0000 Received: from localhost ([127.0.0.1]:49266 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6Aii-000313-Ox for submit@debbugs.gnu.org; Fri, 16 Dec 2022 08:25:49 -0500 Received: from mout02.posteo.de ([185.67.36.66]:34775) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6Aif-00030A-F7 for 60120@debbugs.gnu.org; Fri, 16 Dec 2022 08:25:46 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id EFEAE240104 for <60120@debbugs.gnu.org>; Fri, 16 Dec 2022 14:25:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1671197140; bh=8ghdtStnUTA0RfbRevqJzCuyge0QcVg6IJhP6cCQ/cA=; h=From:To:Cc:Subject:Date:From; b=NjADmQ+6niLqlG2aitbjSrmbcBg1m3b0pAk2IrLPLjumihboP8M0lK8tWmFhpjiFS vrb7aruUNaM8U+08jnDz44CEw1+HPq+48OLei2MaEJxFUbxUKdTrzNgES6VGG06RhV 3W1ycAGOjTi81TxgsY9VCweh/btl1xt2YPGkQLYHqjd6e6OBUKhYJru3V7jN4m3OqR uWJham6AvEnV0ceComLrA+o1X+MBon7ytPSQcpwbN6eScW3oBlfxnRYeaUfDEisrvZ 1qBBb97YF+fW2UJSDDBu3qDBqFf0qVpg5cyNmRuA4h0LXbhMUpqbJANSW9DZd6kdYC Ir1mAYL6B/8ig== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NYVGW32tpz6tmq; Fri, 16 Dec 2022 14:25:39 +0100 (CET) From: pukkamustard Date: Fri, 16 Dec 2022 13:25:03 +0000 Message-Id: <20221216132527.2539-4-pukkamustard@posteo.net> In-Reply-To: <20221216132527.2539-1-pukkamustard@posteo.net> References: <20221216132224.2229-1-pukkamustard@posteo.net> <20221216132527.2539-1-pukkamustard@posteo.net> 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/build-system/ocaml.scm (package-with-ocaml5.0) (strip-ocaml5.0-variant): New variables. * gnu/packages/ocaml.scm (ocaml5.0-dune-bootstrap) (ocaml5.0-dune, ocaml5.0-dune-configurator) (ocaml5.0-csexp, ocaml5.0-result): New variables. --- gnu/packages/ocaml.scm | 51 ++++++++++++++++++++++++++++++++++--- guix/build-system/ocaml.scm | 27 ++++++++++++++++++++ 2 files changed, 75 insertions(+), 3 deletions(-) diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm index e8f64915d9..605baa801d 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -1819,6 +1819,9 @@ (define dune-bootstrap (define ocaml4.09-dune-bootstrap (package-with-ocaml4.09 dune-bootstrap)) +(define ocaml5.0-dune-bootstrap + (package-with-ocaml5.0 dune-bootstrap)) + (define-public dune-configurator (package (inherit dune-bootstrap) @@ -1839,7 +1842,8 @@ (define-public dune-configurator (delete-file-recursively "vendor/pp")))))) (propagated-inputs (list ocaml-csexp)) - (properties `((ocaml4.09-variant . ,(delay ocaml4.09-dune-configurator)))) + (properties `((ocaml4.09-variant . ,(delay ocaml4.09-dune-configurator)) + (ocaml5.0-variant . ,(delay ocaml5.0-dune-configurator)))) (synopsis "Dune helper library for gathering system configuration") (description "Dune-configurator is a small library that helps writing OCaml scripts that test features available on the system, in order to generate @@ -1864,13 +1868,25 @@ (define-public ocaml4.09-dune-configurator (propagated-inputs `(("ocaml-csexp" ,ocaml4.09-csexp))))) +(define-public ocaml5.0-dune-configurator + (package + (inherit dune-configurator) + (name "ocaml5.0-dune-configurator") + (arguments + `(,@(package-arguments dune-configurator) + #:dune ,ocaml5.0-dune-bootstrap + #:ocaml ,ocaml-5.0 + #:findlib ,ocaml5.0-findlib)) + (propagated-inputs (list ocaml5.0-csexp)))) + (define-public dune (package (inherit dune-bootstrap) (propagated-inputs (list dune-configurator)) (properties `((ocaml4.07-variant . ,(delay ocaml4.07-dune)) - (ocaml4.09-variant . ,(delay ocaml4.09-dune)))))) + (ocaml4.09-variant . ,(delay ocaml4.09-dune)) + (ocaml5.0-variant . ,(delay ocaml5.0-dune)))))) (define-public ocaml4.09-dune (package @@ -1892,6 +1908,12 @@ (define-public ocaml4.07-dune (base32 "0l4x0x2fz135pljv88zj8y6w1ninsqw0gn1mdxzprd6wbxbyn8wr")))))) +(define-public ocaml5.0-dune + (package + (inherit ocaml5.0-dune-bootstrap) + (propagated-inputs + (list ocaml5.0-dune-configurator)))) + (define-public ocaml-csexp (package (name "ocaml-csexp") @@ -1946,6 +1968,18 @@ (define-public ocaml4.09-csexp (propagated-inputs `(("ocaml-result" ,ocaml4.09-result))))) +(define-public ocaml5.0-csexp + (package + (inherit ocaml-csexp) + (name "ocaml5.0-csexp") + (arguments + `(#:ocaml ,ocaml-5.0 + #:findlib ,ocaml5.0-findlib + ,@(substitute-keyword-arguments (package-arguments ocaml-csexp) + ((#:dune _) ocaml5.0-dune-bootstrap)))) + (propagated-inputs + `(("ocaml-result" ,ocaml5.0-result))))) + (define-public ocaml-migrate-parsetree (package (name "ocaml-migrate-parsetree") @@ -2131,7 +2165,8 @@ (define-public ocaml-result (arguments `(#:test-target "." #:dune ,dune-bootstrap)) - (properties `((ocaml4.09-variant . ,(delay ocaml4.09-result)))) + (properties `((ocaml4.09-variant . ,(delay ocaml4.09-result)) + (ocaml5.0-variant . ,(delay ocaml5.0-result)))) (home-page "https://github.com/janestreet/result") (synopsis "Compatibility Result module") (description "Uses the new result type defined in OCaml >= 4.03 while @@ -2148,6 +2183,16 @@ (define-public ocaml4.09-result #:dune ,ocaml4.09-dune-bootstrap #:ocaml ,ocaml-4.09 #:findlib ,ocaml4.09-findlib)))) + +(define-public ocaml5.0-result + (package + (inherit ocaml-result) + (name "ocaml5.0-result") + (arguments + `(#:test-target "." + #:dune ,ocaml5.0-dune-bootstrap + #:ocaml ,ocaml-5.0 + #:findlib ,ocaml5.0-findlib)))) (define-public ocaml-topkg (package diff --git a/guix/build-system/ocaml.scm b/guix/build-system/ocaml.scm index 5ced9d243b..b08985cd4d 100644 --- a/guix/build-system/ocaml.scm +++ b/guix/build-system/ocaml.scm @@ -32,6 +32,8 @@ (define-module (guix build-system ocaml) strip-ocaml4.07-variant package-with-ocaml4.09 strip-ocaml4.09-variant + package-with-ocaml5.0 + strip-ocaml5.0-variant default-findlib default-ocaml lower @@ -111,6 +113,18 @@ (define (default-ocaml4.09-dune) (let ((module (resolve-interface '(gnu packages ocaml)))) (module-ref module 'ocaml4.09-dune))) +(define (default-ocaml5.0) + (let ((ocaml (resolve-interface '(gnu packages ocaml)))) + (module-ref ocaml 'ocaml-5.0))) + +(define (default-ocaml5.0-findlib) + (let ((module (resolve-interface '(gnu packages ocaml)))) + (module-ref module 'ocaml5.0-findlib))) + +(define (default-ocaml5.0-dune) + (let ((module (resolve-interface '(gnu packages ocaml)))) + (module-ref module 'ocaml5.0-dune))) + (define* (package-with-explicit-ocaml ocaml findlib dune old-prefix new-prefix #:key variant-property) "Return a procedure of one argument, P. The procedure creates a package @@ -199,6 +213,19 @@ (define (strip-ocaml4.09-variant p) (inherit p) (properties (alist-delete 'ocaml4.09-variant (package-properties p))))) +(define package-with-ocaml5.0 + (package-with-explicit-ocaml (delay (default-ocaml5.0)) + (delay (default-ocaml5.0-findlib)) + (delay (default-ocaml5.0-dune)) + "ocaml-" "ocaml5.0-" + #:variant-property 'ocaml5.0-variant)) + +(define (strip-ocaml5.0-variant p) + "Remove the 'ocaml5.0-variant' property from P." + (package + (inherit p) + (properties (alist-delete 'ocaml5.0-variant (package-properties p))))) + (define* (lower name #:key source inputs native-inputs outputs system target (ocaml (default-ocaml))