public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
To: git-commits@fedoraproject.org
Subject: [rpms/rust-glib] epel10: fix build on non-x86
Date: Fri, 25 Sep 2026 10:36:43 GMT	[thread overview]
Message-ID: <179033260377.1.5017546507894254620.rpms-rust-glib-4b1d9c6ac02e@fedoraproject.org> (raw)

            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}
 

                 reply	other threads:[~2026-09-25 10:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179033260377.1.5017546507894254620.rpms-rust-glib-4b1d9c6ac02e@fedoraproject.org \
    --to=ignatenkobrain@fedoraproject.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox