comparison src/of-general-1-dev-fixes.patch @ 5074:0f111c0ba0b2

of-general: fix build with dev octave
author John W. Eaton <jwe@octave.org>
date Wed, 15 May 2019 00:31:44 -0400
parents
children b532bb8c51ba
comparison
equal deleted inserted replaced
5025:0cbc51911dd0 5074:0f111c0ba0b2
1 diff -uNr general-2.1.0-a/Makefile general-2.1.0-b/Makefile
2 --- general-2.1.0-a/Makefile 2018-05-13 17:01:51.400133935 -0400
3 +++ general-2.1.0-b/Makefile 2019-05-14 14:14:28.000000000 -0400
4 @@ -212,10 +212,8 @@
5
6 ## Test package.
7 octave_test_commands = \
8 -' pkgs = pkg("list","general"); cd (pkgs{1}.dir); dirs = { "." }; \
9 - dirs(cellfun (@ (x) ! isdir (x), dirs)) = []; \
10 - if (isempty (dirs)) error ("no \"inst\" or \"src\" directory"); exit (1); \
11 - else __run_test_suite__ (dirs, {}); endif '
12 +' pkgs = pkg("list","general"); dirs = { pkgs{1}.dir }; \
13 + __run_test_suite__ (dirs, {}); '
14 ## the following works, too, but provides no overall summary output as
15 ## __run_test_suite__ does:
16 ##
17 diff -uNr general-2.1.0-a/NEWS general-2.1.0-b/NEWS
18 --- general-2.1.0-a/NEWS 2018-05-13 17:01:51.400133935 -0400
19 +++ general-2.1.0-b/NEWS 2019-05-14 14:14:28.000000000 -0400
20 @@ -1,3 +1,9 @@
21 +Summary of important user-visible changes for general 2.1.0+:
22 +-------------------------------------------------------------------
23 +
24 + ** updated configure script to detect function names for various
25 + octave versions.
26 +
27 Summary of important user-visible changes for general 2.1.0:
28 -------------------------------------------------------------------
29
30 diff -uNr general-2.1.0-a/octave-general.metainfo.xml general-2.1.0-b/octave-general.metainfo.xml
31 --- general-2.1.0-a/octave-general.metainfo.xml 1969-12-31 19:00:00.000000000 -0500
32 +++ general-2.1.0-b/octave-general.metainfo.xml 2019-05-14 14:14:28.000000000 -0400
33 @@ -0,0 +1,23 @@
34 +<?xml version="1.0" encoding="UTF-8"?>
35 +<component type="addon">
36 + <id>octave-general</id>
37 + <extends>www.octave.org-octave.desktop</extends>
38 + <name>General</name>
39 + <summary>General tools for GNU Octave</summary>
40 + <description>
41 + <p>Provides functions for dictionaries, field packing,
42 + SHA1 hashing and more.
43 + </p>
44 + </description>
45 + <keywords>
46 + <keyword>dictionary</keyword>
47 + <keyword>field packing</keyword>
48 + <keyword>sha1</keyword>
49 + <keyword>planar resampling</keyword>
50 + </keywords>
51 + <url type="homepage">http://octave.sourceforge.net/general</url>
52 + <url type="bugtracker">https://savannah.gnu.org/projects/octave</url>
53 + <project_license>GPL-3.0+</project_license>
54 + <update_contact>maintainers@octave.org</update_contact>
55 + <metadata_license>FSFAP</metadata_license>
56 +</component>
57 diff -uNr general-2.1.0-a/src/aclocal.m4 general-2.1.0-b/src/aclocal.m4
58 --- general-2.1.0-a/src/aclocal.m4 2018-05-13 17:01:51.756132186 -0400
59 +++ general-2.1.0-b/src/aclocal.m4 2019-05-28 12:31:17.292636009 -0400
60 @@ -1,6 +1,6 @@
61 -# generated automatically by aclocal 1.15 -*- Autoconf -*-
62 +# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
63
64 -# Copyright (C) 1996-2014 Free Software Foundation, Inc.
65 +# Copyright (C) 1996-2018 Free Software Foundation, Inc.
66
67 # This file is free software; the Free Software Foundation
68 # gives unlimited permission to copy and/or distribute it,
69 diff -uNr general-2.1.0-a/src/config.h.in general-2.1.0-b/src/config.h.in
70 --- general-2.1.0-a/src/config.h.in 2018-05-13 17:01:52.076130613 -0400
71 +++ general-2.1.0-b/src/config.h.in 2019-05-28 12:31:18.363534450 -0400
72 @@ -8,6 +8,15 @@
73 /* Define to 1 if you have the <octave/interpreter.h> header file. */
74 #undef HAVE_OCTAVE_INTERPRETER_H
75
76 +/* Have interpreter::assign */
77 +#undef OCTAVE_HAVE_INTERPRETER_ASSIGN
78 +
79 +/* Have interpreter::varval */
80 +#undef OCTAVE_HAVE_INTERPRETER_VARVAL
81 +
82 +/* macro for alternative Octave symbols */
83 +#undef OCTAVE__VALID_IDENTIFIER
84 +
85 /* macro for alternative Octave symbols */
86 #undef OV_ISMAP
87
88 diff -uNr general-2.1.0-a/src/configure general-2.1.0-b/src/configure
89 --- general-2.1.0-a/src/configure 2018-05-13 17:01:51.920131379 -0400
90 +++ general-2.1.0-b/src/configure 2019-05-28 12:31:17.876659277 -0400
91 @@ -2909,6 +2909,40 @@
92 echo '/* generated by configure */' > oct-alt-includes.h
93
94
95 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking valid_identifier or octave::valid_identifier" >&5
96 +$as_echo_n "checking valid_identifier or octave::valid_identifier... " >&6; }
97 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
98 +/* end confdefs.h. */
99 +#include <octave/oct.h>
100 +
101 +
102 +int
103 +main ()
104 +{
105 +octave::valid_identifier ("");
106 + ;
107 + return 0;
108 +}
109 +_ACEOF
110 +if ac_fn_cxx_try_compile "$LINENO"; then :
111 +
112 +$as_echo "#define OCTAVE__VALID_IDENTIFIER octave::valid_identifier" >>confdefs.h
113 +
114 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: octave::valid_identifier" >&5
115 +$as_echo "octave::valid_identifier" >&6; }
116 + echo '
117 +' >> oct-alt-includes.h
118 +else
119 +
120 +$as_echo "#define OCTAVE__VALID_IDENTIFIER valid_identifier" >>confdefs.h
121 +
122 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: valid_identifier" >&5
123 +$as_echo " valid_identifier" >&6; }
124 + echo '' >> oct-alt-includes.h
125 +
126 +fi
127 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
128 +
129 { $as_echo "$as_me:${as_lineno-$LINENO}: checking is_map or isstruct" >&5
130 $as_echo_n "checking is_map or isstruct... " >&6; }
131 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
132 @@ -2967,6 +3001,43 @@
133 done
134
135
136 +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
137 +/* end confdefs.h. */
138 +#include <octave/interpreter.h>
139 +int
140 +main ()
141 +{
142 +octave::interpreter *interp; interp->varval ("varname");
143 + ;
144 + return 0;
145 +}
146 +_ACEOF
147 +if ac_fn_cxx_try_compile "$LINENO"; then :
148 +
149 +$as_echo "#define OCTAVE_HAVE_INTERPRETER_VARVAL 1" >>confdefs.h
150 +
151 +fi
152 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
153 +
154 +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
155 +/* end confdefs.h. */
156 +#include <octave/interpreter.h>
157 +int
158 +main ()
159 +{
160 +octave::interpreter *interp; interp->assign ("varname", octave_value ());
161 + ;
162 + return 0;
163 +}
164 +_ACEOF
165 +if ac_fn_cxx_try_compile "$LINENO"; then :
166 +
167 +$as_echo "#define OCTAVE_HAVE_INTERPRETER_ASSIGN 1" >>confdefs.h
168 +
169 +fi
170 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
171 +
172 +
173 LIBS=$TLIBS
174 LDFLAGS=$TLDFLAGS
175 CXXFLAGS=$TCXXFLAGS
176 diff -uNr general-2.1.0-a/src/configure.ac general-2.1.0-b/src/configure.ac
177 --- general-2.1.0-a/src/configure.ac 2018-05-13 17:01:51.408133896 -0400
178 +++ general-2.1.0-b/src/configure.ac 2019-05-14 14:14:28.000000000 -0400
179 @@ -82,6 +82,15 @@
180 OF_OCTAVE_LIST_ALT_SYMS([
181
182 [dnl
183 + [valid_identifier],
184 + [octave::valid_identifier],
185 + [[octave::valid_identifier ("");]],
186 + [OCTAVE__VALID_IDENTIFIER],
187 + [],
188 + []
189 +],
190 +
191 +[dnl
192 [is_map],
193 [isstruct],
194 [[octave_value ().isstruct ();]],
195 @@ -99,6 +108,19 @@
196 [#include <octave/oct.h>]
197 )
198
199 +AC_COMPILE_IFELSE(
200 + [AC_LANG_PROGRAM([[#include <octave/interpreter.h>]],
201 + [[octave::interpreter *interp; interp->varval ("varname");]])],
202 + [AC_DEFINE([OCTAVE_HAVE_INTERPRETER_VARVAL], [1], [Have interpreter::varval])],
203 + [])
204 +
205 +AC_COMPILE_IFELSE(
206 + [AC_LANG_PROGRAM([[#include <octave/interpreter.h>]],
207 + [[octave::interpreter *interp; interp->assign ("varname", octave_value ());]])],
208 + [AC_DEFINE([OCTAVE_HAVE_INTERPRETER_ASSIGN], [1], [Have interpreter::assign])],
209 + [])
210 +
211 +
212 LIBS=$TLIBS
213 LDFLAGS=$TLDFLAGS
214 CXXFLAGS=$TCXXFLAGS
215 diff -uNr general-2.1.0-a/src/packfields.cc general-2.1.0-b/src/packfields.cc
216 --- general-2.1.0-a/src/packfields.cc 2018-05-13 17:01:51.408133896 -0400
217 +++ general-2.1.0-b/src/packfields.cc 2019-05-14 14:14:28.000000000 -0400
218 @@ -58,9 +58,11 @@
219 if (nargin > 0)
220 {
221 #ifdef DEFMETHOD_DLD
222 +#ifndef OCTAVE_HAVE_INTERPRETER_VARVAL
223 octave::symbol_table::scope curr_scope
224 = interp.require_current_scope ("packfields");
225 #endif
226 +#endif
227
228 std::string struct_name = args (0).string_value ();
229 string_vector fld_names(nargin-1);
230 @@ -84,7 +86,11 @@
231 fld_names(i) = fld_name;
232
233 #ifdef DEFMETHOD_DLD
234 +#ifdef OCTAVE_HAVE_INTERPRETER_VARVAL
235 + octave_value fld_val = interp.varval (fld_name);
236 +#else
237 octave_value fld_val = curr_scope.varval (fld_name);
238 +#endif
239 #else
240 octave_value fld_val = symbol_table::varval (fld_name);
241 #endif
242 @@ -100,7 +106,11 @@
243 if (! error_state)
244 {
245 #ifdef DEFMETHOD_DLD
246 +#ifdef OCTAVE_HAVE_INTERPRETER_VARVAL
247 + octave_value struct_val = interp.varval (struct_name);
248 +#else
249 octave_value struct_val = curr_scope.varval (struct_name);
250 +#endif
251 #else
252 octave_value struct_val = symbol_table::varval (struct_name);
253 #endif
254 @@ -116,7 +126,11 @@
255 struct_val = map;
256
257 #ifdef DEFMETHOD_DLD
258 +#ifdef OCTAVE_HAVE_INTERPRETER_ASSIGN
259 + interp.assign (struct_name, struct_val);
260 +#else
261 curr_scope.assign (struct_name, struct_val);
262 +#endif
263 #else
264 symbol_table::assign (struct_name, struct_val);
265 #endif
266 diff -uNr general-2.1.0-a/src/unpackfields.cc general-2.1.0-b/src/unpackfields.cc
267 --- general-2.1.0-a/src/unpackfields.cc 2018-05-13 17:01:51.408133896 -0400
268 +++ general-2.1.0-b/src/unpackfields.cc 2019-05-14 14:14:28.000000000 -0400
269 @@ -64,9 +64,11 @@
270 if (nargin > 0)
271 {
272 #ifdef DEFMETHOD_DLD
273 +#ifndef OCTAVE_HAVE_INTERPRETER_VARVAL
274 octave::symbol_table::scope curr_scope
275 = interp.require_current_scope ("unpackfields");
276 #endif
277 +#endif
278
279 std::string struct_name = args (0).string_value ();
280 string_vector fld_names(nargin-1);
281 @@ -94,7 +96,11 @@
282 {
283 // Force the symbol to be inserted in caller's scope.
284 #ifdef DEFMETHOD_DLD
285 - octave_value struct_val = curr_scope.varval (struct_name);
286 +#ifdef OCTAVE_HAVE_INTERPRETER_VARVAL
287 + octave_value struct_val = interp.varval (struct_name);
288 +#else
289 + octave_value struct_val = curr_scope.varval (struct_name);
290 +#endif
291 #else
292 octave_value struct_val = symbol_table::varval (struct_name);
293 #endif
294 @@ -111,7 +117,11 @@
295 octave_scalar_map::const_iterator iter = map.seek (fld_names(i));
296 if (iter != map.end ())
297 #ifdef DEFMETHOD_DLD
298 +#ifdef OCTAVE_HAVE_INTERPRETER_ASSIGN
299 + interp.assign (fld_names(i), map.contents (iter));
300 +#else
301 curr_scope.assign (fld_names(i), map.contents (iter));
302 +#endif
303 #else
304 symbol_table::assign (fld_names(i), map.contents (iter));
305 #endif
306 @@ -140,7 +150,11 @@
307
308 if (val.is_defined ())
309 #ifdef DEFMETHOD_DLD
310 +#ifdef OCTAVE_HAVE_INTERPRETER_ASSIGN
311 + interp.assign (fld_names(i), val);
312 +#else
313 curr_scope.assign (fld_names(i), val);
314 +#endif
315 #else
316 symbol_table::assign (fld_names(i), val);
317 #endif