public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rust-glib] epel10: fix build on non-x86
@ 2026-09-25 10:36 Igor Gnatenko
  0 siblings, 0 replies; only message in thread
From: Igor Gnatenko @ 2026-09-25 10:36 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/rust-glib
            Branch : epel10
            Commit : 4b1d9c6ac02e86d20dc0f1ada280d0bc55ca464a
            Author : Igor Gnatenko <ignatenkobrain@fedoraproject.org>
            Date   : 2018-01-21T11:46:08+01:00
            Stats  : +70/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/rust-glib/c/4b1d9c6ac02e86d20dc0f1ada280d0bc55ca464a?branch=epel10

            Log:
            fix build on non-x86

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>

---
diff --git a/0001-Fix-Char-tests-on-platforms-where-c_char-is-u8-inste.patch b/0001-Fix-Char-tests-on-platforms-where-c_char-is-u8-inste.patch
new file mode 100644
index 0000000..ac079f9
--- /dev/null
+++ b/0001-Fix-Char-tests-on-platforms-where-c_char-is-u8-inste.patch
@@ -0,0 +1,68 @@
+From ffcb668f2d89d9ba95ac5b44ab182c8d59d737c6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
+Date: Sun, 21 Jan 2018 11:29:21 +0200
+Subject: [PATCH] Fix Char tests on platforms where c_char is u8 instead of i8
+
+Also add correct casts to the UChar tests while we're at it.
+
+Fixes https://github.com/gtk-rs/glib/issues/284
+---
+ src/char.rs | 24 ++++++++++++------------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/src/char.rs b/src/char.rs
+index 45dd4ae..b55694d 100644
+--- a/src/char.rs
++++ b/src/char.rs
+@@ -139,12 +139,12 @@ mod tests {
+ 
+     #[test]
+     fn converts_single_byte_chars() {
+-        assert_eq!(Char::new(0 as char), Some(Char(0)));
+-        assert_eq!(Char::new(255 as char), Some(Char(-1)));
+-        assert_eq!(Char::new('ñ'), Some(Char(241 as u8 as i8)));
+-        assert_eq!(UChar::new(0 as char), Some(UChar(0)));
+-        assert_eq!(UChar::new(255 as char), Some(UChar(255)));
+-        assert_eq!(UChar::new('ñ'), Some(UChar(241 as u8)));
++        assert_eq!(Char::new(0 as char), Some(Char(0 as c_char)));
++        assert_eq!(Char::new(255 as char), Some(Char(-1 as i8 as c_char)));
++        assert_eq!(Char::new('ñ'), Some(Char(241 as u8 as c_char)));
++        assert_eq!(UChar::new(0 as char), Some(UChar(0 as c_uchar)));
++        assert_eq!(UChar::new(255 as char), Some(UChar(255 as c_uchar)));
++        assert_eq!(UChar::new('ñ'), Some(UChar(241 as c_uchar)));
+     }
+ 
+     #[test]
+@@ -155,23 +155,23 @@ mod tests {
+ 
+     #[test]
+     fn into_i8() {
+-        assert_eq!(Char::new('A').unwrap().to_glib(), 65i8);
++        assert_eq!(Char::new('A').unwrap().to_glib(), 65 as c_char);
+     }
+ 
+     #[test]
+     fn into_u8() {
+-        assert_eq!(UChar::new('A').unwrap().to_glib(), 65u8);
++        assert_eq!(UChar::new('A').unwrap().to_glib(), 65 as c_uchar);
+     }
+ 
+     #[test]
+     fn into_char() {
+-        assert_eq!(char::from(Char(65i8)), 'A');
+-        assert_eq!('ñ', UChar(241u8).into());
++        assert_eq!(char::from(Char(65 as c_char)), 'A');
++        assert_eq!('ñ', UChar(241 as c_uchar).into());
+     }
+ 
+     #[test]
+     fn convert_from_glib() {
+-        assert_eq!(Char(65i8), from_glib(65i8));
+-        assert_eq!(UChar(241u8), from_glib(241u8));
++        assert_eq!(Char(65 as c_char), from_glib(65 as c_char));
++        assert_eq!(UChar(241 as c_uchar), from_glib(241 as u8 as c_uchar));
+     }
+ }
+-- 
+2.15.1
+

diff --git a/rust-glib.spec b/rust-glib.spec
index 3dfd578..81b306e 100644
--- a/rust-glib.spec
+++ b/rust-glib.spec
@@ -12,6 +12,8 @@ Summary:        Rust bindings for the GLib library
 License:        MIT
 URL:            https://crates.io/crates/glib
 Source0:        https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate
+# https://github.com/gtk-rs/glib/pull/285
+Patch0001:      0001-Fix-Char-tests-on-platforms-where-c_char-is-u8-inste.patch
 
 ExclusiveArch:  %{rust_arches}
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-25 10:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-25 10:36 [rpms/rust-glib] epel10: fix build on non-x86 Igor Gnatenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox