Hello community,
here is the log from the commit of package octave-forge-struct for
openSUSE:Factory checked in at 2019-03-26 15:40:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/octave-forge-struct (Old)
and /work/SRC/openSUSE:Factory/.octave-forge-struct.new.25356 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "octave-forge-struct"
Tue Mar 26 15:40:05 2019 rev:5 rq:682615 version:1.0.15
Changes:
--------
--- /work/SRC/openSUSE:Factory/octave-forge-struct/octave-forge-struct.changes
2018-06-29 22:25:50.254509082 +0200
+++
/work/SRC/openSUSE:Factory/.octave-forge-struct.new.25356/octave-forge-struct.changes
2019-03-26 15:41:10.364282797 +0100
@@ -1,0 +2,6 @@
+Thu Mar 7 17:53:51 UTC 2019 - Stefan BrĂ¼ns <[email protected]>
+
+- Add changes from current tip, to fix building with Octave 5.1:
+ release-current-tip.diff
+
+-------------------------------------------------------------------
New:
----
release-current-tip.diff
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ octave-forge-struct.spec ++++++
--- /var/tmp/diff_new_pack.DDKvGV/_old 2019-03-26 15:41:12.464281962 +0100
+++ /var/tmp/diff_new_pack.DDKvGV/_new 2019-03-26 15:41:12.468281960 +0100
@@ -1,7 +1,7 @@
#
# spec file for package octave-forge-struct
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,7 +12,7 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
@@ -25,6 +25,10 @@
Group: Productivity/Scientific/Math
Url: http://octave.sourceforge.net
Source0:
http://downloads.sourceforge.net/octave/%{octpkg}-%{version}.tar.gz
+# PATCH-FIX-UPSTREAM - Fix building with current octave
+Patch0: release-current-tip.diff
+BuildRequires: autoconf
+BuildRequires: automake
BuildRequires: gcc-c++
BuildRequires: hdf5-devel
BuildRequires: octave-devel
@@ -36,6 +40,10 @@
%prep
%setup -q -c %{name}-%{version}
+pushd %{octpkg}-%{version}
+%patch0 -p1
+cd src && ./bootstrap
+popd
%octave_pkg_src
%build
@@ -54,7 +62,6 @@
%octave --eval "pkg rebuild"
%files
-%defattr(-,root,root)
%{octpackages_dir}/%{octpkg}-%{version}
%{octlib_dir}/%{octpkg}-%{version}
++++++ release-current-tip.diff ++++++
# HG changeset patch
# User Olaf Till <[email protected]>
# Date 1530563206 -7200
# Mon Jul 02 22:26:46 2018 +0200
# Node ID d5c3cdc052b679a29bd61e5a138634562c469869
# Parent 60b27d46269a7442098239e4b533736027457553
Use autoheader and check for alternative Octave symbols.
diff --git a/src/Makefile.in b/src/Makefile.in
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,6 +1,6 @@
# Makefile for struct package for Octave
#
-# Copyright (C) 2016 Olaf Till <[email protected]>
+# Copyright (C) 2016-2018 Olaf Till <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -17,13 +17,10 @@
# Uncomment this for a release.
-RELEASE := yes
+# RELEASE := yes
ifdef RELEASE
-# Currently this avoids warnings due to introduction of Octave
-# namespaces in Octave-4.1.0+. If the deprecated versions will be
-# available long enough, we could get away with just suppressing the
-# warnings.
-RELEASE_CXXFLAGS = -Wno-deprecated-declarations
+# Currently this does nothing.
+RELEASE_CXXFLAGS =
endif
MKOCTFILE ?= @MKOCTFILE@
diff --git a/src/bootstrap b/src/bootstrap
--- a/src/bootstrap
+++ b/src/bootstrap
@@ -1,3 +1,7 @@
#! /bin/sh
+aclocal
+
autoconf
+
+autoheader -f
diff --git a/src/config.h.in b/src/config.h.in
deleted file mode 100644
--- a/src/config.h.in
+++ /dev/null
@@ -1,6 +0,0 @@
-/* Define as 1 if liboctinterp is old enough to provide error_state. */
-#undef HAVE_OCTAVE_ERROR_STATE
-
-/* Define as 1 if liboctinterp has
-'verror (octave_execution_exception&, const char *, va_list)'. */
-#undef HAVE_OCTAVE_VERROR_ARG_EXC
diff --git a/src/configure.ac b/src/configure.ac
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -22,6 +22,12 @@
AC_CONFIG_SRCDIR([cell2fields.cc])
AC_CONFIG_HEADERS([config.h])
+# Avoid warnings for redefining AH-generated preprocessor symbols of
+# Octave.
+AH_TOP([#include "undef-ah-octave.h"])
+
+AC_CONFIG_MACRO_DIRS([m4])
+
# Checks for programs.
AC_CHECK_PROG(MKOCTFILE, mkoctfile, mkoctfile)
if test -z "$MKOCTFILE"; then
@@ -72,16 +78,48 @@
[AC_LANG_PROGRAM([[#include <octave/oct.h>]
[#include <stdio.h>]],
[[printf ("%i", error_state);]])],
- [AC_DEFINE([HAVE_OCTAVE_ERROR_STATE], 1)])
+ [AC_DEFINE([HAVE_OCTAVE_ERROR_STATE], 1,
+ [Define as 1 if liboctinterp is old enough to provide error_state.])])
-## Presence of 'verror (octave_execution_exception&, const char *,
+## Presence of 'verror (octave(_|::)execution_exception&, const char *,
## va_list)'
-AC_LINK_IFELSE(
+AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <octave/oct.h>]],
[[octave_execution_exception e;]
[va_list args;]
[verror (e, "test", args);]])],
- [AC_DEFINE([HAVE_OCTAVE_VERROR_ARG_EXC], 1)])
+ [AC_DEFINE([HAVE_OCTAVE_VERROR_ARG_EXC], 1,
+ [Define as 1 if liboctinterp has 'verror
(octave(_|::)execution_exception&, const char *, va_list)'.])],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <octave/oct.h>]],
+ [[octave::execution_exception e;]
+ [va_list args;]
+ [verror (e, "test", args);]])],
+ [AC_DEFINE([HAVE_OCTAVE_VERROR_ARG_EXC], 1,
+ [Define as 1 if liboctinterp has 'verror
(octave(_|::)execution_exception&, const char *, va_list)'.])])])
+
+## Simple symbol alternatives of different Octave versions.
+OF_OCTAVE_LIST_ALT_SYMS([
+[dnl
+ [is_map],
+ [isstruct],
+ [[octave_value ().isstruct ();]],
+ [OV_ISSTRUCT],
+ [],
+ []
+],
+
+[dnl
+ [octave_execution_exception],
+ [octave::execution_exception],
+ [[octave::execution_exception ();]],
+ [OCTAVE__EXECUTION_EXCEPTION],
+ [],
+ []
+]
+
+],
+ [oct-alt-includes.h])
LIBS=$TLIBS
LDFLAGS=$TLDFLAGS
diff --git a/src/error-helpers.cc b/src/error-helpers.cc
--- a/src/error-helpers.cc
+++ b/src/error-helpers.cc
@@ -1,6 +1,6 @@
/*
-Copyright (C) 2016, 2017 Olaf Till <[email protected]>
+Copyright (C) 2016-2018 Olaf Till <[email protected]>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -24,7 +24,7 @@
// call verror
#ifdef HAVE_OCTAVE_VERROR_ARG_EXC
void
-c_verror (octave_execution_exception& e, const char *fmt, ...)
+c_verror (OCTAVE__EXECUTION_EXCEPTION& e, const char *fmt, ...)
{
va_list args;
va_start (args, fmt);
@@ -33,7 +33,7 @@
}
#else
void
-c_verror (const octave_execution_exception&, const char *fmt, ...)
+c_verror (const OCTAVE__EXECUTION_EXCEPTION&, const char *fmt, ...)
{
va_list args;
va_start (args, fmt);
diff --git a/src/error-helpers.h b/src/error-helpers.h
--- a/src/error-helpers.h
+++ b/src/error-helpers.h
@@ -1,6 +1,6 @@
/*
-Copyright (C) 2016, 2017 Olaf Till <[email protected]>
+Copyright (C) 2016-2018 Olaf Till <[email protected]>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -26,9 +26,9 @@
// call verror, for _linking_ also against Octave versions who have no
// verror() with these arguments
#ifdef HAVE_OCTAVE_VERROR_ARG_EXC
-void c_verror (octave_execution_exception&, const char *, ...);
+void c_verror (OCTAVE__EXECUTION_EXCEPTION&, const char *, ...);
#else
-void c_verror (const octave_execution_exception&, const char *, ...);
+void c_verror (const OCTAVE__EXECUTION_EXCEPTION&, const char *, ...);
#endif
void _p_error (const char *fmt, ...);
@@ -37,7 +37,7 @@
// both if Octave uses exceptions for errors and if it still uses
// error_state. In the latter case return 'retval'.
#ifdef HAVE_OCTAVE_ERROR_STATE
- // can throw octave_execution_exception despite of this
+ // can throw OCTAVE__EXECUTION_EXCEPTION despite of this
#define CHECK_ERROR(code, retval, ...) \
try \
{ \
@@ -50,7 +50,7 @@
return retval; \
} \
} \
- catch (octave_execution_exception& e) \
+ catch (OCTAVE__EXECUTION_EXCEPTION& e) \
{ \
c_verror (e, __VA_ARGS__); \
}
@@ -60,7 +60,7 @@
{ \
code ; \
} \
- catch (octave_execution_exception& e) \
+ catch (OCTAVE__EXECUTION_EXCEPTION& e) \
{ \
verror (e, __VA_ARGS__); \
}
@@ -70,7 +70,7 @@
// Octave doesn't throw exceptions for errors but still uses
// error_state.
#ifdef HAVE_OCTAVE_ERROR_STATE
- // can throw octave_execution_exception despite of this
+ // can throw OCTAVE__EXECUTION_EXCEPTION despite of this
#define CHECK_ERROR_EXIT1(code, ...) \
try \
{ \
@@ -83,7 +83,7 @@
exit (1); \
} \
} \
- catch (octave_execution_exception&) \
+ catch (OCTAVE__EXECUTION_EXCEPTION&) \
{ \
_p_error (__VA_ARGS__); \
\
@@ -95,7 +95,7 @@
{ \
code ; \
} \
- catch (octave_execution_exception&) \
+ catch (OCTAVE__EXECUTION_EXCEPTION&) \
{ \
_p_error (__VA_ARGS__); \
\
@@ -107,7 +107,7 @@
// Octave uses exceptions for errors and if it still uses
// error_state. In the latter case reset error_state to 0.
#ifdef HAVE_OCTAVE_ERROR_STATE
- // can throw octave_execution_exception despite of this
+ // can throw OCTAVE__EXECUTION_EXCEPTION despite of this
#define SET_ERR(code, err) \
err = false; \
\
@@ -120,7 +120,7 @@
err = true; \
} \
} \
- catch (octave_execution_exception&) \
+ catch (OCTAVE__EXECUTION_EXCEPTION&) \
{ \
err = true; \
}
@@ -132,7 +132,7 @@
{ \
code ; \
} \
- catch (octave_execution_exception&) \
+ catch (OCTAVE__EXECUTION_EXCEPTION&) \
{ \
err = true; \
}
diff --git a/src/m4/octave-forge.m4 b/src/m4/octave-forge.m4
new file mode 100644
--- /dev/null
+++ b/src/m4/octave-forge.m4
@@ -0,0 +1,93 @@
+# Copyright (C) 2017 Olaf Till <[email protected]>
+# Modifications to print what is searching for by JohnD
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+
+# arguments of OF_OCTAVE_ALT_SYMS (see also description of
+# OF_OCTAVE_LIST_ALT_SYMS below):
+#
+# $1: symbol version 1
+# $2: symbol version 2
+# $3: test for symbol version 2
+# $4: macro name to access alternative symbols
+# $5: include directives for symbol version 1
+# $6: include directives for symbol version 2
+# (a list of lists of args 1--6 is $1 of OF_OCTAVE_LIST_ALT_SYMS)
+# $7: name of generated include file with alternatives of Octave headers
+# (arg7 is $2 of OF_OCTAVE_LIST_ALT_SYMS)
+AC_DEFUN([OF_OCTAVE_ALT_SYMS], [
+AC_MSG_CHECKING([$1 or $2])
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <octave/oct.h>]
+ $6],
+ [$3])],
+ [AC_DEFINE($4,
+ [[$2]],
+ [macro for alternative Octave symbols])
+ AC_MSG_RESULT([$2])
+ echo '$6' >> $7],
+ [AC_DEFINE($4,
+ [[$1]],
+ [macro for alternative Octave symbols])
+ AC_MSG_RESULT([$1])
+ echo '$5' >> $7]
+)
+])
+
+
+# OF_OCTAVE_LIST_ALT_SYMS is called in the following way:
+#
+# OF_OCTAVE_LIST_ALT_SYMS([
+# [dnl
+# [old_octave_symbol],
+# [new_octave_symbol],
+# [[compilation test]
+# [for new_octave_symbol]],
+# [NAME_OF_GENERATED_MACRO____WILL_EXPAND_TO_OLD_OR_NEW_SYMBOL],
+# [[include directives]
+# [except #include <octave/oct.h>]
+# [necessary to compile with old_octave_symbol]],
+# [[include directives]
+# [except #include <octave/oct.h>]
+# [nessary to compile with new_octave_symbol]
+# [and to compile the test]]
+# ],
+#
+# ... further such lists as the above
+#
+# ],
+#
+# [name-of-header-file-for-alternative-octave-iclude-directives.h])
+#
+#
+# This file should be put into src/m4/, and the line
+#
+# AC_CONFIG_MACRO_DIRS([m4])
+#
+# should be put into src/configure.ac. The package should use
+# autoheader to generate config.h.in (src/bootstrap should contain the
+# lines 'aclocal', 'autoconf', and 'autoheader -f'). Package code
+# should include config.h and use the generated macros to access the
+# alternative symbols of Octave. An example of a call to
+# OF_OCTAVE_LIST_ALT_SYMS in src/configure.ac is available together
+# with this file.
+AC_DEFUN([OF_OCTAVE_LIST_ALT_SYMS], [
+
+echo '/* generated by configure */' > $2
+
+m4_foreach([it], [$1], [m4_apply([OF_OCTAVE_ALT_SYMS], [it, $2])])
+
+AH_BOTTOM([#include "$2"])
+
+])
diff --git a/src/structcat.cc b/src/structcat.cc
--- a/src/structcat.cc
+++ b/src/structcat.cc
@@ -132,7 +132,7 @@
for (octave_idx_type i = m1_id; i < n_args; i++)
{
- if (! args(i).is_map ())
+ if (! args(i).OV_ISSTRUCT ())
{
error ("%s: some argument not a structure", fname.c_str ());
diff --git a/src/undef-ah-octave.h b/src/undef-ah-octave.h
new file mode 100644
--- /dev/null
+++ b/src/undef-ah-octave.h
@@ -0,0 +1,27 @@
+/* To be included at the top of config.h (by autoheader). Avoid
+ warnings for redefining AH-generated preprocessor symbols of
+ Octave. */
+
+#ifdef PACKAGE_BUGREPORT
+#undef PACKAGE_BUGREPORT
+#endif
+
+#ifdef PACKAGE_NAME
+#undef PACKAGE_NAME
+#endif
+
+#ifdef PACKAGE_STRING
+#undef PACKAGE_STRING
+#endif
+
+#ifdef PACKAGE_TARNAME
+#undef PACKAGE_TARNAME
+#endif
+
+#ifdef PACKAGE_URL
+#undef PACKAGE_URL
+#endif
+
+#ifdef PACKAGE_VERSION
+#undef PACKAGE_VERSION
+#endif
# HG changeset patch
# User Olaf Till <[email protected]>
# Date 1534092890 -7200
# Sun Aug 12 18:54:50 2018 +0200
# Node ID 320e8484cd10b73cef40c9b51d99ebbb0c7b8360
# Parent d5c3cdc052b679a29bd61e5a138634562c469869
error-helpers.h: include <iostream>
diff --git a/src/error-helpers.h b/src/error-helpers.h
--- a/src/error-helpers.h
+++ b/src/error-helpers.h
@@ -19,6 +19,8 @@
#include "config.h"
+#include <iostream>
+
// Octaves non-static verror functions: The elder all set error_state,
// the newer, present from the time on at which error started to throw
// an exception, all throw, too.
# HG changeset patch
# User Olaf Till <[email protected]>
# Date 1547200761 -3600
# Fri Jan 11 10:59:21 2019 +0100
# Node ID 217a5b7b066a5e51572f29be8a5b1ac22a883a9f
# Parent 320e8484cd10b73cef40c9b51d99ebbb0c7b8360
check for octave::vformat
diff --git a/src/configure.ac b/src/configure.ac
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -110,6 +110,17 @@
],
[dnl
+ [octave_vformat],
+ [octave::vformat],
+ [[std::ostringstream obuf;]
+ [va_list args;]
+ [octave::vformat (obuf, "dummy", args);]],
+ [OCTAVE__VFORMAT],
+ [],
+ []
+],
+
+[dnl
[octave_execution_exception],
[octave::execution_exception],
[[octave::execution_exception ();]],
diff --git a/src/error-helpers.cc b/src/error-helpers.cc
--- a/src/error-helpers.cc
+++ b/src/error-helpers.cc
@@ -50,7 +50,7 @@
std::ostringstream output_buf;
- octave_vformat (output_buf, fmt, args);
+ OCTAVE__VFORMAT (output_buf, fmt, args);
std::string msg = output_buf.str ();