fix build with php 5.4 and ruby 1.9.3

epel9
Dan Horák 13 years ago
parent d5519c9dc0
commit 7429e10c15

@ -0,0 +1,12 @@
diff -up libdmtx-0.7.2/wrapper/php/dmtx_write.c.php54 libdmtx-0.7.2/wrapper/php/dmtx_write.c
--- libdmtx-0.7.2/wrapper/php/dmtx_write.c.php54 2012-02-08 10:39:04.000000000 +0100
+++ libdmtx-0.7.2/wrapper/php/dmtx_write.c 2012-02-08 10:39:11.000000000 +0100
@@ -34,7 +34,7 @@ int le_dmtx_image;
ZEND_DECLARE_MODULE_GLOBALS(dmtx)
-static function_entry dmtx_functions[] = {
+static zend_function_entry dmtx_functions[] = {
PHP_FE(dmtx_write, NULL)
PHP_FE(dmtx_getRow, NULL)
PHP_FE(dmtx_getSize, NULL)

@ -0,0 +1,23 @@
diff -up libdmtx-0.7.2/wrapper/ruby/Rdmtx.c.ruby19 libdmtx-0.7.2/wrapper/ruby/Rdmtx.c
--- libdmtx-0.7.2/wrapper/ruby/Rdmtx.c.ruby19 2012-02-08 10:49:04.000000000 +0100
+++ libdmtx-0.7.2/wrapper/ruby/Rdmtx.c 2012-02-08 10:49:36.000000000 +0100
@@ -35,7 +35,7 @@ static VALUE rdmtx_decode(VALUE self, VA
VALUE safeImageString = StringValue(rawImageString);
- char * imageBuffer = RSTRING(safeImageString)->ptr;
+ char * imageBuffer = RSTRING_PTR(safeImageString);
int width = NUM2INT(rb_funcall(image, rb_intern("columns"), 0));
int height = NUM2INT(rb_funcall(image, rb_intern("rows"), 0));
@@ -90,8 +90,8 @@ static VALUE rdmtx_encode(VALUE self, VA
dmtxEncodeSetProp(enc, DmtxPropSizeRequest, DmtxSymbolSquareAuto);
/* Create barcode image */
- if (dmtxEncodeDataMatrix(enc, RSTRING(safeString)->len,
- (unsigned char *)RSTRING(safeString)->ptr) == DmtxFail) {
+ if (dmtxEncodeDataMatrix(enc, RSTRING_LEN(safeString),
+ (unsigned char *)RSTRING_PTR(safeString)) == DmtxFail) {
// printf("Fatal error !\n");
dmtxEncodeDestroy(&enc);
return Qnil;

@ -4,13 +4,15 @@
Name: libdmtx
Version: 0.7.2
Release: 5%{?dist}
Release: 6%{?dist}
Summary: Library for working with Data Matrix 2D bar-codes
Group: System Environment/Libraries
License: LGPLv2+
URL: http://www.libdmtx.org/
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2
Patch0: %{name}-0.7.2-php54.patch
Patch1: %{name}-0.7.2-ruby19.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: ImageMagick-devel
@ -88,6 +90,8 @@ The ruby-%{name} package contains bindings for using %{name} from Ruby.
%prep
%setup -q
%patch0 -p1 -b .php54
%patch1 -p1 -b .ruby19
# fix permissions
chmod a-x wrapper/{php,python}/README
@ -208,6 +212,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
* Wed Feb 08 2012 Dan Horák <dan[at]danny.cz> 0.7.2-6
- fix build with php 5.4 and ruby 1.9.3
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

Loading…
Cancel
Save