From 7429e10c1530b968d279c94540b9ace6ed001279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Wed, 8 Feb 2012 10:54:15 +0100 Subject: [PATCH] fix build with php 5.4 and ruby 1.9.3 --- libdmtx-0.7.2-php54.patch | 12 ++++++++++++ libdmtx-0.7.2-ruby19.patch | 23 +++++++++++++++++++++++ libdmtx.spec | 9 ++++++++- 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 libdmtx-0.7.2-php54.patch create mode 100644 libdmtx-0.7.2-ruby19.patch diff --git a/libdmtx-0.7.2-php54.patch b/libdmtx-0.7.2-php54.patch new file mode 100644 index 0000000..b360697 --- /dev/null +++ b/libdmtx-0.7.2-php54.patch @@ -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) diff --git a/libdmtx-0.7.2-ruby19.patch b/libdmtx-0.7.2-ruby19.patch new file mode 100644 index 0000000..f42d2af --- /dev/null +++ b/libdmtx-0.7.2-ruby19.patch @@ -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; diff --git a/libdmtx.spec b/libdmtx.spec index 439ee69..fab8774 100644 --- a/libdmtx.spec +++ b/libdmtx.spec @@ -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 0.7.2-6 +- fix build with php 5.4 and ruby 1.9.3 + * Fri Jan 13 2012 Fedora Release Engineering - 0.7.2-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild