From patchwork Thu Feb 23 06:56:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zongyuan Li X-Patchwork-Id: 47239 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 E81F016BBF; Thu, 23 Feb 2023 18:55:12 +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.8 required=5.0 tests=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 BCDD316B9D for ; Thu, 23 Feb 2023 18:55:11 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVGjF-0004mK-6d; Thu, 23 Feb 2023 13:54:05 -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 1pVGjC-0004OD-Vu for guix-patches@gnu.org; Thu, 23 Feb 2023 13:54:03 -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 1pVGjC-0003UR-Cx for guix-patches@gnu.org; Thu, 23 Feb 2023 13:54:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pVGjC-0008L4-8L for guix-patches@gnu.org; Thu, 23 Feb 2023 13:54:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61680] [PATCH v2] gnu: podman: Add 'docker' alias script as 'docker' output References: <20230221143401.42099-1-zongyuan.li@c0x0o.me> In-Reply-To: <20230221143401.42099-1-zongyuan.li@c0x0o.me> Resent-From: Zongyuan Li Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 23 Feb 2023 18:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61680 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61680@debbugs.gnu.org Cc: liliana.prikler@gmail.com, zongyuan.li@c0x0o.me Received: via spool by 61680-submit@debbugs.gnu.org id=B61680.167717841732002 (code B ref 61680); Thu, 23 Feb 2023 18:54:02 +0000 Received: (at 61680) by debbugs.gnu.org; 23 Feb 2023 18:53:37 +0000 Received: from localhost ([127.0.0.1]:35314 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVGim-0008K1-LM for submit@debbugs.gnu.org; Thu, 23 Feb 2023 13:53:37 -0500 Received: from mail-40136.proton.ch ([185.70.40.136]:41649) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pV5XQ-0006On-5Y for 61680@debbugs.gnu.org; Thu, 23 Feb 2023 01:57:13 -0500 Date: Thu, 23 Feb 2023 06:56:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c0x0o.me; s=protonmail; t=1677135421; x=1677394621; bh=Tt5LQzUoe0as+G+f2L+fIkQIQOkuzbiDsN6h5gAI3Cs=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=BkeWpeSjyCk9EUjTmJmNmkXQUkMz7JNFeDcietMZie8jlB5U2zO58OP3Mb9LKCCrO 1lqcoaut4wJWq1f7UPPyrTnI6YpVJLVXjZ0RoCsF5SwHPRMuvp1JIgmetcy72+rSLl hr1c44m+Al7TgPPWhFeIx9YhF7pfzvfA+Ul53dJbzFeosRhteD28nm39de3EktvsHf ibYNFAO7SHMzim9tSyrN9L0eGwXvP8OYrBjIk1z0lBAjZIyvy9wYkO/m/qHQPoixZ8 axSLjIW/qZSr97fYFW3KcHFQwMgDKC6Eyb4CJtn2Gk8vGsM2iIf6+pebOm4/5PVP22 4Y3/QuT+Sv3RA== Message-ID: <20230223065633.51256-1-zongyuan.li@c0x0o.me> Feedback-ID: 67462066:user:proton MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 23 Feb 2023 13:53:35 -0500 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: , Reply-to: Zongyuan Li X-ACL-Warn: , Zongyuan Li via Guix-patches X-Patchwork-Original-From: Zongyuan Li via Guix-patches via From: Zongyuan Li 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 Introduces a output named 'docker' in podman package. This output provides a 'docker' alias for podman. Since their cmd interface are identical, this simple script just act the same as 'alias docker=podman', with some additional checks and notification. Changes since v1: * Add more details in commit messages * Revert style format * Add output-synopsis for 'docker' output * gnu/packages/containers.scm: New 'docker' output for podman --- gnu/packages/containers.scm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) -- 2.37.1 (Apple Git-137.1) diff --git a/gnu/packages/containers.scm b/gnu/packages/containers.scm index 272b67c38d..50dfa88421 100644 --- a/gnu/packages/containers.scm +++ b/gnu/packages/containers.scm @@ -327,6 +327,9 @@ (define-public podman (file-name (git-file-name name version)))) (build-system gnu-build-system) + (outputs '("out" "docker")) + (properties + `((output-synopsis "docker" "docker alias for podman"))) (arguments (list #:make-flags @@ -349,7 +352,7 @@ (define-public podman (invoke "make" "localsystem") (invoke "make" "remotesystem")))) (add-after 'unpack 'fix-hardcoded-paths - (lambda _ + (lambda* (#:key outputs #:allow-other-keys) (substitute* (find-files "libpod" "\\.go") (("exec.LookPath[(][\"]slirp4netns[\"][)]") (string-append "exec.LookPath(\"" @@ -365,7 +368,14 @@ (define-public podman (("/usr/local/libexec/cni") (string-append #$(this-package-input "cni-plugins") "/bin")) - (("/usr/bin/crun") (which "crun"))))) + (("/usr/bin/crun") (which "crun"))) + (substitute* "docker" + (("/usr/bin/podman") (string-append (assoc-ref outputs "out") + "/bin/podman"))))) + (add-after 'install 'install-docker + (lambda* (#:key outputs #:allow-other-keys) + (let* ((docker (assoc-ref outputs "docker"))) + (install-file "docker" (string-append docker "/bin")) #t))) (add-after 'install 'install-completions (lambda _ (invoke "make" "install.completions"