]> git.pld-linux.org Git - packages/gdal.git/blame - gdal-ruby.patch
- merged 1.8.0 from DEVEL (libtiff 4 required)
[packages/gdal.git] / gdal-ruby.patch
CommitLineData
f5a12c65
JK
1diff -dur gdal-1.7.2.orig/swig/ruby/RubyMakefile.mk gdal-1.7.2/swig/ruby/RubyMakefile.mk
2--- gdal-1.7.2.orig/swig/ruby/RubyMakefile.mk 2010-04-24 01:22:08.000000000 +0200
3+++ gdal-1.7.2/swig/ruby/RubyMakefile.mk 2010-06-12 11:15:23.000000000 +0200
4@@ -17,15 +17,15 @@
8afbe111
JB
5
6 include $(GDAL_ROOT)/GDALmake.opt
7
8-RUBY_MODULES = gdal.so ogr.so gdalconst.so osr.so
f5a12c65
JK
9-RUBY_INCLUDE_DIR := $(shell ruby -rrbconfig -e "puts Config::CONFIG['archdir']")
10+RUBY_INCLUDE_DIR := $(shell ruby -rrbconfig -e "puts Config::CONFIG['rubyhdrdir']")
8afbe111 11+RUBY_MODULES = gdal.la ogr.la gdalconst.la osr.la
8afbe111
JB
12 RUBY_LIB_DIR := $(shell ruby -rrbconfig -e "puts Config::CONFIG['libdir']")
13 RUBY_SO_NAME := $(shell ruby -rrbconfig -e "puts Config::CONFIG['RUBY_SO_NAME']")
f5a12c65 14 RUBY_EXTENSIONS_DIR := $(shell ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")
8afbe111
JB
15 INSTALL_DIR := $(RUBY_EXTENSIONS_DIR)/gdal
16
f5a12c65
JK
17-RUBY_INCLUDE = -I$(RUBY_INCLUDE_DIR)
18+RUBY_INCLUDE = -I$(RUBY_INCLUDE_DIR) -I$(RUBY_INCLUDE_DIR)/$(shell ruby -rrbconfig -e "puts Config::CONFIG['arch']")
19-LDFLAGS += -Xcompiler -shared -L$(RUBY_LIB_DIR)
20+LDFLAGS += -Xcompiler -shared -module -avoid-version -rpath $(INSTALL_DIR) -L$(RUBY_LIB_DIR)
8afbe111
JB
21 RUBY_LIB := -l$(RUBY_SO_NAME)
22
23 build: $(RUBY_MODULES)
f5a12c65 24@@ -43,14 +43,14 @@
8afbe111 25 install: $(INSTALL_DIR)
c332d2a9
JB
26 $(INSTALL) $(RUBY_MODULES) $(DESTDIR)$(INSTALL_DIR)
27
8afbe111 28-$(RUBY_MODULES): %.so: %_wrap.o
c332d2a9 29- $(LD) $(LDFLAGS) $(LIBS) $(GDAL_SLIB_LINK) $(RUBY_LIB) $< -o $@
8afbe111 30+$(RUBY_MODULES): %.la: %_wrap.lo
c332d2a9
JB
31+ $(LD) $(GDAL_SLIB_LINK) $(LDFLAGS) $(LIBS) $(RUBY_LIB) $< -o $@
32
8afbe111
JB
33-%.o: %.cpp
34+%.lo: %.cpp
35 $(CXX) $(CFLAGS) $(GDAL_INCLUDE) $(RUBY_INCLUDE) -c $<
c332d2a9 36
8afbe111
JB
37-%.o: %.cxx
38+%.lo: %.cxx
39 $(CXX) $(CFLAGS) $(GDAL_INCLUDE) $(RUBY_INCLUDE) -c $<
c332d2a9 40
8afbe111
JB
41-%.o: %.c
42+%.lo: %.c
43 $(CC) $(CFLAGS) $(GDAL_INCLUDE) $(RUBY_INCLUDE) -c $<
f5a12c65
JK
44diff -dur gdal-1.7.2.orig/swig/include/ruby/gdal_ruby.i gdal-1.7.2/swig/include/ruby/gdal_ruby.i
45--- gdal-1.7.2.orig/swig/include/ruby/gdal_ruby.i 2010-04-24 01:22:09.000000000 +0200
46+++ gdal-1.7.2/swig/include/ruby/gdal_ruby.i 2010-06-12 14:21:11.000000000 +0200
47@@ -36,7 +36,7 @@
48 CPLXMLNode *psChild;
49 char *pszText = NULL;
50
51- nChildCount = RARRAY(rubyArray)->len - 2;
52+ nChildCount = RARRAY_LEN(rubyArray) - 2;
53 if( nChildCount < 0 )
54 {
55 rb_raise(rb_eRuntimeError, "Error in input XMLTree, child count is less than zero.");
56diff -dur gdal-1.7.2.orig/swig/include/ruby/typemaps_ruby.i gdal-1.7.2/swig/include/ruby/typemaps_ruby.i
57--- gdal-1.7.2.orig/swig/include/ruby/typemaps_ruby.i 2010-04-24 01:22:09.000000000 +0200
58+++ gdal-1.7.2/swig/include/ruby/typemaps_ruby.i 2010-06-12 14:22:07.000000000 +0200
59@@ -147,7 +147,7 @@
60 Check_Type($input, T_ARRAY);
61
62 /* Get the length */
63- int seq_size = RARRAY($input)->len;
64+ int seq_size = RARRAY_LEN($input);
65
66 if ( seq_size != $dim0 ) {
67 rb_raise(rb_eRangeError, "sequence must have length %i.", seq_size);
68@@ -225,7 +225,7 @@
69 Check_Type($input, T_ARRAY);
70
71 /* Get the length */
72- $1 = RARRAY($input)->len;
73+ $1 = RARRAY_LEN($input);
74
75 /* Allocate space for the C array. */
76 $2 = (int*) malloc($1*sizeof(int));
77@@ -315,7 +315,7 @@
78 /* Check if is a list */
79 Check_Type($input, T_ARRAY);
80
81- $1 = RARRAY($input)->len;
82+ $1 = RARRAY_LEN($input);
83 tmpGCPList = (GDAL_GCP*) malloc($1*sizeof(GDAL_GCP));
84 $2 = tmpGCPList;
85
86@@ -386,7 +386,7 @@
87 /* is the provided object an array or a hash? */
88 if ( TYPE($input) == T_ARRAY) {
89 /* get the size of the array */
90- int size = RARRAY($input)->len;
91+ int size = RARRAY_LEN($input);
92
93 for (int i = 0; i < size; i++) {
94 /* get the ruby object */
95@@ -489,7 +489,7 @@
96 /* Check if is a list */
97 Check_Type($input, T_ARRAY);
98
99- int size = RARRAY($input)->len;
100+ int size = RARRAY_LEN($input);
101 for (int i = 0; i < size; i++) {
102 VALUE item = rb_ary_entry($input, i);
103 char *pszItem = StringValuePtr(item);
104@@ -744,4 +744,4 @@
105 /* %typemap(out) GByte* */
106
107 /* Stops insertion of default type map. */
108-}
109\ No newline at end of file
110+}
This page took 0.054799 seconds and 4 git commands to generate.