From patchwork Mon May 9 23:35:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Langlois X-Patchwork-Id: 39193 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 91E1627BBEA; Tue, 10 May 2022 00:36:52 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable 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 6137827BBE9 for ; Tue, 10 May 2022 00:36:51 +0100 (BST) Received: from localhost ([::1]:47098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1noCvq-0001HN-JK for patchwork@mira.cbaines.net; Mon, 09 May 2022 19:36:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1noCv6-0000Fs-Bo for guix-patches@gnu.org; Mon, 09 May 2022 19:36:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37625) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1noCv6-0001Ss-0T for guix-patches@gnu.org; Mon, 09 May 2022 19:36:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1noCv5-0003z1-Uq for guix-patches@gnu.org; Mon, 09 May 2022 19:36:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#52790] [PATCH v3 7/7] gnu: docker: Switch to gexp and new input style. Resent-From: Pierre Langlois Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 09 May 2022 23:36:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52790 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52790@debbugs.gnu.org Cc: Pierre Langlois Received: via spool by 52790-submit@debbugs.gnu.org id=B52790.165213934415232 (code B ref 52790); Mon, 09 May 2022 23:36:03 +0000 Received: (at 52790) by debbugs.gnu.org; 9 May 2022 23:35:44 +0000 Received: from localhost ([127.0.0.1]:59749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1noCuk-0003xW-FR for submit@debbugs.gnu.org; Mon, 09 May 2022 19:35:43 -0400 Received: from mout.gmx.net ([212.227.17.20]:35955) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1noCub-0003vy-Tb for 52790@debbugs.gnu.org; Mon, 09 May 2022 19:35:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1652139328; bh=T7UvKtpyEWBjUIFQvSshKc6kmRtmWLSIjnKG2efdJFs=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=CEdVoWXYL0Uz9hhFp9rtt51JyRjMBp/VYv1Kofgrb5mIOVlo1DkXW42n7n8z2R7XO 1PL8SQ73F6r/YOwpwEVz5XpXY4hwyJyFfNVt6w3X9jczzEbGcgBBUXJrNkJBehDglo fkyvxdK19CT81Uv/3ZD+ed751T5HGW2JNMhWfW2s= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([82.69.64.142]) by mail.gmx.net (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MsHnm-1o46CL41n8-00tkK9; Tue, 10 May 2022 01:35:28 +0200 From: Pierre Langlois Date: Tue, 10 May 2022 00:35:19 +0100 Message-Id: <20220509233519.26703-7-pierre.langlois@gmx.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220509233519.26703-1-pierre.langlois@gmx.com> References: <87wneu1dyz.fsf@gmx.com> <20220509233519.26703-1-pierre.langlois@gmx.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:WK6eTdUXRrjGeNloaIOGSOaFWhYOh6Yd3YvoojPKl99QSgpkGZx scniUEoequtpQv1D2ClZXT/JR/QJ+eZwlsLr5kMqVTrqF+FClF7Na/o5gHLfwbk68XhnGLt Oc0XOLU7j8/X03e4ysftzyDsleRhw9aH+MmgaFS15rmYja33nCQHjbclJS6cG8ueYdPlHcd Ag3+22d8Pem7mqtorYCMg== X-UI-Out-Filterresults: notjunk:1;V03:K0:2VhmABSr5dM=:QmSB25rArL3Pbl8032uhTp nQo/O75qeNf2VK9BSIj35/PQjToinj8Cp9WsWACu/P+tulTfwj9bFPz4nh0PurFu/WyNf2Ztv eshrERJIYKTMNxsig0lL/oKLP9ExcmcHBfS1aRC1txtm9mAT6h7uz0KfI8AI2/ItFmWctouvv GoI/V0kXL2f7vdjs/GwnFcQOwddIg177hybyap8MjXOwsoLxDe4zO/rT7N7S5Y4Wt3jBxiCul 9NJai04H3aWySqroeOHcJDG3gIV+8bQu4ZQAT1ZCYlbEUInw9qla/+PSekwmGdJf6IfCniKbv w7TgX+BqpXARUJWUtV6tC07k7xCe0yQzn+EuHKdQfo30pmTf2dviulBlx7ao9AkUygToouxPw 7Ww8R+EV7Hi7jE9PtqRD2dxH3U8cZfDyfxyk8oHo1LGP5g2Y75jK+KgAKll9Yav0eKimQ2G5h VAaK1AfWhj+F5WuFAJmgcqWBsbH3L3Urr6jlfjFe4VMpdBhJz5vtvtxDyViz0by6Q3ESiwson Hd+JPDk82ZlyP93hEcY2fASMfZLmlhTl/OLT/UfXxZSO91GWfuRF+2lqXGGFwxNvYMvu+IsBn 1Tvigluk3C6nf+yGQ/G6fSJF/vIkx67QjkLL4eJRtFqQPG962UvBz+Oy9xqKUyuOLWJzkoXPC Ty7hQXPeSMsiGZ5dUNbzRO/ELF5jwAKOHUM7ktWWr5PPD7Upw1QUr7qAbhwMKB6dS0V6q6++8 oFBGiHeArKbSIai5h/i0KJ0kxgmOevjLpUe7QTPtqNzE/Hqv98tTeak32lOHzYcfV7e5NWjkt XrFSxmiheYkIMMeij292djOLab5u6K4FYkjuxWZmz6MZpwBUoXRwbQfhb5MlIOJs2doqDuuXv cCm8pGGVUj59VxCQmV75SVYoO5cndbVQLif/3/4E5OXsx+5a6uRWKXEol3KsF01M7tSzYNlFT wNqVOIVyHtcylfHWvHF+JzB5RgjbWC+2JC8lBMcPcmGsjDyY0Att9dpkD1XbSnGIIG7pnUXr3 UYKCqJbFZHiHmRWaj+0UG+l054SZ6Q+D19wW7ILfUKhwq1JoSR36RFAiNAxYWhcBMj7nFqVf8 haZhecJzay9J2c= 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" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/docker.scm (docker)[arguments]: Rewrite as gexps. Switch to using search-input-file. [inputs]: Use new style inputs. --- gnu/packages/docker.scm | 483 ++++++++++++++++++++-------------------- 1 file changed, 241 insertions(+), 242 deletions(-) -- 2.36.0 diff --git a/gnu/packages/docker.scm b/gnu/packages/docker.scm index a3d3e5fb51..2df4cdb98a 100644 --- a/gnu/packages/docker.scm +++ b/gnu/packages/docker.scm @@ -326,260 +326,259 @@ (define-public docker (base32 "1z816496aqla4nq0aksf0kpy8qk8x1a6y5hrazzkqliycbjnqizq")))) (build-system gnu-build-system) (arguments - `(#:modules - ((guix build gnu-build-system) + (list + #:modules + '((guix build gnu-build-system) ((guix build go-build-system) #:prefix go:) (guix build union) (guix build utils)) - #:imported-modules - (,@%gnu-build-system-modules + #:imported-modules + `(,@%gnu-build-system-modules (guix build union) (guix build go-build-system)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'patch-paths - (lambda* (#:key inputs #:allow-other-keys) - (substitute* "builder/builder-next/executor_unix.go" - (("CommandCandidates:.*runc.*") - (string-append "CommandCandidates: []string{\"" - (assoc-ref inputs "runc") - "/sbin/runc\"},\n"))) - (substitute* "vendor/github.com/containerd/go-runc/runc.go" - (("DefaultCommand = .*") - (string-append "DefaultCommand = \"" - (assoc-ref inputs "runc") - "/sbin/runc\"\n"))) - (substitute* "vendor/github.com/containerd/containerd/runtime/v1/linux/runtime.go" - (("defaultRuntime[ \t]*=.*") - (string-append "defaultRuntime = \"" - (assoc-ref inputs "runc") - "/sbin/runc\"\n")) - (("defaultShim[ \t]*=.*") - (string-append "defaultShim = \"" - (assoc-ref inputs "containerd") - "/bin/containerd-shim\"\n"))) - (substitute* "daemon/daemon_unix.go" - (("DefaultShimBinary = .*") - (string-append "DefaultShimBinary = \"" - (assoc-ref inputs "containerd") - "/bin/containerd-shim\"\n")) - (("DefaultRuntimeBinary = .*") - (string-append "DefaultRuntimeBinary = \"" - (assoc-ref inputs "runc") - "/sbin/runc\"\n"))) - (substitute* "daemon/runtime_unix.go" - (("defaultRuntimeName = .*") - (string-append "defaultRuntimeName = \"" - (assoc-ref inputs "runc") - "/sbin/runc\"\n"))) - (substitute* "daemon/config/config.go" - (("StockRuntimeName = .*") - (string-append "StockRuntimeName = \"" - (assoc-ref inputs "runc") - "/sbin/runc\"\n")) - (("DefaultInitBinary = .*") - (string-append "DefaultInitBinary = \"" - (assoc-ref inputs "tini") - "/bin/tini-static\"\n"))) - (substitute* "daemon/config/config_common_unix_test.go" - (("expectedInitPath: \"docker-init\"") - (string-append "expectedInitPath: \"" - (assoc-ref inputs "tini") - "/bin/tini-static\""))) - (substitute* "vendor/github.com/moby/buildkit/executor/runcexecutor/executor.go" - (("var defaultCommandCandidates = .*") - (string-append "var defaultCommandCandidates = []string{\"" - (assoc-ref inputs "runc") "/sbin/runc\"}"))) - (substitute* "vendor/github.com/docker/libnetwork/portmapper/proxy.go" - (("var userlandProxyCommandName = .*") - (string-append "var userlandProxyCommandName = \"" - (assoc-ref inputs "docker-proxy") - "/bin/proxy\"\n"))) - (substitute* "pkg/archive/archive.go" - (("string\\{\"xz") - (string-append "string{\"" (assoc-ref inputs "xz") "/bin/xz"))) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-paths + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "builder/builder-next/executor_unix.go" + (("CommandCandidates:.*runc.*") + (string-append "CommandCandidates: []string{\"" + (search-input-file inputs "/sbin/runc") + "\"},\n"))) + (substitute* "vendor/github.com/containerd/go-runc/runc.go" + (("DefaultCommand = .*") + (string-append "DefaultCommand = \"" + (search-input-file inputs "/sbin/runc") + "\"\n"))) + (substitute* "vendor/github.com/containerd/containerd/runtime/v1/linux/runtime.go" + (("defaultRuntime[ \t]*=.*") + (string-append "defaultRuntime = \"" + (search-input-file inputs "/sbin/runc") + "\"\n")) + (("defaultShim[ \t]*=.*") + (string-append "defaultShim = \"" + (search-input-file inputs "/bin/containerd-shim") + "\"\n"))) + (substitute* "daemon/daemon_unix.go" + (("DefaultShimBinary = .*") + (string-append "DefaultShimBinary = \"" + (search-input-file inputs "/bin/containerd-shim") + "\"\n")) + (("DefaultRuntimeBinary = .*") + (string-append "DefaultRuntimeBinary = \"" + (search-input-file inputs "/sbin/runc") + "\"\n"))) + (substitute* "daemon/runtime_unix.go" + (("defaultRuntimeName = .*") + (string-append "defaultRuntimeName = \"" + (search-input-file inputs "/sbin/runc") + "\"\n"))) + (substitute* "daemon/config/config.go" + (("StockRuntimeName = .*") + (string-append "StockRuntimeName = \"" + (search-input-file inputs "/sbin/runc") + "\"\n")) + (("DefaultInitBinary = .*") + (string-append "DefaultInitBinary = \"" + (search-input-file inputs "/bin/tini-static") + "\"\n"))) + (substitute* "daemon/config/config_common_unix_test.go" + (("expectedInitPath: \"docker-init\"") + (string-append "expectedInitPath: \"" + (search-input-file inputs "/bin/tini-static") + "\""))) + (substitute* "vendor/github.com/moby/buildkit/executor/runcexecutor/executor.go" + (("var defaultCommandCandidates = .*") + (string-append "var defaultCommandCandidates = []string{\"" + (search-input-file inputs "/sbin/runc") "\"}"))) + (substitute* "vendor/github.com/docker/libnetwork/portmapper/proxy.go" + (("var userlandProxyCommandName = .*") + (string-append "var userlandProxyCommandName = \"" + (search-input-file inputs "/bin/proxy") + "\"\n"))) + (substitute* "pkg/archive/archive.go" + (("string\\{\"xz") + (string-append "string{\"" (search-input-file inputs "/bin/xz")))) - (let ((source-files (filter (lambda (name) - (not (string-contains name "test"))) - (find-files "." "\\.go$")))) - (let-syntax ((substitute-LookPath* - (syntax-rules () - ((_ (source-text package relative-path) ...) - (substitute* source-files - (((string-append "\\ isn't found. ;; FIXME: We might need to package buildkit and docker's ;; buildx plugin, to support qemu-based docker containers. - (("\\ .pc) go gotestsum pkg-config))