git: 612c485103ee - main - multimedia/gstreamer1-plugins-rust: Fix build on i386

From: Jason E. Hale <jhale_at_FreeBSD.org>
Date: Fri, 15 Nov 2024 05:36:46 UTC
The branch main has been updated by jhale:

URL: https://cgit.FreeBSD.org/ports/commit/?id=612c485103ee7c13d34e822cbd59776a13dcdf8b

commit 612c485103ee7c13d34e822cbd59776a13dcdf8b
Author:     Jason E. Hale <jhale@FreeBSD.org>
AuthorDate: 2024-11-15 02:01:28 +0000
Commit:     Jason E. Hale <jhale@FreeBSD.org>
CommitDate: 2024-11-15 05:35:45 +0000

    multimedia/gstreamer1-plugins-rust: Fix build on i386
    
    Ring assumes SSE and SSE2 are available on i386. This workaround assumes
    the same, so the build will still fail on ancient hardware without these
    instruction sets.
    
    error[E0080]: evaluation of constant value failed
      --> /wrkdirs/usr/ports/multimedia/gstreamer1-plugins-rust/work/gst-plugins-rs-0.13.3/cargo-crates/ring-0.17.8/src/cpu/intel.rs:28:9
       |
    28 |         assert!(cfg!(target_feature = "sse") && cfg!(target_feature = "sse2"));
       |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    the evaluated program panicked at 'assertion failed: cfg!(target_feature = "sse") && cfg!(target_feature = "sse2")',
    /wrkdirs/usr/ports/multimedia/gstreamer1-plugins-rust/work/gst-plugins-rs-0.13.3/cargo-crates/ring-0.17.8/src/cpu/intel.rs:28:9
    
    Reported by:    pkg-fallout
---
 multimedia/gstreamer1-plugins-rust/Makefile | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/multimedia/gstreamer1-plugins-rust/Makefile b/multimedia/gstreamer1-plugins-rust/Makefile
index 44263e9d46d1..3e1a026f9629 100644
--- a/multimedia/gstreamer1-plugins-rust/Makefile
+++ b/multimedia/gstreamer1-plugins-rust/Makefile
@@ -41,6 +41,11 @@ LTO_UNSAFE=	yes
 CARGO_ENV+=	CARGO_PROFILE_RELEASE_LTO=false
 .endif
 
+.if ${MACHINE_ARCH} == i386
+# https://github.com/briansmith/ring/issues/1832
+RUSTFLAGS+=	-C target-feature=+sse,+sse2
+.endif
+
 OPTIONS_DEFINE=		ASM CAIRO CSOUND DAV1D GTK4 PANGO SODIUM WEBP
 OPTIONS_DEFAULT=	ASM CAIRO CSOUND DAV1D GTK4 PANGO SODIUM WEBP
 OPTIONS_EXCLUDE_aarch64=	CSOUND # https://github.com/neithanmo/csound-rs/commit/8962b89d7bda