From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id SOJfL7Kow2R7YwAASxT56A (envelope-from ) for ; Fri, 28 Jul 2023 13:38:26 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id IIluLrKow2RZnAAAG6o9tA (envelope-from ) for ; Fri, 28 Jul 2023 13:38:26 +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 E3DFB4D453 for ; Fri, 28 Jul 2023 13:38:25 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=Qebhiq58; 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=1690544306; 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=SE6IMMqRUWJ0kXI0S0qB68dfFrmu4K1FoT2zqoMyWVEXuBpeJTeR/60koIW2zrHb7WQ+Q0 XCQt2walHSdgCUOIIX1KVzpe+1ZYIMmZgg4iOR92U2q7YchQ4nhBfXdFZYcW7Yv4VtIc+G e1GnpMiCTNsih7LFbAwKe4Trm4QEQaO7M7gvrtQBP4MUEKubdC6flURQzkBnBZJEt+vULe +3uVJ7x5d/U2ptRaG7auJqHlUNNSEG0k9Gho6CEHlaxDa6OLZnb7fPL7plHuJ4J7Sucaac CXuzw4BZZGcOQMTNBJCoDMOwNwP1UV0heHj/+HooqUxad0FzRZ1UsQVhn10TPw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1690544306; a=rsa-sha256; cv=none; b=TZHWclLjK52ApE22mpML2XvlNdAZx0oLV7yNYRMke9MoNFyXmuGhTEta7SAM+oQgb1nL5M xulBE1SXvyA7ln0vW/tQRYWhekVTil86TJGIbgOMZE6ZVr7TJGS1eWTaoBOD7ur6JuU7kJ DTS7DN9DozEGH6l6t6Bbwor0Xw2fFoSREnWeGjNUFusNc+II1SPkINmJFh5+mb93IFntXu lxgbgSpm8aFM01q4Xd/at6FfDK61Zf7GSMyfLn++J9X9b6HuIL7m1GrVAmqglV7/r6B52D ip50niMRCRsTzrB5CtYhufZwJZ7JnMMQgWo4+iOFjfMVMYpYw8gKHv7f3Y+Umw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=Qebhiq58; 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 1qPLMF-0000tp-E5; Fri, 28 Jul 2023 07:10:07 -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 1qPLMC-0000se-Ki for guix-patches@gnu.org; Fri, 28 Jul 2023 07:10:04 -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 1qPLMB-0008E9-RU for guix-patches@gnu.org; Fri, 28 Jul 2023 07:10:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qPLMB-00007D-MA; Fri, 28 Jul 2023 07:10:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64249] [PATCH ocaml-team v4 7/9] 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: Fri, 28 Jul 2023 11:10:03 +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.1690542548309 (code B ref 64249); Fri, 28 Jul 2023 11:10:03 +0000 Received: (at 64249) by debbugs.gnu.org; 28 Jul 2023 11:09:08 +0000 Received: from localhost ([127.0.0.1]:43852 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPLLH-0008WQ-OO for submit@debbugs.gnu.org; Fri, 28 Jul 2023 07:09:08 -0400 Received: from mout02.posteo.de ([185.67.36.66]:56947) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPLLC-0008UN-Sh for 64249@debbugs.gnu.org; Fri, 28 Jul 2023 07:09:04 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 56BFC240101 for <64249@debbugs.gnu.org>; Fri, 28 Jul 2023 13:08:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1690542537; bh=AE6egnh9p8KeIR9WngIaz7Ysnw6bAepv2pqQJjccwiA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=Qebhiq5833ThcI9Fc9jd3UsvRdqyWBwHJUGKRfdk+dSvKIQt0TaiPR8wJw8g7I4/s NMLVUhT7R4k2jOczf6IhCaW+89ncqN0fzGfdjkrL+NUh/WkoyrmxwpAtSeScsN7Bxo sIIT1n+3RR7LAaL1cF3V6wlPaM/V4RDGgvufiD7EZiXQpvWKloU28pmkdiVEJLdp+J 2sl8tVzOg/LZg02YQHl0C8ZMhpBpfE05WpsQSskGyarCZEM1CerVsgJ90h67k/Ybdl himZXZoH6kmnM3am427Hoi2xSwTKQg0uCU9d9r8hTIOnGmdQ3uQRipY60WLm3UjWBt T3LDwzsM/UqwA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RC4dN6WG5z6ty7; Fri, 28 Jul 2023 13:08:56 +0200 (CEST) From: pukkamustard Date: Fri, 28 Jul 2023 11:08:29 +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-Flow: FLOW_IN X-Migadu-Country: US X-Spam: Yes X-Migadu-Scanner: mx2.migadu.com X-Migadu-Spam-Score: 8.66 X-Spam-Score: 8.66 X-Migadu-Queue-Id: E3DFB4D453 X-Migadu-Spam: Yes X-TUID: HEgExA7udfwN * 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