[rubygem-gtk2] fix build error

Mamoru Tasaka mtasaka at fedoraproject.org
Sun Mar 3 05:45:28 UTC 2013


commit d25286134b9e5d21d4ab1bfc8ba26a534c192b30
Author: Mamoru TASAKA <mtasaka at fedoraproject.org>
Date:   Sun Mar 3 14:45:21 2013 +0900

    fix build error

 rubygem-gtk2-1.2.1-nil_p-syntax.patch |   33 +++++++++++++++++++++++++++++++++
 rubygem-gtk2.spec                     |   27 ++++++++++++++++++++++-----
 2 files changed, 55 insertions(+), 5 deletions(-)
---
diff --git a/rubygem-gtk2-1.2.1-nil_p-syntax.patch b/rubygem-gtk2-1.2.1-nil_p-syntax.patch
new file mode 100644
index 0000000..e88da2d
--- /dev/null
+++ b/rubygem-gtk2-1.2.1-nil_p-syntax.patch
@@ -0,0 +1,33 @@
+--- gtk2-1.2.1/ext/gtk2/rbgdkevent.c.syntax	2013-03-03 13:59:43.000000000 +0900
++++ gtk2-1.2.1/ext/gtk2/rbgdkevent.c	2013-03-03 14:29:03.000000000 +0900
+@@ -387,7 +387,7 @@
+     VALUE value;
+ 
+     rb_scan_args(argc, argv, "11", &name, &type);
+-    if NIL_P(type) 
++    if (NIL_P(type)) 
+         gtype = G_TYPE_STRING;
+     else
+         gtype = CLASS2GTYPE(type);
+--- gtk2-1.2.1/ext/gtk2/rbgdkscreen.c.syntax	2013-03-03 13:59:40.000000000 +0900
++++ gtk2-1.2.1/ext/gtk2/rbgdkscreen.c	2013-03-03 14:26:12.000000000 +0900
+@@ -210,7 +210,7 @@
+     VALUE value;
+ 
+     rb_scan_args(argc, argv, "11", &name, &type);
+-    if NIL_P(type) 
++    if (NIL_P(type)) 
+         gtype = G_TYPE_STRING;
+     else
+         gtype = CLASS2GTYPE(type);
+--- gtk2-1.2.1/ext/gtk2/rbgtkcalendar.c.syntax	2013-03-03 13:59:39.000000000 +0900
++++ gtk2-1.2.1/ext/gtk2/rbgtkcalendar.c	2013-03-03 14:31:40.000000000 +0900
+@@ -105,7 +105,7 @@
+     VALUE flags;
+     rb_scan_args(argc, argv, "01", &flags);
+ 
+-    if NIL_P(flags){
++    if (NIL_P(flags)){
+ #if GTK_CHECK_VERSION(2,4,0)
+         return GFLAGS2RVAL(gtk_calendar_get_display_options(_SELF(self)),
+                            GTK_TYPE_CALENDAR_DISPLAY_OPTIONS);
diff --git a/rubygem-gtk2.spec b/rubygem-gtk2.spec
index a0cfb53..de6b089 100644
--- a/rubygem-gtk2.spec
+++ b/rubygem-gtk2.spec
@@ -29,6 +29,8 @@ Group:		Development/Languages
 License:	LGPLv2
 URL:		http://ruby-gnome2.sourceforge.jp/
 Source0:	http://rubygems.org/downloads/%{gem_name}-%{version}.gem
+# https://github.com/ruby-gnome2/ruby-gnome2/commit/03be2d6637301
+Patch0:	rubygem-gtk2-1.2.1-nil_p-syntax.patch
 
 %if 0%{?fedora} >= 19
 Requires:	ruby(release)
@@ -106,13 +108,18 @@ rubygem-%{gem_name}
 %setup -q -c -T
 mkdir -p .%{gem_dir}
 
-export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
-export CONFIGURE_ARGS="$CONFIGURE_ARGS --with-pkg-config-dir=$(pwd)%{_libdir}/pkgconfig"
-%gem_install -n %{SOURCE0}
+TOPDIR=$(pwd)
+mkdir tmpunpackdir
+pushd tmpunpackdir
 
-find . -name \*.gem | xargs chmod 0644
+gem unpack %{SOURCE0}
+cd %{gem_name}-%{version}
+
+gem specification -l --ruby %{SOURCE0} > %{gem_name}.gemspec
+
+# Patches and etc
+%patch0 -p1
 
-pushd .%{gem_instdir}
 # Fix wrong dir
 grep -rl /usr/local/bin sample | \
 	xargs sed -i -e 's|/usr/local/|/usr/|'
@@ -121,9 +128,19 @@ grep -rl /usr/local/bin sample | \
 grep -rl '#!.*/usr/bin' sample lib | \
 	xargs sed -i -e '\@#![ ]*/usr/bin at d'
 find sample/ -name \*.rb | xargs chmod 0644
+
+# Repackage gem
+gem build %{gem_name}.gemspec
+mv %{gem_name}-%{version}.gem $TOPDIR
+
 popd
+rm -rf tmpunpackdir
 
 %build
+export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
+export CONFIGURE_ARGS="$CONFIGURE_ARGS --with-pkg-config-dir=$(pwd)%{_libdir}/pkgconfig"
+%gem_install
+
 # Move C extension library to some private directory
 pushd .%{gem_instdir}
 %if ! %{ruby19}


More information about the scm-commits mailing list