From patchwork Tue Mar 12 12:26:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jean-Pierre De Jesus Diaz X-Patchwork-Id: 61692 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 A9C6B27BBE9; Tue, 12 Mar 2024 16:28:27 +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=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,SPF_HELO_PASS, URIBL_BLOCKED autolearn=no 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 E866927BBE2 for ; Tue, 12 Mar 2024 16:28:25 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rk4yZ-0002a4-Pz; Tue, 12 Mar 2024 12:27:40 -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 1rk4yR-0002Y8-MQ for guix-patches@gnu.org; Tue, 12 Mar 2024 12:27:32 -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 1rk4yQ-0001qv-VZ for guix-patches@gnu.org; Tue, 12 Mar 2024 12:27:31 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rk4yz-00005a-FS for guix-patches@gnu.org; Tue, 12 Mar 2024 12:28:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69744] [PATCH 2/2] gnu: distrobox: Fix dependency usage. Resent-From: Jean-Pierre De Jesus DIAZ Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 12 Mar 2024 16:28:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69744 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69744@debbugs.gnu.org Cc: Jean-Pierre De Jesus DIAZ Received: via spool by 69744-submit@debbugs.gnu.org id=B69744.171026085332673 (code B ref 69744); Tue, 12 Mar 2024 16:28:05 +0000 Received: (at 69744) by debbugs.gnu.org; 12 Mar 2024 16:27:33 +0000 Received: from localhost ([127.0.0.1]:43487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rk4yQ-0008Um-3A for submit@debbugs.gnu.org; Tue, 12 Mar 2024 12:27:33 -0400 Received: from mail-wr1-f49.google.com ([209.85.221.49]:53278) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rk1Eb-00047w-Tv for 69744@debbugs.gnu.org; Tue, 12 Mar 2024 08:27:59 -0400 Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-33e1d327595so2338943f8f.2 for <69744@debbugs.gnu.org>; Tue, 12 Mar 2024 05:27:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundation-xyz.20230601.gappssmtp.com; s=20230601; t=1710246377; x=1710851177; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=o4HRGES5gJUbi/tfh0kHUK8n9iv6P+tP0nfD2R+rxtE=; b=bgMbERaFQL6mZjuPhGv+zBeHLa3k5hf/5D5pgV2oXaIYk/PGl/7HTgsLt2SmAQmM0V lEmLq42GiXWsBrmTFM2RBUJHcOzcdrPp2Uum5gr4QkAfqzH94kdDZ5MCY9tsmEp5/ugV N0guQZ3ow+5Tt9Kt0N6jPBjW9Rwf+Px53b31MeUSLiAkDAYIbc21uovLimzM6weRIQyX WiG4yKVEwtCxBoibtw97zz1kWaT8E8MjV7hGjN2CqpAIb/ZInzNRheBqFxdzUI6j6oIB T39XcQne3ImUGpGqTUixfzRDYOQZoiNO5VhfJ8Hx1SbpJKcaN2n3F74CgcC9S1amjSdD RQGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710246377; x=1710851177; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o4HRGES5gJUbi/tfh0kHUK8n9iv6P+tP0nfD2R+rxtE=; b=eVvvUUFwhSAvmhEE7jKz/CHP9rmIDDKRIeyIXa/Q5fu2L9LrYmOWPmsaGEDbhTGXTX mGN/OdSGYvWS5vGnXgFxyqKWzhQAUA1Pb+wegIkxcnib6bw53kVrpd5CKZ8idwbTOMih ImJ3LR3op8YT233j/bheNyZoHxwa01Qk2CUnVWAEOBLHiE9Bgb7OkRKbiKdOfGRHAqJ4 PJGsiPn5hj/4B3HzF0p1aqjbzy8hQCt7ttbSuC9BDkwgGxx2HArhDbyjBVi9zIghUAIA H1YFx9HWJFogsMSKU8fvg0WdEDRk1xVGQSLfQ0xrSg4JAr4qCWyJ6pOa2hBY7OGLJaT7 CDBw== X-Gm-Message-State: AOJu0Yw1QY9y6Hkwr1TonpayU7VqQnfzQhjidkFYMDzLTIskKRamA9NS P+C2KRbPhMujB724ZkkhpojJMxgCrwC+N3rwLOKCoKYTUpU+99aqd0BDFCyGOnk+NtT0jYoSIw1 ds3Q= X-Google-Smtp-Source: AGHT+IExNEwkEmGktejTgqiizY3ujJtXSbQ0kxJxOl5dQaoel0NUD4wMgP7erie7XLG0EoixCGogug== X-Received: by 2002:a05:6000:24f:b0:33e:72be:43ab with SMTP id m15-20020a056000024f00b0033e72be43abmr5032848wrz.24.1710246377635; Tue, 12 Mar 2024 05:26:17 -0700 (PDT) Received: from jeandudey.home ([89.131.29.87]) by smtp.gmail.com with ESMTPSA id q17-20020adffed1000000b0033cf5094fcesm8924692wrs.36.2024.03.12.05.26.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 05:26:17 -0700 (PDT) From: Jean-Pierre De Jesus DIAZ Date: Tue, 12 Mar 2024 13:26:02 +0100 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 12 Mar 2024 12:27:27 -0400 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 * gnu/packages/containers.scm (distrobox): Use WRAP-SCRIPT to patch the scripts to use system wget and podman. Change-Id: Ida9affcb212f64892e85dfa8bc4dd4d59f832f4f --- gnu/packages/containers.scm | 46 ++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/gnu/packages/containers.scm b/gnu/packages/containers.scm index 21bd7e64bc..d93ca04960 100644 --- a/gnu/packages/containers.scm +++ b/gnu/packages/containers.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2023 Zongyuan Li ;;; Copyright © 2023 Ricardo Wurmus ;;; Copyright © 2024 Tomas Volf <~@wolfsden.cz> +;;; Copyright © 2024 Foundation Devices, Inc. ;;; ;;; This file is part of GNU Guix. ;;; @@ -43,6 +44,7 @@ (define-module (gnu packages containers) #:use-module (gnu packages glib) #:use-module (gnu packages gnupg) #:use-module (gnu packages golang) + #:use-module (gnu packages guile) #:use-module (gnu packages linux) #:use-module (gnu packages python) #:use-module (gnu packages networking) @@ -160,20 +162,48 @@ (define-public distrobox (base32 "1g14q1sm3026h9n85v1gc3m2v9sgrac2mr9yrkh98qg5yahzmpc3")) (file-name (git-file-name name version)))) (build-system copy-build-system) - (inputs - (list podman wget)) (arguments (list #:phases #~(modify-phases %standard-phases - (add-before 'install 'refer-to-inputs - (lambda* (#:key inputs #:allow-other-keys) - (substitute* (find-files "." "^distrobox[^.]*[^1]$") - (("podman") (search-input-file inputs "/bin/podman")) - (("wget") (search-input-file inputs "/bin/wget")) - (("command -v") "test -x")))) + ;; Use WRAP-SCRIPT to wrap all of the scripts of distrobox, + ;; excluding the host side ones. + (add-after 'install 'wrap-scripts + (lambda _ + (let ((path (search-path-as-list + (list "bin") + (list #$(this-package-input "podman") + #$(this-package-input "wget"))))) + (for-each (lambda (script) + (wrap-script + (string-append #$output "/bin/distrobox-" + script) + `("PATH" ":" prefix ,path))) + '("assemble" + "create" + "enter" + "ephemeral" + "generate-entry" + "list" + "rm" + "stop" + "upgrade"))))) + ;; These scripts are used in the container side and the + ;; /gnu/store path is not shared with the containers. + (add-after 'patch-shebangs 'unpatch-shebangs + (lambda _ + (for-each (lambda (script) + (substitute* + (string-append #$output "/bin/distrobox-" + script) + (("#!.*/bin/sh") "#!/bin/sh\n"))) + '("export" "host-exec" "init")))) (replace 'install (lambda _ (invoke "./install" "--prefix" #$output)))))) + (inputs + (list guile-3.0 ; for wrap-script + podman + wget)) (home-page "https://distrobox.privatedns.org/") (synopsis "Create and start containers highly integrated with the hosts") (description