From 08149c02bc3a0c55229d63a372e211d6e1d31a18 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sat, 22 Jun 2024 22:18:26 -0400 Subject: [PATCH] gnu: bcc: Update to 0.30.0, fixing build. * gnu/packages/linux.scm (bcc): Update to 0.30.0. [native-inputs]: Add zip. [inputs] Remove labels. Remove stale comment (our libelf package has a static archive, but the build still fails using it). Replace the libbpf source with its binary package. Replace clang-toolchain-9 with clang-15. Add bash-minimal. [arguments]: Use gexps. : Add -DCMAKE_USE_LIBBPF_PACKAGE=ON. : Remove copy-libbpf. Change-Id: Ife0bec7802e7faa54689c0199bc2618ce6a39428 --- gnu/packages/linux.scm | 98 +++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 54 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index fc2e5b15a6..d259d6fddc 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -10021,7 +10021,7 @@ headers.") (define-public bcc (package (name "bcc") - (version "0.24.0") + (version "0.30.0") (source (origin (method git-fetch) @@ -10031,63 +10031,53 @@ headers.") (file-name (git-file-name name version)) (sha256 (base32 - "1i6xikkxf2nasfkqa91hjzdq0a88mgyzrvia4fi2i2v1d8pbmnp4")))) + "0b5la0yn6x6ll73drnrm5v5yibbrzkvl86hqivkrmnpgy8cqn0cy")))) (build-system cmake-build-system) (native-inputs - (list bison flex)) + (list bison + flex + (@ (gnu packages compression) zip))) (inputs - `(("clang-toolchain" ,clang-toolchain-9) - ("libbpf" ,(package-source libbpf)) - ;; LibElf required but libelf does not contain - ;; archives, only object files. - ;; https://github.com/iovisor/bcc/issues/504 - ("elfutils" ,elfutils) - ("luajit" ,luajit) - ("python-wrapper" ,python-wrapper))) + (list clang-15 + elfutils + luajit + libbpf + python-wrapper)) (arguments - `(;; Tests all require root permissions and a "standard" file hierarchy. - #:tests? #f - #:configure-flags - (let ((revision ,version)) - `(,(string-append "-DREVISION=" revision))) - #:phases - (modify-phases %standard-phases - ;; FIXME: Use "-DCMAKE_USE_LIBBPF_PACKAGE=ON". - (add-after 'unpack 'copy-libbpf - (lambda* (#:key inputs #:allow-other-keys) - (delete-file-recursively "src/cc/libbpf") - (copy-recursively - (assoc-ref inputs "libbpf") "src/cc/libbpf"))) - (add-after 'copy-libbpf 'substitute-libbc - (lambda* (#:key outputs #:allow-other-keys) - (substitute* "src/python/bcc/libbcc.py" - (("(libbcc\\.so.*)\\b" _ libbcc) - (string-append - (assoc-ref outputs "out") "/lib/" libbcc))))) - (add-after 'install 'wrap-tools - (lambda* (#:key outputs #:allow-other-keys) - (use-modules (ice-9 textual-ports)) - (let* ((out (assoc-ref outputs "out")) - (lib (string-append out "/lib")) - (tools (string-append out "/share/bcc/tools")) - (python-executable? - (lambda (filename _) - (call-with-input-file filename - (lambda (port) - (string-contains (get-line port) - "/bin/python")))))) - (for-each - (lambda (python-executable) - (format #t "Wrapping: ~A.~%" python-executable) - (wrap-program python-executable - `("GUIX_PYTHONPATH" ":" prefix - (,(string-append lib - "/python" - ,(version-major+minor - (package-version python)) - "/site-packages"))))) - (find-files tools python-executable?)) - #t)))))) + (list + ;; Tests all require root permissions and a "standard" file hierarchy. + #:tests? #f + #:configure-flags #~(list (string-append "-DREVISION=" #$version) + "-DCMAKE_USE_LIBBPF_PACKAGE=ON") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'substitute-libbc + (lambda _ + (substitute* "src/python/bcc/libbcc.py" + (("(libbcc\\.so.*)\\b" _ libbcc) + (string-append #$output "/lib/" libbcc))))) + (add-after 'install 'wrap-tools + (lambda _ + (use-modules (ice-9 textual-ports)) + (let* ((out #$output) + (lib (string-append out "/lib")) + (tools (string-append out "/share/bcc/tools")) + (python-executable? + (lambda (filename _) + (call-with-input-file filename + (lambda (port) + (string-contains (get-line port) + "/bin/python")))))) + (for-each (lambda (python-executable) + (format #t "Wrapping: ~A.~%" python-executable) + (wrap-program python-executable + `("GUIX_PYTHONPATH" ":" prefix + (,(string-append lib + "/python" + #$(version-major+minor + (package-version python)) + "/site-packages"))))) + (find-files tools python-executable?)))))))) (home-page "https://github.com/iovisor/bcc") (synopsis "Tools for BPF on Linux") (description