git: c70d1de4a1bb - main - multimedia/ringrtc: Fix build on aarch64

From: Mikael Urankar <mikael_at_FreeBSD.org>
Date: Fri, 08 Nov 2024 13:09:02 UTC
The branch main has been updated by mikael:

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

commit c70d1de4a1bb2631e37bbcfe311a007c96ab32f3
Author:     Mikael Urankar <mikael@FreeBSD.org>
AuthorDate: 2024-11-08 13:08:51 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2024-11-08 13:08:51 +0000

    multimedia/ringrtc: Fix build on aarch64
---
 multimedia/ringrtc/files/patch-aarch64 | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/multimedia/ringrtc/files/patch-aarch64 b/multimedia/ringrtc/files/patch-aarch64
new file mode 100644
index 000000000000..a54fdaf2a86e
--- /dev/null
+++ b/multimedia/ringrtc/files/patch-aarch64
@@ -0,0 +1,28 @@
+From d9be0bfca8f9585c2bfc775083124088fd0370ca Mon Sep 17 00:00:00 2001
+From: Miriam Zimmerman <mutexlox@signal.org>
+Date: Wed, 2 Oct 2024 10:48:04 -0400
+Subject: [PATCH] Fix build on arm64 linux.
+
+On arm64 linux, c_char is u8. CStr::from_ptr is documented to take an
+i8, but this is not accurate (see
+https://github.com/rust-lang/rust/issues/113735); instead, it takes
+c_char, which is sometimes but not always the same. One time it is
+different is on aarch64 Linux, so without this commit, cubeb-rs fails to
+build there.
+---
+ cubeb-sys/src/device.rs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cubeb-sys/src/device.rs b/cubeb-sys/src/device.rs
+index 5827bf0..bac4a86 100644
+--- cargo-crates/cubeb-sys-0.14.0/src/device.rs
++++ cargo-crates/cubeb-sys-0.14.0/src/device.rs
+@@ -182,7 +182,7 @@ impl Default for cubeb_device_info {
+ 
+ impl fmt::Debug for cubeb_device_info {
+     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+-        fn optional_c_str(c_str: *const i8) -> Option<*const i8> {
++        fn optional_c_str(c_str: *const c_char) -> Option<*const c_char> {
+             (unsafe { c_str.as_ref() }).map(ptr::from_ref)
+         }
+         f.debug_struct("cubeb_device_info")