diff --git a/math/octave/files/patch-libgnu_math.in.h b/math/octave/files/patch-libgnu_math.in.h
index 077b7d108046..08de62e0a526 100644
--- a/math/octave/files/patch-libgnu_math.in.h
+++ b/math/octave/files/patch-libgnu_math.in.h
@@ -1,11 +1,11 @@
---- libgnu/math.in.h.orig 2020-11-26 18:20:44 UTC
+--- libgnu/math.in.h.orig 2022-11-02 18:19:56 UTC
+++ libgnu/math.in.h
@@ -15,7 +15,7 @@
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see . */
-#ifndef _@GUARD_PREFIX@_MATH_H
+#if 1
#if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@
diff --git a/math/octave/files/patch-liboctave_util_oct-sparse.h b/math/octave/files/patch-liboctave_util_oct-sparse.h
new file mode 100644
index 000000000000..34a9b5005f75
--- /dev/null
+++ b/math/octave/files/patch-liboctave_util_oct-sparse.h
@@ -0,0 +1,36 @@
+--- liboctave/util/oct-sparse.h.orig 2022-11-02 18:19:56 UTC
++++ liboctave/util/oct-sparse.h
+@@ -89,16 +89,27 @@
+ # include
+ #endif
+
+-// Cope with new SuiteSparse versions
++// Cope with API differences between SuiteSparse versions
+
+ #if defined (SUITESPARSE_VERSION)
+-# if (SUITESPARSE_VERSION >= SUITESPARSE_VER_CODE (4, 3))
++# if (SUITESPARSE_VERSION >= SUITESPARSE_VER_CODE (7, 0))
+ # define SUITESPARSE_NAME(name) SuiteSparse_ ## name
+-# define SUITESPARSE_ASSIGN_FPTR(f_name, f_var, f_assign) (SuiteSparse_config.f_name = f_assign)
+-# define SUITESPARSE_ASSIGN_FPTR2(f_name, f_var, f_assign) (SuiteSparse_config.f_name = SUITESPARSE_NAME (f_assign))
++# define SUITESPARSE_SET_FCN(name) SuiteSparse_config_ ## name ## _set
++# define SUITESPARSE_ASSIGN_FPTR(f_name, f_var, f_assign) \
++ SUITESPARSE_SET_FCN(f_name) (f_assign)
++# define SUITESPARSE_ASSIGN_FPTR2(f_name, f_var, f_assign) \
++ SUITESPARSE_SET_FCN(f_name) (SUITESPARSE_NAME (f_assign))
++# elif (SUITESPARSE_VERSION >= SUITESPARSE_VER_CODE (4, 3))
++# define SUITESPARSE_NAME(name) SuiteSparse_ ## name
++# define SUITESPARSE_ASSIGN_FPTR(f_name, f_var, f_assign) \
++ (SuiteSparse_config.f_name = f_assign)
++# define SUITESPARSE_ASSIGN_FPTR2(f_name, f_var, f_assign) \
++ (SuiteSparse_config.f_name = SUITESPARSE_NAME (f_assign))
+ # else
+-# define SUITESPARSE_ASSIGN_FPTR(f_name, f_var, f_assign) (f_var = f_assign)
+-# define SUITESPARSE_ASSIGN_FPTR2(f_name, f_var, f_assign) (f_var = CHOLMOD_NAME (f_assign))
++# define SUITESPARSE_ASSIGN_FPTR(f_name, f_var, f_assign) \
++ (f_var = f_assign)
++# define SUITESPARSE_ASSIGN_FPTR2(f_name, f_var, f_assign) \
++ (f_var = CHOLMOD_NAME (f_assign))
+ # endif
+ #endif
+
diff --git a/math/octave/files/patch-scripts_pkg_private_configure__make.m b/math/octave/files/patch-scripts_pkg_private_configure__make.m
index e6933ce95a16..92084c4f3b91 100644
--- a/math/octave/files/patch-scripts_pkg_private_configure__make.m
+++ b/math/octave/files/patch-scripts_pkg_private_configure__make.m
@@ -1,11 +1,11 @@
---- scripts/pkg/private/configure_make.m.orig 2021-10-30 14:20:24 UTC
+--- scripts/pkg/private/configure_make.m.orig 2022-11-02 18:19:56 UTC
+++ scripts/pkg/private/configure_make.m
-@@ -102,7 +102,7 @@ function configure_make (desc, packdir, verbose)
+@@ -110,7 +110,7 @@ function configure_make (desc, packdir, verbose)
endif
if (exist (fullfile (src, "Makefile"), "file"))
- [status, output] = shell (sprintf ("%s make --jobs %i --directory '%s'",
+ [status, output] = shell (sprintf ("%s gmake --jobs %i --directory '%s'",
scenv, jobs, src), verbose);
if (status != 0)
- rmdir (desc.dir, "s");
+ disp (output);