commit:     9a884d15380afe0a0b01a9de8c5538dc44bf8f7a
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 27 21:42:08 2020 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Sun Dec 27 21:42:50 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9a884d15

media-tv/v4l-utils: Ensure clang has the BPF target with pkg_pretend

The dependencies can only ensure that at least one clang on the system
has the BPF target and it may not be the one that actually gets used
for the build. Generally the latest version will have precedence in
the PATH but this fix also checks for overrides.

Bug: https://bugs.gentoo.org/692072
Package-Manager: Portage-3.0.12, Repoman-3.0.1
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>

 media-tv/v4l-utils/v4l-utils-1.20.0.ebuild | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/media-tv/v4l-utils/v4l-utils-1.20.0.ebuild 
b/media-tv/v4l-utils/v4l-utils-1.20.0.ebuild
index 01f52bb0555..a7d6c2130f1 100644
--- a/media-tv/v4l-utils/v4l-utils-1.20.0.ebuild
+++ b/media-tv/v4l-utils/v4l-utils-1.20.0.ebuild
@@ -46,6 +46,14 @@ PATCHES=(
 # Not really prebuilt but BPF objects make our QA checks go crazy.
 QA_PREBUILT="*/rc_keymaps/protocols/*.o"
 
+pkg_pretend() {
+       if use bpf; then
+               local clang=${ac_cv_prog_CLANG:-${CLANG:-clang}}
+               ${clang} -target bpf -print-supported-cpus &>/dev/null ||
+                       die "${clang} does not support the BPF target. Please 
check LLVM_TARGETS."
+       fi
+}
+
 src_prepare() {
        default
        eautoreconf

Reply via email to