packages: ruby-eet/ruby-eet.spec, ruby-eet/ruby-eet-ruby1.9.patch (NEW) - u...

qboosh qboosh at pld-linux.org
Wed Jun 22 21:58:09 CEST 2011


Author: qboosh                       Date: Wed Jun 22 19:58:09 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- up to 0.1.4
- added ruby1.9 patch (fixes build with ruby 1.9)

---- Files affected:
packages/ruby-eet:
   ruby-eet.spec (1.7 -> 1.8) , ruby-eet-ruby1.9.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/ruby-eet/ruby-eet.spec
diff -u packages/ruby-eet/ruby-eet.spec:1.7 packages/ruby-eet/ruby-eet.spec:1.8
--- packages/ruby-eet/ruby-eet.spec:1.7	Sun Sep  9 14:20:56 2007
+++ packages/ruby-eet/ruby-eet.spec	Wed Jun 22 21:58:04 2011
@@ -1,44 +1,54 @@
 # $Revision$, $Date$
-Summary:	Ruby binding to the eet library
-Summary(pl.UTF-8):	Dowiązania języka Ruby do biblioteki eet
+Summary:	Ruby binding to the EET library
+Summary(pl.UTF-8):	Dowiązania języka Ruby do biblioteki EET
 Name:		ruby-eet
-Version:	0.1.3
-Release:	0.1
-License:	Ruby's
+Version:	0.1.4
+Release:	1
+License:	MIT
 Group:		Development/Languages
 Source0:	ftp://code-monkey.de/pub/ruby-eet/%{name}-%{version}.tar.gz
-# Source0-md5:	480d8c44af28099ce7c671b8a58db55a
+# Source0-md5:	f5ecfd0bd35063e9219be4983fcbf6c8
+Patch0:		%{name}-ruby1.9.patch
 URL:		http://code-monkey.de/pages/ruby-eet
 BuildRequires:	eet-devel
-BuildRequires:	rake >= 0.5.0
+BuildRequires:	pkgconfig
 BuildRequires:	rpmbuild(macros) >= 1.277
 BuildRequires:	ruby-devel
+BuildRequires:	ruby-rake >= 0.5.0
 %{?ruby_mod_ver_requires_eq}
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%define		ruby_hdrdir	%(%{__ruby} -r rbconfig -e 'print Config::CONFIG["rubyhdrdir"]')
+%define		ruby_arch	%(%{__ruby} -r rbconfig -e 'print Config::CONFIG["arch"]')
+
 %description
-Ruby binding to the eet library.
+Ruby binding to the EET library.
 
 %description -l pl.UTF-8
-Dowiązania języka Ruby do biblioteki eet.
+Dowiązania języka Ruby do biblioteki EET.
 
 %prep
 %setup -q
+%patch0 -p1 -b .orig
 
 %build
-CFLAGS="%{rpmcflags}" CC="%{__cc}" rake
+CFLAGS="%{rpmcflags} -I%{ruby_hdrdir} -I%{ruby_hdrdir}/ruby -I%{ruby_hdrdir}/%{ruby_arch}" \
+CC="%{__cc}" \
+rake -I.
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{ruby_sitelibdir},%{ruby_sitearchdir}}
 
-DESTDIR=$RPM_BUILD_ROOT rake install
+DESTDIR=$RPM_BUILD_ROOT \
+rake -I. install
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
+%doc AUTHORS COPYING ChangeLog NEWS README
 %{ruby_sitelibdir}/eet.rb
 %attr(755,root,root) %{ruby_sitearchdir}/eet_ext.so
 
@@ -48,6 +58,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.8  2011/06/22 19:58:04  qboosh
+- up to 0.1.4
+- added ruby1.9 patch (fixes build with ruby 1.9)
+
 Revision 1.7  2007/09/09 12:20:56  qboosh
 - updated URL
 

================================================================
Index: packages/ruby-eet/ruby-eet-ruby1.9.patch
diff -u /dev/null packages/ruby-eet/ruby-eet-ruby1.9.patch:1.1
--- /dev/null	Wed Jun 22 21:58:09 2011
+++ packages/ruby-eet/ruby-eet-ruby1.9.patch	Wed Jun 22 21:58:04 2011
@@ -0,0 +1,113 @@
+--- ruby-eet-0.1.4/rake/extensiontask.rb.orig	2007-03-23 12:05:12.000000000 +0100
++++ ruby-eet-0.1.4/rake/extensiontask.rb	2011-06-21 20:15:14.251399056 +0200
+@@ -99,14 +99,14 @@
+       for ext in env[:c_exts]
+         Rake::Task.create_rule '.'+env[:objext] => '.'+ext do |r|
+           sh_cmd :cc, :cflags, :cppflags, {'-D' => :defines}, {'-I' => :includedirs}, {'-I' => :topdir},
+-                '-c', '-o', r.name, r.sources
++                '-c', '-o', r.name, r.sources.join(' ')
+         end
+       end
+ 
+       for ext in env[:cpp_exts]
+         Rake::Task.create_rule '.'+env[:objext] => '.'+ext do |r|
+           sh_cmd :cxx, :cxxflags, :cppflags, {'-D' => :defines}, {'-I' => :includedirs}, {'-I' => :topdir},
+-                '-o', r.name, '-c', r.sources
++                '-o', r.name, '-c', r.sources.join(' ')
+         end
+       end
+     end
+--- ruby-eet-0.1.4/ext/ext.c.orig	2007-03-23 12:21:39.000000000 +0100
++++ ruby-eet-0.1.4/ext/ext.c	2011-06-22 18:30:59.144082600 +0200
+@@ -334,7 +334,7 @@
+ 	cbuf = StringValuePtr (buf);
+ 
+ 	n = eet_write (*ef, ckey,
+-	               cbuf, RSTRING (buf)->len,
++	               cbuf, RSTRING_LEN(buf),
+ 	               comp == Qtrue);
+ 	if (!n)
+ 		rb_raise (rb_eIOError, "couldn't write to file");
+@@ -445,7 +445,7 @@
+ 			quality = FIX2INT (tmp);
+ 	}
+ 
+-	if (!RSTRING (buf)->len)
++	if (!RSTRING_LEN(buf))
+ 		return INT2FIX (0);
+ 
+ 	n = eet_data_image_write (*ef, ckey, cbuf,
+@@ -472,8 +472,8 @@
+ 	/* libeet uses a signed 32bit integer to store the
+ 	 * chunk size, so make sure we don't overflow it
+ 	 */
+-	tag_len = RSTRING (tag)->len;
+-	data_len = RSTRING (data)->len;
++	tag_len = RSTRING_LEN(tag);
++	data_len = RSTRING_LEN(data);
+ 	tmp = tag_len + 1 + data_len;
+ 
+ 	if (tmp < tag_len || tmp < data_len || tmp < 1 || tmp >= 2147483647L)
+@@ -499,26 +499,26 @@
+ 	tmp = rb_ivar_get (self, id_data);
+ 	data = RSTRING (tmp);
+ 
+-	buf_len = 9 + tag->len + data->len;
++	buf_len = 9 + RSTRING_LEN(tag) + RSTRING_LEN(data);
+ 	ret = rb_str_buf_new (buf_len);
+ 
+-	buf = (unsigned char *) RSTRING (ret)->ptr;
+-	RSTRING (ret)->len = buf_len;
++	buf = (unsigned char *) RSTRING_PTR(ret);
++	rb_str_set_len(ret, buf_len);
+ 
+ 	memcpy (buf, "CHnK", 4);
+ 	buf += 4;
+ 
+-	size = tag->len + data->len + 1;
++	size = RSTRING_LEN(tag) + RSTRING_LEN(data) + 1;
+ 	size = BSWAP32 (size);
+ 	memcpy (buf, &size, 4);
+ 	buf += 4;
+ 
+-	memcpy (buf, tag->ptr, tag->len);
+-	buf += tag->len;
++	memcpy (buf, RSTRING_PTR(tag), RSTRING_LEN(tag));
++	buf += RSTRING_LEN(tag);
+ 
+ 	*buf++ = 0;
+ 
+-	memcpy (buf, data->ptr, data->len);
++	memcpy (buf, RSTRING_PTR(data), RSTRING_LEN(data));
+ 
+ 	return ret;
+ }
+@@ -561,13 +561,13 @@
+ 	props = rb_funcall (self, id_to_eet_properties, 0);
+ 
+ 	if (rb_obj_is_kind_of (props, rb_cHash) == Qfalse ||
+-	    !RHASH (props)->tbl->num_entries)
++	    !RHASH_TBL(props)->num_entries)
+ 		rb_raise (ePropError, "invalid EET properties");
+ 
+ 	name = rb_funcall (self, id_to_eet_name, 0);
+ 	StringValue (name);
+ 
+-	if (!RSTRING (name)->len ||
++	if (!RSTRING_LEN(name) ||
+ 	    rb_funcall (name, id_include, 1, INT2FIX (0)))
+ 		rb_raise (eNameError, "invalid EET name");
+ 
+@@ -578,9 +578,9 @@
+ #else
+ 	keys = RARRAY (rb_funcall (props, id_keys, 0));
+ 
+-	for (i = 0; i < keys->len; i++)
+-		for_each_prop (keys->ptr[i],
+-		               rb_hash_aref (props, keys->ptr[i]),
++	for (i = 0; i < RARRAY_LEN(keys); i++)
++		for_each_prop (RARRAY_PTR(keys)[i],
++		               rb_hash_aref (props, RARRAY_PTR(keys)[i]),
+ 		               stream);
+ #endif
+ 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/ruby-eet/ruby-eet.spec?r1=1.7&r2=1.8&f=u



More information about the pld-cvs-commit mailing list