From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id cCfBEMGEtmR+dAEASxT56A (envelope-from ) for ; Tue, 18 Jul 2023 14:25:37 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id EJ0zEMGEtmSHzwAAauVa8A (envelope-from ) for ; Tue, 18 Jul 2023 14:25:37 +0200 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 C070A51D17 for ; Tue, 18 Jul 2023 14:25:36 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=VNP14kNG; 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=1689683136; 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=t7jU9G/Pl/mWjDt7YKLM3hcfXFhvI36qz0pQA6lDlGw=; b=n9oWMa7cOJZcGkk/m7HXRXnmUEGfGYa3z+NGrvq1MxKypVyTZufcjcZrQLIVhsjrJP0khd GIrUjW/M+rklVQ6rDqsrUvEtoRSJ1sF7YEutG+nLqp7tSkj4njsTXdIwCTLChrFwO2nnZD 0qakk5LfTXB6UtN8W+UATbE7yvGS9TVxVxooh+QG2DmyioC18QyC4OSgsDdkKXzQYWX03m 41Z44g0CuP+RBHXvo85yjwdRUtPSmf4bVpuO0bBNECw1uMaQLmOxNkv1W/9HpOwe7ayhEJ pXJul1TanzV72h4O6agPXsgBPs9XQ6eESgRhdVA73J9j/4YTmZObduMz6ZGg1g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1689683136; a=rsa-sha256; cv=none; b=jk505HMsAA1OqoN/gyGjY13wkJHgwcPZ32B3zZNy//IAkhTSjbZ5IjyQjrM5cZtaA+hZmL mj5KSW/L4sGC31AJD1PDkb8d5Jg9ChO3fREiVbRxCSneP902BkxtlHjLn41x0QjDZNQ7M+ 5AdYzp4bFKe/3nvF/Jyi7nCShMxeK8ovd/bJFX6ZGAxTwg1AuncRnGaid2w4ZEkNBgpdhy cxuPvL8FWeE3BXTq17jGJIbuQo+/ywBuEp34gwcSzmmOM4c1AI+S97HzNpdzwo71FO3jfI 9M9n2CNB8bNex/KHO9lt4k/PtfHO4LCgNCRikH0//b8EmP28WqPxkcvKuGl8SA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=VNP14kNG; 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) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLjlN-0004W0-3C; Tue, 18 Jul 2023 08:25:09 -0400 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 1qLjlJ-0004Sz-7p for guix-patches@gnu.org; Tue, 18 Jul 2023 08:25:05 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qLjlI-0007Yi-N6 for guix-patches@gnu.org; Tue, 18 Jul 2023 08:25:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qLjlI-0002M9-HY; Tue, 18 Jul 2023 08:25:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64249] [PATCH ocaml-team v3 4/6] gnu: opam: Split build into smaller sub-packages. Resent-From: pukkamustard Original-Sender: "Debbugs-submit" Resent-CC: julien@lepiller.eu, pukkamustard@posteo.net, guix-patches@gnu.org Resent-Date: Tue, 18 Jul 2023 12:25:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64249 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64249@debbugs.gnu.org Cc: pukkamustard , Julien Lepiller , pukkamustard X-Debbugs-Original-Xcc: Julien Lepiller , pukkamustard Received: via spool by 64249-submit@debbugs.gnu.org id=B64249.16896831029022 (code B ref 64249); Tue, 18 Jul 2023 12:25:04 +0000 Received: (at 64249) by debbugs.gnu.org; 18 Jul 2023 12:25:02 +0000 Received: from localhost ([127.0.0.1]:51892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLjlB-0002Kr-MR for submit@debbugs.gnu.org; Tue, 18 Jul 2023 08:25:02 -0400 Received: from mout01.posteo.de ([185.67.36.65]:46633) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLjl9-0002KI-KE for 64249@debbugs.gnu.org; Tue, 18 Jul 2023 08:24:56 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 1527E240028 for <64249@debbugs.gnu.org>; Tue, 18 Jul 2023 14:24:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1689683090; bh=AE6egnh9p8KeIR9WngIaz7Ysnw6bAepv2pqQJjccwiA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version: Content-Transfer-Encoding:From; b=VNP14kNGWWEu/lrs0ZjWkgOcMS/naK3MdMm9E76psTMDDmnBpVdviWtw2c4vErCqb Y6kS4OY+r048NOIl/R5Zjw+ds7zxstPfKpgg7afGhJVtSK8YQVv5O1qKL7rUc+liKQ BlQPEXhuVj26yU8ogRgO6dTqaD3kdC4cVscpVDRd6eeQu7mlIwjQ5J5wPehc2XAjvI VjUKcPRdTHKU2vjGUaoWBbS1Z3KYnemm7aF7n0INz2C3CmW++IhOK6FEcrz4b9GtMo kPkNG1rQpf728JZj735/4Hm5jU88VxJ/v3ijDmjr3WE6o4MB9N7D4uM70h0sdHQbij b2ArpMlReQqRw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4R4ynY3YCwz6tyb; Tue, 18 Jul 2023 14:24:49 +0200 (CEST) From: pukkamustard Date: Tue, 18 Jul 2023 12:24:01 +0000 Message-Id: In-Reply-To: References: 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 X-Migadu-Spam-Score: -2.26 X-Spam-Score: -2.26 X-Migadu-Queue-Id: C070A51D17 X-Migadu-Scanner: mx1.migadu.com X-TUID: LL/mRj8mlp1U * gnu/packages/ocaml.scm (opam): Split build into smaller sub-packages. --- gnu/packages/ocaml.scm | 164 +++++++++++++++++++++++++++++++---------- 1 file changed, 125 insertions(+), 39 deletions(-) diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm index d2bc7cc118..0d78f4d864 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -846,9 +846,9 @@ (define-public ocaml-opam-file-format ;; With static-linking exception (license license:lgpl2.1+))) -(define-public opam +(define ocaml-opam-core (package - (name "opam") + (name "ocaml-opam-core") (version "2.1.3") (source (origin (method git-fetch) @@ -860,32 +860,129 @@ (define-public opam (base32 "1mw535zsw7xlvpgwnk1dan76z3f7lh5imlg0s6kdyhfg0iqisjd7")))) (build-system dune-build-system) + (arguments `(#:package "opam-core" + ;; tests are run with the opam package + #:tests? #f + #:phases + (modify-phases %standard-phases + (add-before 'build 'pre-build + (lambda* (#:key inputs make-flags #:allow-other-keys) + (let ((bash (assoc-ref inputs "bash")) + (bwrap (search-input-file inputs "/bin/bwrap"))) + (substitute* "src/core/opamSystem.ml" + (("\"/bin/sh\"") + (string-append "\"" bash "/bin/sh\"")) + (("getconf") + (which "getconf"))))))))) + (propagated-inputs + (list ocaml-graph + ocaml-re + ocaml-cppo)) + (inputs (list bubblewrap)) + (home-page "https://opam.ocamlpro.com/") + (synopsis "Package manager for OCaml") + (description + "OPAM is a tool to manage OCaml packages. It supports multiple +simultaneous compiler installations, flexible package constraints, and a +Git-friendly development workflow.") + ;; The 'LICENSE' file waives some requirements compared to LGPLv3. + (license license:lgpl3))) + +(define ocaml-opam-format + (package + (inherit ocaml-opam-core) + (name "ocaml-opam-format") + (inputs '()) + (propagated-inputs (list ocaml-opam-core + ocaml-opam-file-format + ocaml-re)) + (arguments `(#:package "opam-format" + ;; tests are run with the opam package + #:tests? #f + #:phases %standard-phases)))) + +(define ocaml-opam-repository + (package + (inherit ocaml-opam-core) + (name "ocaml-opam-repository") + (inputs '()) + (propagated-inputs (list ocaml-opam-format)) + (arguments `(#:package "opam-repository" + ;; tests are run with the opam package + #:tests? #f + #:phases %standard-phases)))) + +(define ocaml-opam-state + (package + (inherit ocaml-opam-core) + (name "ocaml-opam-state") + (arguments `(#:package "opam-state" + ;; tests are run with the opam package + #:tests? #f + #:phases + (modify-phases %standard-phases + (add-before 'build 'pre-build + (lambda* (#:key inputs make-flags #:allow-other-keys) + (let ((bwrap (search-input-file inputs "/bin/bwrap"))) + ;; Use bwrap from the store directly. + (substitute* "src/state/shellscripts/bwrap.sh" + (("-v bwrap") (string-append "-v " bwrap)) + (("exec bwrap") (string-append "exec " bwrap)) + ;; Mount /gnu and /run/current-system in the + ;; isolated environment when building with opam. + ;; This is necessary for packages to find external + ;; dependencies, such as a C compiler, make, etc... + (("^add_sys_mounts /usr") + (string-append "add_sys_mounts " + (%store-directory) + " /run/current-system /usr"))))))))) + (inputs (list bubblewrap)) + (propagated-inputs (list ocaml-opam-repository)))) + +(define ocaml-opam-solver + (package + (inherit ocaml-opam-core) + (name "ocaml-opam-solver") + (inputs '()) + (propagated-inputs (list ocaml-opam-format + ocaml-mccs + ocaml-dose3)) + (arguments `(#:package "opam-solver" + ;; tests are run with the opam package + #:tests? #f + #:phases %standard-phases)))) + +(define ocaml-opam-client + (package + (inherit ocaml-opam-core) + (name "ocaml-opam-client") + (arguments `(#:package "opam-client" + ;; tests are run with the opam package + #:tests? #f + #:phases + (modify-phases %standard-phases + (add-before 'build 'pre-build + (lambda* (#:key inputs make-flags #:allow-other-keys) + (let ((bwrap (search-input-file inputs "/bin/bwrap"))) + (substitute* "src/client/opamInitDefaults.ml" + (("\"bwrap\"") (string-append "\"" bwrap "\""))))))))) + (inputs (list bubblewrap)) + (propagated-inputs + (list ocaml-opam-state + ocaml-opam-solver + ocaml-opam-repository + ocaml-re + ocaml-cmdliner)))) + +(define-public opam + (package + (inherit ocaml-opam-core) + (name "opam") + (build-system dune-build-system) (arguments - `(#:phases + `(#:package "opam" + #:phases (modify-phases %standard-phases - (add-before 'build 'pre-build - (lambda* (#:key inputs make-flags #:allow-other-keys) - (let ((bash (assoc-ref inputs "bash")) - (bwrap (search-input-file inputs "/bin/bwrap"))) - (substitute* "src/core/opamSystem.ml" - (("\"/bin/sh\"") - (string-append "\"" bash "/bin/sh\"")) - (("getconf") - (which "getconf"))) - ;; Use bwrap from the store directly. - (substitute* "src/state/shellscripts/bwrap.sh" - (("-v bwrap") (string-append "-v " bwrap)) - (("exec bwrap") (string-append "exec " bwrap)) - ;; Mount /gnu and /run/current-system in the - ;; isolated environment when building with opam. - ;; This is necessary for packages to find external - ;; dependencies, such as a C compiler, make, etc... - (("^add_sys_mounts /usr") - (string-append "add_sys_mounts " - (%store-directory) - " /run/current-system /usr"))) - (substitute* "src/client/opamInitDefaults.ml" - (("\"bwrap\"") (string-append "\"" bwrap "\"")))))) (add-before 'check 'prepare-checks (lambda* (#:key inputs #:allow-other-keys) ;; Opam tests need to run an isolated environment from a writable @@ -966,22 +1063,11 @@ (define-public opam "0j9abisx3ifzm66ci3p45mngmz4f0fx7yd9jjxrz3f8w5jffc9ii")) ("opam-repo-f372039d" ,(opam-repo "f372039db86a970ef3e662adbfe0d4f5cd980701" "0ld7fcry6ss6fmrpswvr6bikgx299w97h0gwrjjh7kd7rydsjdws"))))) - (inputs - (list ocaml ncurses curl bubblewrap ocaml-cmdliner ocaml-dose3 - ocaml-mccs ocaml-opam-file-format ocaml-re)) + (inputs (list ocaml-opam-client)) (properties ;; OPAM is used as a tool and not as a library, we can use the OCaml 4.14 ;; compiled opam until opam is compatible with OCaml 5.0. - `((ocaml5.0-variant . ,(delay opam)))) - (home-page "https://opam.ocamlpro.com/") - (synopsis "Package manager for OCaml") - (description - "OPAM is a tool to manage OCaml packages. It supports multiple -simultaneous compiler installations, flexible package constraints, and a -Git-friendly development workflow.") - - ;; The 'LICENSE' file waives some requirements compared to LGPLv3. - (license license:lgpl3))) + `((ocaml5.0-variant . ,(delay opam)))))) (define-public ocaml-opam-monorepo (package -- 2.40.1