From patchwork Thu Dec 29 10:53:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ryan Sundberg X-Patchwork-Id: 45676 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 85A5127BBEB; Thu, 29 Dec 2022 10:55:17 +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=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,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 C8AC627BBE9 for ; Thu, 29 Dec 2022 10:55:13 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pAqZ1-0004YH-EH; Thu, 29 Dec 2022 05:55:07 -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 1pAqZ0-0004Y6-8B for guix-patches@gnu.org; Thu, 29 Dec 2022 05:55:06 -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 1pAqYx-0004rq-0F for guix-patches@gnu.org; Thu, 29 Dec 2022 05:55:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pAqYw-0007jU-Fq for guix-patches@gnu.org; Thu, 29 Dec 2022 05:55:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60401] [PATCH] gnu: bpftool: New package Resent-From: Ryan Sundberg Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 29 Dec 2022 10:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60401 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60401@debbugs.gnu.org Cc: Ryan Sundberg X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167231127529687 (code B ref -1); Thu, 29 Dec 2022 10:55:02 +0000 Received: (at submit) by debbugs.gnu.org; 29 Dec 2022 10:54:35 +0000 Received: from localhost ([127.0.0.1]:59374 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAqYV-0007il-9N for submit@debbugs.gnu.org; Thu, 29 Dec 2022 05:54:35 -0500 Received: from lists.gnu.org ([209.51.188.17]:37736) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAqYS-0007ib-Ss for submit@debbugs.gnu.org; Thu, 29 Dec 2022 05:54:33 -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 1pAqYS-0004X0-Kg for guix-patches@gnu.org; Thu, 29 Dec 2022 05:54:32 -0500 Received: from mail.arctype.co ([138.68.9.245]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pAqYQ-0004mq-Fe for guix-patches@gnu.org; Thu, 29 Dec 2022 05:54:32 -0500 Received: from authenticated-user (mail.arctype.co [138.68.9.245]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by mail.arctype.co (Postfix) with ESMTPSA id 17F2313B18E; Thu, 29 Dec 2022 10:53:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=arctype.co; s=mail; t=1672311235; bh=2I/HHlWBhE48lG3jOrtPYPUXX34p50EuorrnxJRf8Pk=; h=From:To:Cc:Subject:Date:From; b=OvOlNDvGzdAeozhB1Z+p3U72hEQnpsigcc0REU1XWxneI1Iq6phTIqt+ZffX7Xw6l E15x6Gw16v2vAGRsnM4YsyOQ5uXLrwj7PjhPAVmBkGR9IgS5ObxDwdZdtZpPpHZ+FU wHXQXbV/NaEy8OjeSAFmBuGr0wrRrBYxNH9JRJPaBXhuOvhFHRwtkgbU0MkWhkg6xh ImCSsBm7fP6HPavgz0h6XnXfupPmOzXARbQC32XtQMveYudEOatQJstFTMT+Rx2dhR SLH42bs3kCcmiadDnMemutvWwTkXNr96wOOo5OOZu+MGwawPuIygS/j6y3L4uBNDtr s2efiODhx3ZTA== Date: Thu, 29 Dec 2022 02:53:51 -0800 Message-Id: <20221229105351.2318-1-ryan@arctype.co> MIME-Version: 1.0 Received-SPF: pass client-ip=138.68.9.245; envelope-from=ryan@arctype.co; helo=mail.arctype.co X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Ryan Sundberg X-ACL-Warn: , Ryan Sundberg via Guix-patches X-Patchwork-Original-From: Ryan Sundberg via Guix-patches via From: Ryan Sundberg 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 Provides a package for `bpftool` from the Linux kernel source. * gnu/packages/linux.scm (bpftool): New variable --- gnu/packages/linux.scm | 53 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 568c2b6b92..2f625267dc 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -61,6 +61,7 @@ ;;; Copyright © 2021 Olivier Dion ;;; Copyright © 2021 Solene Rapenne ;;; Copyright © 2021, 2022 Petr Hodina +;;; Copyright © 2021 Ryan Sundberg ;;; Copyright © 2022 Artyom V. Poptsov ;;; Copyright © 2022 Rene Saavedra ;;; Copyright © 2022 muradm @@ -9361,6 +9362,58 @@ (define-public bcc and above.") (license license:asl2.0))) +(define-public bpftool + (package + (name "bpftool") + (version (package-version linux-libre)) + (source (package-source linux-libre)) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; This package has no tests. + #:phases + (modify-phases %standard-phases + (delete 'configure) + (replace 'build + (lambda* (#:key inputs #:allow-other-keys) + (let* ((binutils* (assoc-ref inputs "binutils")) + (ldflags (string-append "-I" (string-append binutils* "/include")))) + (invoke "make" + "-C" + "tools/bpf/bpftool" + ,(string-append "CC=" (cc-for-target)) + ; We need to explicitly set the RUNPATH for these libraries + (string-append "LDFLAGS=-Wl" + ",-rpath=" (assoc-ref inputs "elfutils") "/lib" + ",-rpath=" (assoc-ref inputs "libcap") "/lib" + ",-rpath=" (assoc-ref inputs "zlib") "/lib")) + #t))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out"))) + (mkdir-p (string-append out "/sbin")) + (mkdir-p (string-append out "/share/bash-completion/completions")) + (invoke "make" + (string-append "prefix=" out) + (string-append "bash_compdir=" out + "/share/bash-completion/completions") + "-C" "tools/bpf/bpftool" + "install") + #t)))))) + (inputs + `(("elfutils", elfutils) ; Provides libelf + ("readline" ,readline) + ("libcap" ,libcap) + ("zlib" ,zlib))) + (native-inputs + `(("bison" ,bison) + ("python" ,python-3))) + ; This tool does not have a proper web page. + (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/bpf/bpftool") + (synopsis "Tool for inspection and simple manipulation of eBPF programs and maps") + (description "bpftool allows for inspection and simple modification of BPF +objects on the system.") + (license (package-license linux-libre)))) + (define-public bpftrace (package (name "bpftrace")