view 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
line wrap: on
line source

diff -uNr general-2.1.0-a/Makefile general-2.1.0-b/Makefile
--- general-2.1.0-a/Makefile	2018-05-13 17:01:51.400133935 -0400
+++ general-2.1.0-b/Makefile	2019-05-14 14:14:28.000000000 -0400
@@ -212,10 +212,8 @@
 
 ## Test package.
 octave_test_commands = \
-' pkgs = pkg("list","general"); cd (pkgs{1}.dir); dirs = { "." }; \
-  dirs(cellfun (@ (x) ! isdir (x), dirs)) = []; \
-  if (isempty (dirs)) error ("no \"inst\" or \"src\" directory"); exit (1); \
-    else __run_test_suite__ (dirs, {}); endif '
+' pkgs = pkg("list","general"); dirs = { pkgs{1}.dir }; \
+  __run_test_suite__ (dirs, {}); '
 ## the following works, too, but provides no overall summary output as
 ## __run_test_suite__ does:
 ##
diff -uNr general-2.1.0-a/NEWS general-2.1.0-b/NEWS
--- general-2.1.0-a/NEWS	2018-05-13 17:01:51.400133935 -0400
+++ general-2.1.0-b/NEWS	2019-05-14 14:14:28.000000000 -0400
@@ -1,3 +1,9 @@
+Summary of important user-visible changes for general 2.1.0+:
+-------------------------------------------------------------------
+
+ ** updated configure script to detect function names for various
+    octave versions.
+
 Summary of important user-visible changes for general 2.1.0:
 -------------------------------------------------------------------
 
diff -uNr general-2.1.0-a/octave-general.metainfo.xml general-2.1.0-b/octave-general.metainfo.xml
--- general-2.1.0-a/octave-general.metainfo.xml	1969-12-31 19:00:00.000000000 -0500
+++ general-2.1.0-b/octave-general.metainfo.xml	2019-05-14 14:14:28.000000000 -0400
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<component type="addon">
+  <id>octave-general</id>
+  <extends>www.octave.org-octave.desktop</extends>
+  <name>General</name>
+  <summary>General tools for GNU Octave</summary>
+  <description>
+    <p>Provides functions for dictionaries, field packing,
+    SHA1 hashing and more.
+    </p>
+  </description>
+  <keywords>
+    <keyword>dictionary</keyword>
+    <keyword>field packing</keyword>
+    <keyword>sha1</keyword>
+    <keyword>planar resampling</keyword>
+  </keywords>
+  <url type="homepage">http://octave.sourceforge.net/general</url>
+  <url type="bugtracker">https://savannah.gnu.org/projects/octave</url>
+  <project_license>GPL-3.0+</project_license>
+  <update_contact>maintainers@octave.org</update_contact>
+  <metadata_license>FSFAP</metadata_license>
+</component>
diff -uNr general-2.1.0-a/src/aclocal.m4 general-2.1.0-b/src/aclocal.m4
--- general-2.1.0-a/src/aclocal.m4	2018-05-13 17:01:51.756132186 -0400
+++ general-2.1.0-b/src/aclocal.m4	2019-05-28 12:31:17.292636009 -0400
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.15 -*- Autoconf -*-
+# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff -uNr general-2.1.0-a/src/config.h.in general-2.1.0-b/src/config.h.in
--- general-2.1.0-a/src/config.h.in	2018-05-13 17:01:52.076130613 -0400
+++ general-2.1.0-b/src/config.h.in	2019-05-28 12:31:18.363534450 -0400
@@ -8,6 +8,15 @@
 /* Define to 1 if you have the <octave/interpreter.h> header file. */
 #undef HAVE_OCTAVE_INTERPRETER_H
 
+/* Have interpreter::assign */
+#undef OCTAVE_HAVE_INTERPRETER_ASSIGN
+
+/* Have interpreter::varval */
+#undef OCTAVE_HAVE_INTERPRETER_VARVAL
+
+/* macro for alternative Octave symbols */
+#undef OCTAVE__VALID_IDENTIFIER
+
 /* macro for alternative Octave symbols */
 #undef OV_ISMAP
 
diff -uNr general-2.1.0-a/src/configure general-2.1.0-b/src/configure
--- general-2.1.0-a/src/configure	2018-05-13 17:01:51.920131379 -0400
+++ general-2.1.0-b/src/configure	2019-05-28 12:31:17.876659277 -0400
@@ -2909,6 +2909,40 @@
 echo '/* generated by configure */' > oct-alt-includes.h
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking   valid_identifier or octave::valid_identifier" >&5
+$as_echo_n "checking   valid_identifier or octave::valid_identifier... " >&6; }
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <octave/oct.h>
+
+
+int
+main ()
+{
+octave::valid_identifier ("");
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+$as_echo "#define OCTAVE__VALID_IDENTIFIER octave::valid_identifier" >>confdefs.h
+
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: octave::valid_identifier" >&5
+$as_echo "octave::valid_identifier" >&6; }
+     echo '
+' >> oct-alt-includes.h
+else
+
+$as_echo "#define OCTAVE__VALID_IDENTIFIER   valid_identifier" >>confdefs.h
+
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result:   valid_identifier" >&5
+$as_echo "  valid_identifier" >&6; }
+     echo '' >> oct-alt-includes.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking   is_map or isstruct" >&5
 $as_echo_n "checking   is_map or isstruct... " >&6; }
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2967,6 +3001,43 @@
 done
 
 
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <octave/interpreter.h>
+int
+main ()
+{
+octave::interpreter *interp; interp->varval ("varname");
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+$as_echo "#define OCTAVE_HAVE_INTERPRETER_VARVAL 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <octave/interpreter.h>
+int
+main ()
+{
+octave::interpreter *interp; interp->assign ("varname", octave_value ());
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+$as_echo "#define OCTAVE_HAVE_INTERPRETER_ASSIGN 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
 LIBS=$TLIBS
 LDFLAGS=$TLDFLAGS
 CXXFLAGS=$TCXXFLAGS
diff -uNr general-2.1.0-a/src/configure.ac general-2.1.0-b/src/configure.ac
--- general-2.1.0-a/src/configure.ac	2018-05-13 17:01:51.408133896 -0400
+++ general-2.1.0-b/src/configure.ac	2019-05-14 14:14:28.000000000 -0400
@@ -82,6 +82,15 @@
 OF_OCTAVE_LIST_ALT_SYMS([
 
 [dnl
+  [valid_identifier],
+  [octave::valid_identifier],
+  [[octave::valid_identifier ("");]],
+  [OCTAVE__VALID_IDENTIFIER],
+  [],
+  []
+],
+
+[dnl
   [is_map],
   [isstruct],
   [[octave_value ().isstruct ();]],
@@ -99,6 +108,19 @@
   [#include <octave/oct.h>]
 )
 
+AC_COMPILE_IFELSE(
+  [AC_LANG_PROGRAM([[#include <octave/interpreter.h>]],
+  [[octave::interpreter *interp; interp->varval ("varname");]])],
+  [AC_DEFINE([OCTAVE_HAVE_INTERPRETER_VARVAL], [1], [Have interpreter::varval])],
+  [])
+
+AC_COMPILE_IFELSE(
+  [AC_LANG_PROGRAM([[#include <octave/interpreter.h>]],
+  [[octave::interpreter *interp; interp->assign ("varname", octave_value ());]])],
+  [AC_DEFINE([OCTAVE_HAVE_INTERPRETER_ASSIGN], [1], [Have interpreter::assign])],
+  [])
+
+
 LIBS=$TLIBS
 LDFLAGS=$TLDFLAGS
 CXXFLAGS=$TCXXFLAGS
diff -uNr general-2.1.0-a/src/packfields.cc general-2.1.0-b/src/packfields.cc
--- general-2.1.0-a/src/packfields.cc	2018-05-13 17:01:51.408133896 -0400
+++ general-2.1.0-b/src/packfields.cc	2019-05-14 14:14:28.000000000 -0400
@@ -58,9 +58,11 @@
   if (nargin > 0)
     {
 #ifdef DEFMETHOD_DLD
+#ifndef OCTAVE_HAVE_INTERPRETER_VARVAL
       octave::symbol_table::scope curr_scope
        = interp.require_current_scope ("packfields");
 #endif
+#endif
 
       std::string struct_name = args (0).string_value ();
       string_vector fld_names(nargin-1);
@@ -84,7 +86,11 @@
               fld_names(i) = fld_name;
 
 #ifdef DEFMETHOD_DLD
+#ifdef OCTAVE_HAVE_INTERPRETER_VARVAL
+              octave_value fld_val = interp.varval (fld_name);
+#else
               octave_value fld_val = curr_scope.varval (fld_name);
+#endif
 #else
               octave_value fld_val = symbol_table::varval (fld_name);
 #endif
@@ -100,7 +106,11 @@
       if (! error_state)
         {
 #ifdef DEFMETHOD_DLD
+#ifdef OCTAVE_HAVE_INTERPRETER_VARVAL
+          octave_value struct_val = interp.varval (struct_name);
+#else
           octave_value struct_val = curr_scope.varval (struct_name);
+#endif
 #else
           octave_value struct_val = symbol_table::varval (struct_name);
 #endif
@@ -116,7 +126,11 @@
           struct_val = map;
 
 #ifdef DEFMETHOD_DLD
+#ifdef OCTAVE_HAVE_INTERPRETER_ASSIGN
+          interp.assign (struct_name, struct_val);
+#else
           curr_scope.assign (struct_name, struct_val);
+#endif
 #else
           symbol_table::assign (struct_name, struct_val);
 #endif
diff -uNr general-2.1.0-a/src/unpackfields.cc general-2.1.0-b/src/unpackfields.cc
--- general-2.1.0-a/src/unpackfields.cc	2018-05-13 17:01:51.408133896 -0400
+++ general-2.1.0-b/src/unpackfields.cc	2019-05-14 14:14:28.000000000 -0400
@@ -64,9 +64,11 @@
   if (nargin > 0)
     {
 #ifdef DEFMETHOD_DLD
+#ifndef OCTAVE_HAVE_INTERPRETER_VARVAL
       octave::symbol_table::scope curr_scope
        = interp.require_current_scope ("unpackfields");
 #endif
+#endif
 
       std::string struct_name = args (0).string_value ();
       string_vector fld_names(nargin-1);
@@ -94,7 +96,11 @@
         {
           // Force the symbol to be inserted in caller's scope.
 #ifdef DEFMETHOD_DLD
-          octave_value struct_val = curr_scope.varval (struct_name);
+#ifdef OCTAVE_HAVE_INTERPRETER_VARVAL
+              octave_value struct_val = interp.varval (struct_name);
+#else
+              octave_value struct_val = curr_scope.varval (struct_name);
+#endif
 #else
           octave_value struct_val = symbol_table::varval (struct_name);
 #endif
@@ -111,7 +117,11 @@
                       octave_scalar_map::const_iterator iter = map.seek (fld_names(i));
                       if (iter != map.end ())
 #ifdef DEFMETHOD_DLD
+#ifdef OCTAVE_HAVE_INTERPRETER_ASSIGN
+                        interp.assign (fld_names(i), map.contents (iter));
+#else
                         curr_scope.assign (fld_names(i), map.contents (iter));
+#endif
 #else
                         symbol_table::assign (fld_names(i), map.contents (iter));
 #endif
@@ -140,7 +150,11 @@
 
                   if (val.is_defined ())
 #ifdef DEFMETHOD_DLD
+#ifdef OCTAVE_HAVE_INTERPRETER_ASSIGN
+                    interp.assign (fld_names(i), val);
+#else
                     curr_scope.assign (fld_names(i), val);
+#endif
 #else
                     symbol_table::assign (fld_names(i), val);
 #endif