[rubygem-glib2] Fix build error with GLib >= 2.31.20 (bug 804319)

Mamoru Tasaka mtasaka at fedoraproject.org
Fri Mar 23 10:05:06 UTC 2012


commit c1b180144387faa98d01bac3199afdb05d9eb1cf
Author: TASAKA Mamoru <mtasaka at localhost.localdomain>
Date:   Fri Mar 23 19:05:02 2012 +0900

    Fix build error with GLib >= 2.31.20 (bug 804319)

 rubygem-glib2-1.1.2-ifdef-enum.patch |   25 +++++++++++++++++++++++++
 rubygem-glib2.spec                   |   28 ++++++++++++++++++++++++++--
 2 files changed, 51 insertions(+), 2 deletions(-)
---
diff --git a/rubygem-glib2-1.1.2-ifdef-enum.patch b/rubygem-glib2-1.1.2-ifdef-enum.patch
new file mode 100644
index 0000000..b7453be
--- /dev/null
+++ b/rubygem-glib2-1.1.2-ifdef-enum.patch
@@ -0,0 +1,25 @@
+commit 9da46fe2bd474a42cd68caffb352468bbcec2083
+Author: Kouhei Sutou <kou at clear-code.com>
+Date:   Thu Mar 22 23:50:58 2012 +0900
+
+    glib2: ignore macro lines
+    
+    e.g. #ifndef, #endif and so on
+    
+    GitHub: #106
+    
+    Reported by mtasaka. Thanks!!!
+
+diff --git a/glib2/lib/glib-mkenums.rb b/glib2/lib/glib-mkenums.rb
+index 20382df..5194009 100644
+--- a/glib2/lib/glib-mkenums.rb
++++ b/glib2/lib/glib-mkenums.rb
+@@ -40,7 +40,7 @@ module GLib
+       end
+       constants = []
+       const_lines.scan(/^\s*([^\s,]*).*\n/) do |name|
+-        constants << name[0] unless name[0] =~ /(^[\/\*]|^$)/
++        constants << name[0] unless name[0] =~ /(^[\/\*]|^#|^$)/
+       end
+       @prefix = extract_prefix(constants)
+       constants.each do |name|
diff --git a/rubygem-glib2.spec b/rubygem-glib2.spec
index 5921f77..4ca3df5 100644
--- a/rubygem-glib2.spec
+++ b/rubygem-glib2.spec
@@ -18,18 +18,23 @@
 Summary:	Ruby binding of GLib-2.x
 Name:		rubygem-%{gem_name}
 Version:	1.1.2
-Release:	3%{?dist}
+Release:	4%{?dist}
 Group:		Development/Languages
 # from README
 License:	LGPLv2
 URL:		http://ruby-gnome2.sourceforge.jp/
 Source0:	http://rubygems.org/gems/%{gem_name}-%{version}.gem
+# https://github.com/ruby-gnome2/ruby-gnome2/issues/106
+# https://bugzilla.redhat.com/show_bug.cgi?id=804319
+Patch0:	rubygem-glib2-1.1.2-ifdef-enum.patch
 
 BuildRequires:	ruby(abi) = %{rubyabi}
 BuildRequires:	rubygems-devel
 BuildRequires:	rubygem(pkg-config)
 BuildRequires:	ruby-devel
 BuildRequires:	glib2-devel
+# For patch
+BuildRequires:	rubygem(rake-compiler)
 ## %%check
 BuildRequires:	rubygem(test-unit)
 Requires:	ruby(abi) = %{rubyabi}
@@ -42,7 +47,7 @@ Requires:	rubygem(gettext)
 Provides:	rubygem(%{gem_name}) = %{version}
 
 %if %{ruby19}
-Obsoletes:	ruby-%{gem_name} = %{version}-%{release}
+Obsoletes:	ruby-%{gem_name} <= %{version}-%{release}
 Provides:	ruby-%{gem_name} = %{version}-%{release}
 Provides:	ruby(%{gem_name}) = %{version}-%{release}
 %endif
@@ -97,6 +102,18 @@ rubygem-%{gem_name}
 %setup -q -c -T
 mkdir -p .%{gem_dir}
 
+# Modify gem
+TOPDIR=$(pwd)
+mkdir -p tmpunpackdir/glib2
+pushd tmpunpackdir
+tar xf %{SOURCE0}
+cd glib2
+tar xzf ../data.tar.gz
+%patch0 -p2
+rake gem
+mv pkg/%{gem_name}-%{version}.gem $TOPDIR/
+popd
+
 export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
 export CONFIGURE_ARGS="$CONFIGURE_ARGS --with-pkg-config-dir=$(pwd)%{_libdir}/pkgconfig"
 gem install \
@@ -105,7 +122,11 @@ gem install \
 	--install-dir .%{gem_dir} \
 	--force \
 	--rdoc \
+%if 0
 	%{SOURCE0}
+%else
+	./%{gem_name}-%{version}.gem
+%endif
 
 find . -name \*.gem | xargs chmod 0644
 
@@ -333,6 +354,9 @@ popd
 
 
 %changelog
+* Fri Mar 23 2012 Mamoru Tasaka <mtasaka at fedoraproject.org> - 1.1.2-4
+- Fix build error with GLib >= 2.31.20 (bug 804319)
+
 * Wed Feb  1 2012 Mamoru Tasaka <mtasaka at fedoraproject.org> - 1.1.2-3
 - Add proper Obsoletes/Provides
 


More information about the scm-commits mailing list