]>
Commit | Line | Data |
---|---|---|
ceaebfc7 JB |
1 | --- xmms2-0.4DrKosmos/src/clients/lib/ruby/wscript.orig 2023-05-20 14:47:32.535910875 +0200 |
2 | +++ xmms2-0.4DrKosmos/src/clients/lib/ruby/wscript 2023-05-20 14:55:29.619992955 +0200 | |
3 | @@ -51,17 +51,17 @@ def configure(conf): | |
0841a5c2 JB |
4 | return False |
5 | conf.check_message('ruby version', '> 1.8', True, version) | |
6 | ||
7 | - ruby_h = os.popen(ruby + " -rrbconfig -e 'puts File.exist?(Config::CONFIG[\"archdir\"] + \"/ruby.h\")'").read().strip() | |
8 | + ruby_h = os.popen(ruby + " -rrbconfig -e 'puts File.exist?(RbConfig::CONFIG[\"rubyhdrdir\"] + \"/ruby.h\")'").read().strip() | |
9 | if ruby_h != 'true': | |
10 | conf.check_message('ruby', 'header file', False) | |
11 | return False | |
12 | conf.check_message('ruby', 'header file', True) | |
13 | ||
14 | - dir = os.popen(ruby + " -rrbconfig -e 'puts \"%s\" % [].fill(Config::CONFIG[\"archdir\"], 0..1)'").read().strip() | |
15 | + dir = os.popen(ruby + " -rrbconfig -e 'puts \"%s\" % [].fill(RbConfig::CONFIG[\"rubyhdrdir\"], 0..1)'").read().strip() | |
ceaebfc7 | 16 | conf.env["CPPPATH_ruby"] = dir |
0841a5c2 JB |
17 | conf.env["LINKFLAGS_ruby"] = '-L%s' % dir |
18 | ||
ceaebfc7 JB |
19 | - ldflags = os.popen(ruby + " -rrbconfig -e 'print Config::CONFIG[\"LDSHARED\"]'").read().strip() |
20 | + ldflags = os.popen(ruby + " -rrbconfig -e 'print RbConfig::CONFIG[\"LDSHARED\"]'").read().strip() | |
21 | # ok this is really stupid, but the command and flags are combined. | |
22 | # so we try to find the first argument... | |
23 | flags = ldflags.split() | |
24 | @@ -69,26 +69,26 @@ def configure(conf): | |
25 | flags = flags[1:] | |
26 | conf.env["LINKFLAGS_ruby"] += " "+" ".join(flags) | |
27 | ||
28 | - ldflags = os.popen(ruby + " -rrbconfig -e 'print Config::CONFIG[\"LIBS\"]'").read().strip() | |
29 | + ldflags = os.popen(ruby + " -rrbconfig -e 'print RbConfig::CONFIG[\"LIBS\"]'").read().strip() | |
30 | conf.env["LINKFLAGS_ruby"] += " "+ldflags | |
31 | - ldflags = os.popen(ruby + " -rrbconfig -e 'print Config::CONFIG[\"LIBRUBYARG_SHARED\"]'").read().strip() | |
32 | + ldflags = os.popen(ruby + " -rrbconfig -e 'print RbConfig::CONFIG[\"LIBRUBYARG_SHARED\"]'").read().strip() | |
33 | conf.env["LINKFLAGS_ruby"] += " "+ldflags | |
34 | ||
35 | - cflags = os.popen(ruby + " -rrbconfig -e 'print Config::CONFIG[\"CCDLFLAGS\"]'").read().strip() | |
36 | + cflags = os.popen(ruby + " -rrbconfig -e 'print RbConfig::CONFIG[\"CCDLFLAGS\"]'").read().strip() | |
37 | conf.env["CCFLAGS_ruby"] = cflags | |
38 | ||
0841a5c2 JB |
39 | if not Params.g_options.rubyarchdir: |
40 | - conf.env["ARCHDIR_ruby"] = os.popen(ruby + " -rrbconfig -e 'print Config::CONFIG[\"sitearchdir\"]'").read().strip() | |
41 | + conf.env["ARCHDIR_ruby"] = os.popen(ruby + " -rrbconfig -e 'print RbConfig::CONFIG[\"vendorarchdir\"]'").read().strip() | |
42 | else: | |
43 | conf.env["ARCHDIR_ruby"] = Params.g_options.rubyarchdir | |
44 | ||
45 | if not Params.g_options.rubylibdir: | |
46 | - conf.env["LIBDIR_ruby"] = os.popen(ruby + " -rrbconfig -e 'print Config::CONFIG[\"sitelibdir\"]'").read().strip() | |
47 | + conf.env["LIBDIR_ruby"] = os.popen(ruby + " -rrbconfig -e 'print RbConfig::CONFIG[\"vendorlibdir\"]'").read().strip() | |
48 | else: | |
49 | conf.env["LIBDIR_ruby"] = Params.g_options.rubylibdir | |
50 | ||
ceaebfc7 JB |
51 | conf.env["rubyext_PREFIX"] = '' |
52 | - conf.env["rubyext_SUFFIX"] = '.' + os.popen(ruby + " -rrbconfig -e 'print Config::CONFIG[\"DLEXT\"]'").read().strip() | |
53 | + conf.env["rubyext_SUFFIX"] = '.' + os.popen(ruby + " -rrbconfig -e 'print RbConfig::CONFIG[\"DLEXT\"]'").read().strip() | |
54 | conf.env["rubyext_USELIB"] = "ruby" | |
55 | conf.env["rubyext_obj_ext"] = conf.env["shlib_obj_ext"] | |
56 | ||
0841a5c2 JB |
57 | --- xmms2-0.2DrJekyll/src/clients/lib/ruby/rb_xmmsclient.c.orig 2023-05-14 19:24:29.670968613 +0200 |
58 | +++ xmms2-0.2DrJekyll/src/clients/lib/ruby/rb_xmmsclient.c 2023-05-14 19:29:16.606080819 +0200 | |
59 | @@ -73,8 +73,8 @@ | |
f786859b JB |
60 | StringValue (arg1); \ |
61 | \ | |
62 | res = xmmsc_##name (xmms->real, \ | |
63 | - (unsigned char *) RSTRING (arg1)->ptr, \ | |
64 | - RSTRING (arg1)->len); \ | |
65 | + (unsigned char *) RSTRING_PTR (arg1), \ | |
66 | + RSTRING_LEN (arg1)); \ | |
67 | METHOD_HANDLER_FOOTER | |
68 | ||
0841a5c2 JB |
69 | static VALUE cPlaylist; |
70 | @@ -1371,10 +1371,10 @@ parse_string_array (VALUE value) | |
71 | if (!NIL_P (rb_check_array_type (value))) { | |
72 | struct RArray *ary = RARRAY (value); | |
73 | ||
74 | - ret = malloc (sizeof (char *) * (ary->len + 1)); | |
75 | + ret = malloc (sizeof (char *) * (RARRAY_LEN(ary) + 1)); | |
76 | ||
77 | - for (i = 0; i < ary->len; i++) | |
78 | - ret[i] = StringValuePtr (ary->ptr[i]); | |
79 | + for (i = 0; i < RARRAY_LEN(ary); i++) | |
80 | + ret[i] = StringValuePtr (RARRAY_PTR(ary)[i]); | |
81 | ||
82 | ret[i] = NULL; | |
83 | } else { | |
f786859b JB |
84 | --- xmms2-0.2DrGonzo/src/clients/lib/ruby/rb_result.c.orig 2006-09-26 15:50:20.000000000 +0200 |
85 | +++ xmms2-0.2DrGonzo/src/clients/lib/ruby/rb_result.c 2023-05-13 18:40:37.719962752 +0200 | |
86 | @@ -417,6 +417,7 @@ c_propdict_init (VALUE self, VALUE resul | |
4a810f76 JB |
87 | return self; |
88 | } | |
89 | ||
90 | +#ifdef HAVE_RB_PROTECT_INSPECT | |
f786859b JB |
91 | static VALUE |
92 | propdict_inspect_cb (VALUE args, VALUE s) | |
4a810f76 | 93 | { |
f786859b | 94 | @@ -459,6 +460,7 @@ c_propdict_inspect (VALUE self) |
4a810f76 JB |
95 | { |
96 | return rb_protect_inspect (propdict_inspect, self, 0); | |
97 | } | |
98 | +#endif | |
99 | ||
f786859b JB |
100 | static VALUE |
101 | c_propdict_aref (VALUE self, VALUE key) | |
102 | @@ -629,7 +631,9 @@ Init_Result (VALUE mXmms) | |
4a810f76 JB |
103 | cPropDict = rb_define_class_under (mXmms, "PropDict", rb_cObject); |
104 | ||
105 | rb_define_method (cPropDict, "initialize", c_propdict_init, 1); | |
106 | +#ifdef HAVE_RB_PROTECT_INSPECT | |
107 | rb_define_method (cPropDict, "inspect", c_propdict_inspect, 0); | |
108 | +#endif | |
109 | ||
110 | rb_define_method (cPropDict, "[]", c_propdict_aref, 1); | |
111 | rb_define_method (cPropDict, "has_key?", c_propdict_has_key, 1); | |
0841a5c2 JB |
112 | --- xmms2-0.2DrJekyll/src/clients/lib/ruby/rb_playlist.c.orig 2007-05-20 17:55:40.000000000 +0200 |
113 | +++ xmms2-0.2DrJekyll/src/clients/lib/ruby/rb_playlist.c 2023-05-18 20:59:44.461066374 +0200 | |
114 | @@ -301,10 +301,10 @@ c_sort (VALUE self, VALUE props) | |
115 | if (!NIL_P (props = rb_check_array_type (props))) { | |
116 | ary = RARRAY (props); | |
117 | ||
118 | - cprops = malloc (sizeof (char *) * (ary->len + 1)); | |
119 | + cprops = malloc (sizeof (char *) * (RARRAY_LEN(ary) + 1)); | |
120 | ||
121 | - for (i = 0; i < ary->len; i++) | |
122 | - cprops[i] = StringValuePtr (ary->ptr[i]); | |
123 | + for (i = 0; i < RARRAY_LEN(ary); i++) | |
124 | + cprops[i] = StringValuePtr (RARRAY_PTR(ary)[i]); | |
125 | ||
126 | cprops[i] = NULL; | |
127 | } else if (!NIL_P (rb_check_string_type (props))) { | |
128 | --- xmms2-0.2DrJekyll/src/clients/lib/ruby/rb_collection.c.orig 2007-05-20 17:55:40.000000000 +0200 | |
129 | +++ xmms2-0.2DrJekyll/src/clients/lib/ruby/rb_collection.c 2023-05-18 21:13:17.603327871 +0200 | |
130 | @@ -220,10 +220,10 @@ c_coll_idlist_set (VALUE self, VALUE ids | |
131 | COLL_METHOD_HANDLER_HEADER | |
132 | ||
133 | rb_ary = RARRAY (ids); | |
134 | - ary = malloc (sizeof (unsigned int *) * (rb_ary->len + 1)); | |
135 | + ary = malloc (sizeof (unsigned int *) * (RARRAY_LEN(rb_ary) + 1)); | |
136 | ||
137 | - for (i = 0; i < rb_ary->len; i++) | |
138 | - ary[i] = NUM2UINT (rb_ary->ptr[i]); | |
139 | + for (i = 0; i < RARRAY_LEN(rb_ary); i++) | |
140 | + ary[i] = NUM2UINT (RARRAY_PTR(rb_ary)[i]); | |
141 | ||
142 | ary[i] = 0; | |
143 | ||
144 | @@ -263,10 +263,10 @@ attrs_inspect_cb (VALUE args, VALUE s) | |
145 | { | |
146 | VALUE key, value; | |
147 | ||
148 | - key = RARRAY (args)->ptr[0]; | |
149 | - value = RARRAY (args)->ptr[1]; | |
150 | + key = RARRAY_PTR(args)[0]; | |
151 | + value = RARRAY_PTR(args)[1]; | |
152 | ||
153 | - if (RSTRING (s)->len > 1) | |
154 | + if (RSTRING_LEN (s) > 1) | |
155 | rb_str_buf_cat2 (s, ", "); | |
156 | ||
157 | rb_str_buf_append (s, rb_inspect (key)); |