git: 543386720f4f - main - multimedia/av1an: fix build on powerpc64le

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Sat, 31 Oct 2026 21:34:05 UTC
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=543386720f4f0863475cb2c5cf90e1501a2446d0

commit 543386720f4f0863475cb2c5cf90e1501a2446d0
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2026-10-30 15:03:49 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2026-10-31 21:33:15 +0000

    multimedia/av1an: fix build on powerpc64le
    
    cpufeatures only knows x86, aarch64 and loongarch64 and refuses to
    compile anywhere else. av-scenechange pulls it in unconditionally but
    only uses it on x86_64, so replace the compile_error with a fallback
    that just reports the compile-time target features.
---
 ...atch-cargo-crates_cpufeatures-0.2.17_src_lib.rs | 47 ++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/multimedia/av1an/files/patch-cargo-crates_cpufeatures-0.2.17_src_lib.rs b/multimedia/av1an/files/patch-cargo-crates_cpufeatures-0.2.17_src_lib.rs
new file mode 100644
index 000000000000..002032c0e7c9
--- /dev/null
+++ b/multimedia/av1an/files/patch-cargo-crates_cpufeatures-0.2.17_src_lib.rs
@@ -0,0 +1,47 @@
+--- cargo-crates/cpufeatures-0.2.17/src/lib.rs.orig	2006-07-24 01:21:28 UTC
++++ cargo-crates/cpufeatures-0.2.17/src/lib.rs
+@@ -143,13 +143,43 @@
+ #[cfg(miri)]
+ mod miri;
+ 
++// Fallback for targets without a runtime detection backend (e.g. powerpc64):
++// feature checks fall back to compile-time target features only.
++#[cfg(not(miri))]
+ #[cfg(not(any(
+     target_arch = "aarch64",
+     target_arch = "loongarch64",
+     target_arch = "x86",
+     target_arch = "x86_64"
+ )))]
+-compile_error!("This crate works only on `aarch64`, `loongarch64`, `x86`, and `x86-64` targets.");
++#[macro_export]
++#[doc(hidden)]
++macro_rules! __unless_target_features {
++    ($($tf:tt),+ => $body:expr ) => {
++        {
++            #[cfg(not(all($(target_feature=$tf,)*)))]
++            $body
++
++            #[cfg(all($(target_feature=$tf,)*))]
++            true
++        }
++    };
++}
++
++#[cfg(not(miri))]
++#[cfg(not(any(
++    target_arch = "aarch64",
++    target_arch = "loongarch64",
++    target_arch = "x86",
++    target_arch = "x86_64"
++)))]
++#[macro_export]
++#[doc(hidden)]
++macro_rules! __detect_target_features {
++    ($($tf:tt),+) => {
++        false
++    };
++}
+ 
+ /// Create module with CPU feature detection code.
+ #[macro_export]