[packages/ruby-gnome2] fix parse error with NIL_P used without parenthesis
glen
glen at pld-linux.org
Sat Jul 26 22:22:13 CEST 2014
commit 51c9987a7b945c5950d7d13628e954aaf9a290e7
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Sat Jul 26 23:11:57 2014 +0300
fix parse error with NIL_P used without parenthesis
NIL_P is defined without parenthesis and causes parse errors if
used in "if-statement"
parse-error.patch | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
ruby-gnome2.spec | 2 ++
2 files changed, 65 insertions(+)
---
diff --git a/ruby-gnome2.spec b/ruby-gnome2.spec
index cbdba7f..e0fbb22 100644
--- a/ruby-gnome2.spec
+++ b/ruby-gnome2.spec
@@ -23,6 +23,7 @@ License: LGPL v2.1
Group: Development/Languages
Source0: http://downloads.sourceforge.net/ruby-gnome2/%{name}-all-%{version}.tar.gz
# Source0-md5: 852a528f8e58ca2729dada994c938be0
+Patch0: parse-error.patch
URL: http://ruby-gnome2.sourceforge.jp/
BuildRequires: atk-devel >= 1.0
BuildRequires: cairo-devel >= 1.10.0
@@ -409,6 +410,7 @@ Przykłady do Ruby-GNOME2.
%prep
%setup -q -n %{name}-all-%{version}
find . -name '*.rb' | xargs sed -i -e '1s,#.*local/bin/ruby,#!%{_bindir}/ruby,'
+%patch0 -p1
cp -p glib2/README README.glib2
cp -p glib2/TODO TODO.glib2
diff --git a/parse-error.patch b/parse-error.patch
new file mode 100644
index 0000000..f1d2ccd
--- /dev/null
+++ b/parse-error.patch
@@ -0,0 +1,63 @@
+fix compiler (gcc 4.8) errors for ruby-gnome2:
+
+rbgtkcalendar.c: In function 'rg_display_options':
+/usr/include/ruby-2.0/ruby/ruby.h:446:18: error: expected '(' before '!' token
+ #define NIL_P(v) !((VALUE)(v) != Qnil)
+
+seems same error as here:
+https://github.com/shoes/shoes/issues/246
+--- ruby-gnome2-all-1.1.9/gtk2/ext/gtk2/rbgtkcalendar.c~ 2012-01-05 13:23:51.000000000 +0200
++++ ruby-gnome2-all-1.1.9/gtk2/ext/gtk2/rbgtkcalendar.c 2014-07-26 22:30:31.050939929 +0300
+@@ -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);
+--- ruby-gnome2-all-1.1.9/gtk2/ext/gtk2/rbgdkscreen.c~ 2012-01-05 13:23:51.000000000 +0200
++++ ruby-gnome2-all-1.1.9/gtk2/ext/gtk2/rbgdkscreen.c 2014-07-26 22:30:54.818646494 +0300
+@@ -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);
+--- ruby-gnome2-all-1.1.9/gtk2/ext/gtk2/rbgdkevent.c~ 2012-01-05 13:23:51.000000000 +0200
++++ ruby-gnome2-all-1.1.9/gtk2/ext/gtk2/rbgdkevent.c 2014-07-26 22:31:06.012469585 +0300
+@@ -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);
+--- ruby-gnome2-all-1.1.9/gdk3/ext/gdk3/rbgdkscreen.c~ 2012-01-05 13:23:51.000000000 +0200
++++ ruby-gnome2-all-1.1.9/gdk3/ext/gdk3/rbgdkscreen.c 2014-07-26 22:31:15.812898377 +0300
+@@ -214,7 +214,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);
+--- ruby-gnome2-all-1.1.9/gdk3/ext/gdk3/rbgdkevent.c~ 2012-01-05 13:23:51.000000000 +0200
++++ ruby-gnome2-all-1.1.9/gdk3/ext/gdk3/rbgdkevent.c 2014-07-26 22:31:26.213353421 +0300
+@@ -370,7 +370,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);
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/ruby-gnome2.git/commitdiff/51c9987a7b945c5950d7d13628e954aaf9a290e7
More information about the pld-cvs-commit
mailing list