me
/
guix
Archived
1
0
Fork 0

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.
<configure-flags>: Add -DCMAKE_USE_LIBBPF_PACKAGE=ON.
<phases>: Remove copy-libbpf.

Change-Id: Ife0bec7802e7faa54689c0199bc2618ce6a39428
master
Maxim Cournoyer 2024-06-22 22:18:26 -04:00
parent c5fc11488c
commit 08149c02bc
No known key found for this signature in database
GPG Key ID: 1260E46482E63562
1 changed files with 44 additions and 54 deletions

View File

@ -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