From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id wOUdKCVynGMTzgAAbAwnHQ (envelope-from ) for ; Fri, 16 Dec 2022 14:27:01 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 4MBFKCVynGMuTQEA9RJhRA (envelope-from ) for ; Fri, 16 Dec 2022 14:27:01 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4F8EA1CCCF for ; Fri, 16 Dec 2022 14:27:01 +0100 (CET) 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 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1671197221; a=rsa-sha256; cv=none; b=sFVS7EBmf9kac0I5J4x1GiUW0rW/Ghs40/GPMcIo5nzxgNJaXIXzwSKNhTPhEssxsfayiR F4+BxNO5kLVIZNvSIaAMZGemspHshfpMnqRMiiBEjVqLuwSZaOlwWcUkkgUpYuePGYhJ+Q axRYsYkhYnsxHU0DRzJX7mCSOFFz2Y7LCmJKUfmlyuYp1AQNiwpJyqowxQjYU9yazz5sfP ItLv1EvbuBd98aI3zI54eOc/3s5W5JtgBMIuQWDXL3zhPyZW5RB8ujFhkkGb2dAfpU/UKR sFcwq90X7aNKilly9ZINYzzysorDU2oZ+UE/agffx0mU8gB7e7Xs5NDVC4hTXw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=NjADmQ+6; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1671197221; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=e6Krz5FrhKq1UXCKhJR4zjQKKLXpTYbKd8Usp/QHCyU=; b=pkpR5VO1zbXkhG85n7iTiFkmmS8r/tLstmbrZwLuzhsxY1i+eEGMQlXX3xF4eKpAs3VStG 5Kpqw157Ye+gsnAPtzprxAX8fcdj4fhk8E2iWf0OvYcDsCr5H/+DFaLxOt4wZkYKFss2kf 8oh4ilaHxNMp090SAKKsdemy6bXbYVd4Vn0zbwHaocZF5CXfAw5KPXATXkrEgC826HQsGX G7IshwKLQ/KcwhFq/BiRpO0NJWR8Y1ZlTF2bTQQJU11ZPoc/VwyMEOOY1XyYAMMfR5mvNw iLLe1+dlUj6ypHaPNfqhXVGWh2sXGnHQ96rwAFloijGN5PfIWa2mkoT6M2YNhg== X-Migadu-Spam-Score: 7.33 X-Spam-Score: 7.33 X-Migadu-Queue-Id: 4F8EA1CCCF X-Migadu-Spam: Yes X-Spam: Yes Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=NjADmQ+6; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none) X-Migadu-Scanner: scn1.migadu.com X-TUID: BvdX/Lqhsp+m * 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)) -- 2.38.1