sharkcz pushed to perl-Glib (f22). "- Fix tests on big endian machines (#1235709)"

notifications at fedoraproject.org notifications at fedoraproject.org
Tue Jun 30 12:35:45 UTC 2015


From 08bce97105941eb88eb815b7f1adabc33102c70b Mon Sep 17 00:00:00 2001
From: Rafael Fonseca <rdossant at redhat.com>
Date: Tue, 30 Jun 2015 14:05:23 +0200
Subject: - Fix tests on big endian machines (#1235709)


diff --git a/perl-Glib-1.310-bigendian.patch b/perl-Glib-1.310-bigendian.patch
new file mode 100644
index 0000000..a223103
--- /dev/null
+++ b/perl-Glib-1.310-bigendian.patch
@@ -0,0 +1,34 @@
+From 420a511e0aa787168c9eb2434c34bc2e405a0d8b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Torsten=20Sch=C3=B6nfeld?= <kaffeetisch at gmx.de>
+Date: Sun, 28 Jun 2015 23:06:45 +0200
+Subject: [PATCH] Fix GVariant tests on big endian machines
+
+---
+ GVariant.xs | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/GVariant.xs b/GVariant.xs
+index e359829..7fddee8 100644
+--- a/GVariant.xs
++++ b/GVariant.xs
+@@ -279,10 +279,14 @@ gboolean g_variant_is_container (GVariant *value);
+ 
+ const char * g_variant_classify (GVariant *value);
+     PREINIT:
+-	GVariantClass vclass;
++	char vclass_char[2];
+     CODE:
+-	vclass = g_variant_classify (value);
+-	RETVAL = (const char *) &vclass;
++	/* g_variant_classify's return value is of type GVariantClass, which is
++	 * probably wider than a char, so we must not treat its address as a
++	 * string on big-endian machines. */
++	vclass_char[0] = g_variant_classify (value);
++	vclass_char[1] = 0;
++	RETVAL = vclass_char;
+     OUTPUT:
+ 	RETVAL
+ 
+-- 
+2.1.0
+
diff --git a/perl-Glib.spec b/perl-Glib.spec
index 90606d6..c72142a 100644
--- a/perl-Glib.spec
+++ b/perl-Glib.spec
@@ -1,11 +1,13 @@
 Name:           perl-Glib
 Version:        1.310
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Perl interface to GLib
 Group:          Development/Libraries
 License:        LGPLv2+
 URL:            http://search.cpan.org/dist/Glib/
 Source0:        http://www.cpan.org/authors/id/X/XA/XAOC/Glib-%{version}.tar.gz
+# Fix for big endian machines
+Patch0:         %{name}-%{version}-bigendian.patch
 BuildRequires:  glib2-devel
 BuildRequires:  perl >= 2:5.8.0
 BuildRequires:  perl(Cwd)
@@ -65,6 +67,7 @@ to GLib and GObject libraries.
 
 %prep
 %setup -q -n Glib-%{version}
+%patch0 -p1 -b .bigendian
 for F in AUTHORS; do
     iconv -f ISO-8859-1 -t UTF-8 < "$F" > "${F}.utf8"
     touch -r "$F" "${F}.utf8"
@@ -83,9 +86,7 @@ find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null ';'
 chmod -R u+w $RPM_BUILD_ROOT/*
 
 %check
-%ifnarch ppc ppc64
 make test
-%endif
 
 %files
 %doc AUTHORS ChangeLog.pre-git LICENSE NEWS README TODO
@@ -110,6 +111,9 @@ make test
 %{_mandir}/man3/Glib::xsapi.3pm.gz
 
 %changelog
+* Tue Jun 30 2015 Rafael Fonseca <rdossant at redhat.com> - 1.310-2
+- Fix GVariant tests for big endian machines (#1235709)
+
 * Fri Mar 20 2015 Tom Callaway <spot at fedoraproject.org> - 1.310-1
 - update to 1.310
 
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/perl-Glib.git/commit/?h=f22&id=08bce97105941eb88eb815b7f1adabc33102c70b


More information about the perl-devel mailing list