[geos/f17: 1/2] Rebuilt for Ruby 1.9.3. Rebuilt for PHP 5.4.
Vít Ondruch
vondruch at fedoraproject.org
Mon Feb 27 16:07:56 UTC 2012
commit ff338a31e048a5f03226c11112c88600b97cf4f7
Author: Vít Ondruch <vondruch at redhat.com>
Date: Mon Feb 27 17:07:13 2012 +0100
Rebuilt for Ruby 1.9.3.
Rebuilt for PHP 5.4.
geos-3.2.0-ARM.patch | 13 -------
geos-3.3.2-php-5.4.patch | 89 ++++++++++++++++++++++++++++++++++++++++++++++
geos-3.3.2-ruby-19.patch | 13 +++++++
geos.spec | 27 ++++++++++----
4 files changed, 122 insertions(+), 20 deletions(-)
---
diff --git a/geos-3.3.2-php-5.4.patch b/geos-3.3.2-php-5.4.patch
new file mode 100644
index 0000000..1699202
--- /dev/null
+++ b/geos-3.3.2-php-5.4.patch
@@ -0,0 +1,89 @@
+Index: php/geos.c
+===================================================================
+--- php/geos.c (revision 3573)
++++ php/geos.c (working copy)
+@@ -44,7 +44,11 @@
+ PHP_FUNCTION(GEOSSharedPaths);
+ PHP_FUNCTION(GEOSRelateMatch);
+
++#if PHP_VERSION_ID < 50399
+ static function_entry geos_functions[] = {
++#else
++static zend_function_entry geos_functions[] = {
++#endif
+ PHP_FE(GEOSVersion, NULL)
+ PHP_FE(GEOSPolygonize, NULL)
+ PHP_FE(GEOSLineMerge, NULL)
+@@ -161,8 +165,12 @@
+
+ ALLOC_HASHTABLE(obj->std.properties);
+ zend_hash_init(obj->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
++#if PHP_VERSION_ID < 50399
+ zend_hash_copy(obj->std.properties, &type->default_properties,
+ (copy_ctor_func_t)zval_add_ref, (void *)&tmp, sizeof(zval *));
++#else
++ object_properties_init(&(obj->std), type);
++#endif
+
+ retval.handle = zend_objects_store_put(obj, NULL, st, NULL TSRMLS_CC);
+ retval.handlers = handlers;
+@@ -233,7 +241,11 @@
+ PHP_METHOD(Geometry, hausdorffDistance);
+ PHP_METHOD(Geometry, snapTo);
+
++#if PHP_VERSION_ID < 50399
+ static function_entry Geometry_methods[] = {
++#else
++static zend_function_entry Geometry_methods[] = {
++#endif
+ PHP_ME(Geometry, __construct, NULL, 0)
+ PHP_ME(Geometry, __toString, NULL, 0)
+ PHP_ME(Geometry, project, NULL, 0)
+@@ -1906,7 +1918,11 @@
+ PHP_METHOD(WKTReader, __construct);
+ PHP_METHOD(WKTReader, read);
+
++#if PHP_VERSION_ID < 50399
+ static function_entry WKTReader_methods[] = {
++#else
++static zend_function_entry WKTReader_methods[] = {
++#endif
+ PHP_ME(WKTReader, __construct, NULL, 0)
+ PHP_ME(WKTReader, read, NULL, 0)
+ {NULL, NULL, NULL}
+@@ -1984,7 +2000,11 @@
+ PHP_METHOD(WKTWriter, getOutputDimension);
+ PHP_METHOD(WKTWriter, setOld3D);
+
++#if PHP_VERSION_ID < 50399
+ static function_entry WKTWriter_methods[] = {
++#else
++static zend_function_entry WKTWriter_methods[] = {
++#endif
+ PHP_ME(WKTWriter, __construct, NULL, 0)
+ PHP_ME(WKTWriter, write, NULL, 0)
+ PHP_ME(WKTWriter, setTrim, NULL, 0)
+@@ -2156,7 +2176,11 @@
+ PHP_METHOD(WKBWriter, getIncludeSRID);
+ PHP_METHOD(WKBWriter, writeHEX);
+
++#if PHP_VERSION_ID < 50399
+ static function_entry WKBWriter_methods[] = {
++#else
++static zend_function_entry WKBWriter_methods[] = {
++#endif
+ PHP_ME(WKBWriter, __construct, NULL, 0)
+ PHP_ME(WKBWriter, getOutputDimension, NULL, 0)
+ PHP_ME(WKBWriter, setOutputDimension, NULL, 0)
+@@ -2352,7 +2376,11 @@
+ PHP_METHOD(WKBReader, __construct);
+ PHP_METHOD(WKBReader, readHEX);
+
++#if PHP_VERSION_ID < 50399
+ static function_entry WKBReader_methods[] = {
++#else
++static zend_function_entry WKBReader_methods[] = {
++#endif
+ PHP_ME(WKBReader, __construct, NULL, 0)
+ PHP_ME(WKBReader, readHEX, NULL, 0)
+ {NULL, NULL, NULL}
diff --git a/geos-3.3.2-ruby-19.patch b/geos-3.3.2-ruby-19.patch
new file mode 100644
index 0000000..23d50d5
--- /dev/null
+++ b/geos-3.3.2-ruby-19.patch
@@ -0,0 +1,13 @@
+Index: swig/ruby/ruby.i
+===================================================================
+--- swig/ruby/ruby.i (revision 3104)
++++ swig/ruby/ruby.i (working copy)
+@@ -75,7 +75,7 @@
+ Check_Type($input, T_ARRAY);
+
+ /* Get the length */
+- $2 = RARRAY($input)->len;
++ $2 = RARRAY_LEN($input);
+
+ /* Allocate space for the C array. */
+ $1 = (GeosLinearRing**) malloc($2*sizeof(GeosLinearRing*));
diff --git a/geos.spec b/geos.spec
index 81cd38e..8d426f0 100644
--- a/geos.spec
+++ b/geos.spec
@@ -1,6 +1,6 @@
Name: geos
Version: 3.3.2
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: GEOS is a C++ port of the Java Topology Suite
Group: Applications/Engineering
@@ -10,6 +10,12 @@ Source0: http://download.osgeo.org/%{name}/%{name}-%{version}.tar.bz2
Patch0: geos-gcc43.patch
# fixed in upstream revision 3000
Patch1: geos-3.2.1-swig.patch
+# Fixes SWIG interface for Ruby 1.9 compatibility.
+# http://trac.osgeo.org/geos/ticket/379
+Patch2: geos-3.3.2-ruby-19.patch
+# Fixes PHP 5.4 build issues.
+# http://trac.osgeo.org/geos/ticket/513
+Patch3: geos-3.3.2-php-5.4.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: doxygen libtool
%if "%{?dist}" != ".el4"
@@ -18,7 +24,6 @@ BuildRequires: python-devel ruby-devel php-devel
%endif
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
-%{!?ruby_sitearch: %define ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"]')}
%{!?php_sitearch: %define php_sitearch %{_libdir}/php/modules}
%description
@@ -72,6 +77,8 @@ PHP module to build applications using GEOS and PHP
%prep
%setup -q
%patch0 -p0 -b .gcc43
+%patch2 -p0 -b .ruby19
+%patch3 -p0 -b .php54
%build
@@ -85,14 +92,16 @@ for makefile in `find . -type f -name 'Makefile.in'`; do
sed -i 's|@LIBTOOL@|%{_bindir}/libtool|g' $makefile
done
+# Use correct library placement for Ruby 1.9.
+sed -i 's|sitearchdir|vendorarchdir|' configure
+
%configure --disable-static --disable-dependency-tracking \
%if "%{?dist}" != ".el4"
--enable-python \
--enable-ruby \
--enable-php
%endif
-
-make %{?_smp_mflags}
+make %{?_smp_mflags} CPPFLAGS=-I`ruby -e 'puts File.join(RbConfig::CONFIG[%q(includedir)], RbConfig::CONFIG[%q(sitearch)])'`
# Make doxygen documentation files
cd doc
@@ -151,9 +160,9 @@ rm -rf %{buildroot}
%files ruby
%defattr(-,root,root,-)
-%exclude %{ruby_sitearch}/%{name}.a
-%exclude %{ruby_sitearch}/%{name}.la
-%{ruby_sitearch}/%{name}.so
+%exclude %{ruby_vendorarchdir}/%{name}.a
+%exclude %{ruby_vendorarchdir}/%{name}.la
+%{ruby_vendorarchdir}/%{name}.so
%files php
%defattr(-,root,root,-)
@@ -162,6 +171,10 @@ rm -rf %{buildroot}
%endif
%changelog
+* Mon Feb 27 2012 Vít Ondruch <vondruch at redhat.com> - 3.3.2-2
+- Rebuilt for Ruby 1.9.3.
+- Rebuilt for PHP 5.4.
+
* Mon Jan 09 2012 Devrim GUNDUZ <devrim at gunduz.org> - 3.3.2-1
- Update to 3.3.2
More information about the scm-commits
mailing list