GNU bug report logs - #60401
[PATCH] gnu: bpftool: New package

Previous Next

Package: guix-patches;

Reported by: Ryan Sundberg <ryan <at> arctype.co>

Date: Thu, 29 Dec 2022 10:55:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 60401 in the body.
You can then email your comments to 60401 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#60401; Package guix-patches. (Thu, 29 Dec 2022 10:55:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ryan Sundberg <ryan <at> arctype.co>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 29 Dec 2022 10:55:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ryan Sundberg <ryan <at> arctype.co>
To: guix-patches <at> gnu.org
Cc: Ryan Sundberg <ryan <at> arctype.co>
Subject: [PATCH] gnu: bpftool: New package
Date: Thu, 29 Dec 2022 02:53:51 -0800
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 <olivier.dion <at> polymtl.ca>
 ;;; Copyright © 2021 Solene Rapenne <solene <at> perso.pw>
 ;;; Copyright © 2021, 2022 Petr Hodina <phodina <at> protonmail.com>
+;;; Copyright © 2021 Ryan Sundberg <ryan <at> arctype.co>
 ;;; Copyright © 2022 Artyom V. Poptsov <poptsov.artyom <at> gmail.com>
 ;;; Copyright © 2022 Rene Saavedra <nanuui <at> protonmail.com>
 ;;; Copyright © 2022 muradm <mail <at> muradm.net>
@@ -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")
-- 
2.37.2





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Fri, 07 Apr 2023 15:37:02 GMT) Full text and rfc822 format available.

Notification sent to Ryan Sundberg <ryan <at> arctype.co>:
bug acknowledged by developer. (Fri, 07 Apr 2023 15:37:02 GMT) Full text and rfc822 format available.

Message #10 received at 60401-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Ryan Sundberg <ryan <at> arctype.co>
Cc: 60401-done <at> debbugs.gnu.org
Subject: Re: bug#60401: [PATCH] gnu: bpftool: New package
Date: Fri, 07 Apr 2023 17:36:44 +0200
Hi Ryan,

Ryan Sundberg <ryan <at> arctype.co> skribis:

> Provides a package for `bpftool` from the Linux kernel source.
>
> * gnu/packages/linux.scm (bpftool): New variable

Sorry for the long delay!  I simplified it quite a bit and applied it.

Thanks!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 06 May 2023 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 346 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.