From patchwork Wed Dec 22 07:33:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timmy Douglas X-Patchwork-Id: 35578 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 77F8027BBEA; Wed, 22 Dec 2021 07:47:02 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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 39E3B27BBE9 for ; Wed, 22 Dec 2021 07:47:02 +0000 (GMT) Received: from localhost ([::1]:45818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzwKz-0001eh-DE for patchwork@mira.cbaines.net; Wed, 22 Dec 2021 02:47:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzwAM-0005Wc-3x for guix-patches@gnu.org; Wed, 22 Dec 2021 02:36:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44994) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mzwAL-0000Io-OG for guix-patches@gnu.org; Wed, 22 Dec 2021 02:36:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mzwAL-0002t8-MI for guix-patches@gnu.org; Wed, 22 Dec 2021 02:36:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52174] [PATCH v3 5/6] gnu: add cni-plugins Resent-From: Timmy Douglas Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 22 Dec 2021 07:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52174 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52174@debbugs.gnu.org Cc: ludo@gnu.org, mail@timmydouglas.com Received: via spool by 52174-submit@debbugs.gnu.org id=B52174.164015850611019 (code B ref 52174); Wed, 22 Dec 2021 07:36:01 +0000 Received: (at 52174) by debbugs.gnu.org; 22 Dec 2021 07:35:06 +0000 Received: from localhost ([127.0.0.1]:56537 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzw9S-0002rf-DL for submit@debbugs.gnu.org; Wed, 22 Dec 2021 02:35:06 -0500 Received: from out1.migadu.com ([91.121.223.63]:27067) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzw9Q-0002rV-I6 for 52174@debbugs.gnu.org; Wed, 22 Dec 2021 02:35:04 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=timmydouglas.com; s=key1; t=1640158504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0gAiMnmI5/W3v6OH9D2XQf7QkZX5xyCo0K5AD8U1MhM=; b=SSsTKs1lC7smNpbnqZsTjRUANdBIq9rOL1uO6mABDQg+NigOhwFayi6tOGtFeC9j4ffQFw sTZYU9hvc/1zUKhMlr48rBDqoV4hPwRYZvVQKFjJKAAgvKY7r8OqGA+jciNuNHx0clvgrs Gns085IcnSiSxFaHrMApKiF023sdMwo= Date: Tue, 21 Dec 2021 23:33:54 -0800 Message-Id: <4916a92131ef49b3264de4a049d78d18a2b2c91b.1640158278.git.mail@timmydouglas.com> In-Reply-To: <87sfunjtfi.fsf@gnu.org> References: <87sfunjtfi.fsf@gnu.org> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: timmydouglas.com 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" Reply-to: Timmy Douglas X-ACL-Warn: , Timmy Douglas via Guix-patches X-Patchwork-Original-From: Timmy Douglas via Guix-patches via From: Timmy Douglas X-getmail-retrieved-from-mailbox: Patches * gnu/packages/containers.scm (cni-plugins): New variable. --- gnu/packages/containers.scm | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/gnu/packages/containers.scm b/gnu/packages/containers.scm index 5e540bcfe4..2789dcfc7c 100644 --- a/gnu/packages/containers.scm +++ b/gnu/packages/containers.scm @@ -213,3 +213,48 @@ (define-public slirp4netns (description "slirp4netns provides user-mode networking (\"slirp\") for unprivileged network namespaces.") (license license:gpl2+))) + +(define-public cni-plugins + (package + (name "cni-plugins") + (version "1.0.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/containernetworking/plugins") + (commit (string-append "v" version)))) + (sha256 + (base32 "1j91in0mg4nblpdccyq63ncbnn2pc2zzjp1fh3jy0bsndllgv0nc")) + (file-name (git-file-name name version)))) + (build-system go-build-system) + (arguments + `(#:unpack-path "github.com/containernetworking/plugins" + #:tests? #f ; XXX: see stat /var/run below + #:phases (modify-phases %standard-phases + (replace 'build + (lambda _ + (with-directory-excursion "src/github.com/containernetworking/plugins" + (invoke "./build_linux.sh")))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + ; only pkg/ns tests run without root + (when tests? + (with-directory-excursion "src/github.com/containernetworking/plugins/pkg/ns" + (invoke "stat" "/var/run") ; XXX: test tries to stat this directory + (invoke "unshare" "-rmn" "go" "test"))))) + (add-before 'check 'set-test-environment + (lambda _ + (setenv "XDG_RUNTIME_DIR" "/tmp/cni-rootless"))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (copy-recursively "src/github.com/containernetworking/plugins/bin" + (string-append (assoc-ref outputs "out") "/bin"))))))) + (native-inputs + (list util-linux)) + (home-page "https://github.com/containernetworking/plugins") + (synopsis "Container Network Interface (CNI) network plugins") + (description + "Some Container Network Interface (CNI) network plugins, maintained by the +containernetworking team.") + (license license:asl2.0)))