[packages/weechat] - rel 2; ruby fixes

arekm arekm at pld-linux.org
Tue Apr 23 21:04:58 CEST 2013


commit 2a9053cb43832f609485f7e73cb0923d9adf683e
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Tue Apr 23 21:04:55 2013 +0200

    - rel 2; ruby fixes

 weechat-0.4.0-ruby-2.0-crash.patch | 87 ++++++++++++++++++++++++++++++++++++++
 weechat-0.4.0-ruby-version.patch   | 11 +++++
 weechat.spec                       |  6 ++-
 3 files changed, 103 insertions(+), 1 deletion(-)
---
diff --git a/weechat.spec b/weechat.spec
index f4dab4d..fdb3dd8 100644
--- a/weechat.spec
+++ b/weechat.spec
@@ -19,7 +19,7 @@ Summary:	WeeChat - fast and light chat environment
 Summary(pl.UTF-8):	WeeChat - szybkie i lekkie środowisko do rozmów
 Name:		weechat
 Version:	0.4.0
-Release:	1
+Release:	2
 License:	GPL v3+
 Group:		Applications/Communications
 Source0:	http://www.weechat.org/files/src/%{name}-%{version}.tar.gz
@@ -28,6 +28,8 @@ Patch0:		%{name}-ac.patch
 Patch1:		%{name}-plugins_header.patch
 Patch2:		%{name}-curses.patch
 Patch3:		findguile.patch
+Patch4:		weechat-0.4.0-ruby-2.0-crash.patch
+Patch5:		weechat-0.4.0-ruby-version.patch
 URL:		http://www.weechat.org/
 %{?with_aspell:BuildRequires:	aspell-devel}
 BuildRequires:	cmake
@@ -94,6 +96,8 @@ HTML documentation for weechat.
 %patch1 -p1
 %patch2 -p0
 %patch3 -p1
+%patch4 -p1
+%patch5 -p1
 
 %{__sed} -i -e 's#PYTHON_LIB=.*#PYTHON_LIB=%{_libdir}#g' configure.in
 %{__sed} -i -e 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/' configure.in
diff --git a/weechat-0.4.0-ruby-2.0-crash.patch b/weechat-0.4.0-ruby-2.0-crash.patch
new file mode 100644
index 0000000..5ac4e2d
--- /dev/null
+++ b/weechat-0.4.0-ruby-2.0-crash.patch
@@ -0,0 +1,87 @@
+From 4fdbb83a079f24a742633fd4d02084911580c19c Mon Sep 17 00:00:00 2001
+From: Sebastien Helleu <flashcode at flashtux.org>
+Date: Fri, 22 Mar 2013 19:54:44 +0100
+Subject: [PATCH] ruby: fix crash with Ruby 2.0: use one array for the last 6
+ arguments of function config_new_option (bug #31050)
+
+---
+ src/plugins/ruby/weechat-ruby-api.c | 38 +++++++++++++++++++------------------
+ 1 file changed, 20 insertions(+), 18 deletions(-)
+
+diff --git a/src/plugins/ruby/weechat-ruby-api.c b/src/plugins/ruby/weechat-ruby-api.c
+index bbc2fbc..101caec 100644
+--- a/src/plugins/ruby/weechat-ruby-api.c
++++ b/src/plugins/ruby/weechat-ruby-api.c
+@@ -1333,28 +1333,21 @@ weechat_ruby_api_config_new_option (VALUE class, VALUE config_file,
+                                     VALUE description, VALUE string_values,
+                                     VALUE min, VALUE max, VALUE default_value,
+                                     VALUE value, VALUE null_value_allowed,
+-                                    VALUE function_check_value,
+-                                    VALUE data_check_value,
+-                                    VALUE function_change,
+-                                    VALUE data_change,
+-                                    VALUE function_delete,
+-                                    VALUE data_delete)
++                                    VALUE callbacks)
+ {
+     char *c_config_file, *c_section, *c_name, *c_type, *c_description;
+     char *c_string_values, *c_default_value, *c_value;
+     char *c_function_check_value, *c_data_check_value, *c_function_change;
+     char *c_data_change, *c_function_delete, *c_data_delete, *result;
+     int c_min, c_max, c_null_value_allowed;
+-    VALUE return_value;
++    VALUE function_check_value, data_check_value, function_change, data_change;
++    VALUE function_delete, data_delete, return_value;
+ 
+     API_FUNC(1, "config_new_option", API_RETURN_EMPTY);
+     if (NIL_P (config_file) || NIL_P (section) || NIL_P (name) || NIL_P (type)
+         || NIL_P (description) || NIL_P (string_values) || NIL_P (min)
+         || NIL_P (max) || NIL_P (default_value) || NIL_P (value)
+-        || NIL_P (null_value_allowed) || NIL_P (function_check_value)
+-        || NIL_P (data_check_value) || NIL_P (function_change)
+-        || NIL_P (data_change) || NIL_P (function_delete)
+-        || NIL_P (data_delete))
++        || NIL_P (null_value_allowed) || NIL_P (callbacks))
+         API_WRONG_ARGS(API_RETURN_EMPTY);
+ 
+     Check_Type (config_file, T_STRING);
+@@ -1368,12 +1361,21 @@ weechat_ruby_api_config_new_option (VALUE class, VALUE config_file,
+     Check_Type (default_value, T_STRING);
+     Check_Type (value, T_STRING);
+     Check_Type (null_value_allowed, T_FIXNUM);
+-    Check_Type (function_check_value, T_STRING);
+-    Check_Type (data_check_value, T_STRING);
+-    Check_Type (function_change, T_STRING);
+-    Check_Type (data_change, T_STRING);
+-    Check_Type (function_delete, T_STRING);
+-    Check_Type (data_delete, T_STRING);
++    Check_Type (callbacks, T_ARRAY);
++
++    /*
++     * due to a Ruby limitation (15 arguments max by function), we receive the
++     * the callbacks in an array of 6 strings (3 callbacks + 3 data)
++     */
++    if (RARRAY_LEN(callbacks) != 6)
++        API_WRONG_ARGS(API_RETURN_EMPTY);
++
++    function_check_value = rb_ary_entry (callbacks, 0);
++    data_check_value = rb_ary_entry (callbacks, 1);
++    function_change = rb_ary_entry (callbacks, 2);
++    data_change = rb_ary_entry (callbacks, 3);
++    function_delete = rb_ary_entry (callbacks, 4);
++    data_delete = rb_ary_entry (callbacks, 5);
+ 
+     c_config_file = StringValuePtr (config_file);
+     c_section = StringValuePtr (section);
+@@ -5915,7 +5917,7 @@ weechat_ruby_api_init (VALUE ruby_mWeechat)
+     API_DEF_FUNC(config_new, 3);
+     API_DEF_FUNC(config_new_section, 14);
+     API_DEF_FUNC(config_search_section, 2);
+-    API_DEF_FUNC(config_new_option, 17);
++    API_DEF_FUNC(config_new_option, 12);
+     API_DEF_FUNC(config_search_option, 3);
+     API_DEF_FUNC(config_string_to_boolean, 1);
+     API_DEF_FUNC(config_option_reset, 2);
+-- 
+1.8.1.4
+
diff --git a/weechat-0.4.0-ruby-version.patch b/weechat-0.4.0-ruby-version.patch
new file mode 100644
index 0000000..3463221
--- /dev/null
+++ b/weechat-0.4.0-ruby-version.patch
@@ -0,0 +1,11 @@
+--- a/cmake/FindRuby.cmake
++++ b/cmake/FindRuby.cmake
+@@ -58,7 +58,7 @@
+     )
+ 
+   EXECUTE_PROCESS(
+-    COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['ruby_version']"
++    COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['RUBY_PROGRAM_VERSION']"
+     OUTPUT_VARIABLE RUBY_VERSION
+     )
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/weechat.git/commitdiff/2a9053cb43832f609485f7e73cb0923d9adf683e



More information about the pld-cvs-commit mailing list