git: 843696330428 - main - math/libsemigroups: upgrade to v2.7.3

From: Thierry Thomas <thierry_at_FreeBSD.org>
Date: Sun, 02 Feb 2025 17:01:58 UTC
The branch main has been updated by thierry:

URL: https://cgit.FreeBSD.org/ports/commit/?id=843696330428771eca277e7ffb22c1badcc49e30

commit 843696330428771eca277e7ffb22c1badcc49e30
Author:     Thierry Thomas <thierry@FreeBSD.org>
AuthorDate: 2025-01-31 16:43:05 +0000
Commit:     Thierry Thomas <thierry@FreeBSD.org>
CommitDate: 2025-02-02 17:01:53 +0000

    math/libsemigroups: upgrade to v2.7.3
    
    Releases notes at https://github.com/libsemigroups/libsemigroups/releases
---
 math/libsemigroups/Makefile                        |  17 +-
 math/libsemigroups/distinfo                        |   6 +-
 math/libsemigroups/files/patch-Makefile.am         |  11 +
 .../files/patch-extern_backward-cpp_backward.hpp   | 239 +++++++++++++++++++++
 .../files/patch-include_libsemigroups_sims1.tpp    |  11 +
 math/libsemigroups/pkg-plist                       |  24 ++-
 6 files changed, 291 insertions(+), 17 deletions(-)

diff --git a/math/libsemigroups/Makefile b/math/libsemigroups/Makefile
index f24114dbffa6..27011f6aafb2 100644
--- a/math/libsemigroups/Makefile
+++ b/math/libsemigroups/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	libsemigroups
-PORTVERSION=	2.3.2
+PORTVERSION=	2.7.3
 DISTVERSIONPREFIX=	v
 CATEGORIES=	math
 
@@ -20,6 +20,7 @@ USES=		autoreconf compiler:c++11-lang eigen:3,build \
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	--enable-fmt --with-external-fmt=yes	\
 		--with-external-eigen
+#LIBS=		-lexecinfo
 USE_LDCONFIG=	yes
 INSTALL_TARGET=	install-strip
 TEST_TARGET=	check
@@ -28,18 +29,8 @@ TEST_TARGET=	check
 
 .if ${ARCH} != amd64
 CONFIGURE_ARGS+=	--disable-hpcombi
+.else
+CONFIGURE_ARGS+=	--enable-hpcombi
 .endif
 
-pre-configure:
-.if ${ARCH} == amd64
-	${REINPLACE_CMD} -e 's|$$srcdir/extern/HPCombi/VERSION|${LOCALBASE}/share/hpcombi/HPCOMBI_VERSION|'	\
-		${WRKSRC}/m4/ax_check_hpcombi.m4
-	${REINPLACE_CMD} -e 's|extern/HPCombi/include|${LOCALBASE}/include/hpcombi|'	\
-		${WRKSRC}/Makefile.am
-	${REINPLACE_CMD} -e 's|HPCombi/include|hpcombi|'	\
-		${WRKSRC}/include/libsemigroups/hpcombi.hpp
-.endif
-	${REINPLACE_CMD} -e 's|fmtinclude_HEADERS|#fmtinclude_HEADERS|'	\
-		-e 's|-O3 ||' ${WRKSRC}/Makefile.am
-
 .include <bsd.port.post.mk>
diff --git a/math/libsemigroups/distinfo b/math/libsemigroups/distinfo
index 70cbac12d2e1..6570fc335ce9 100644
--- a/math/libsemigroups/distinfo
+++ b/math/libsemigroups/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1714922873
-SHA256 (libsemigroups-libsemigroups-v2.3.2_GH0.tar.gz) = b3a0a950dc22fe22b99e605022767235bddf9710a517e4e1b2529be634d804e9
-SIZE (libsemigroups-libsemigroups-v2.3.2_GH0.tar.gz) = 3332698
+TIMESTAMP = 1738313081
+SHA256 (libsemigroups-libsemigroups-v2.7.3_GH0.tar.gz) = 754fb0e4dbfcc64b6c9a35583935c61d77fd11aa9b15f5328406c70c9d0d65b1
+SIZE (libsemigroups-libsemigroups-v2.7.3_GH0.tar.gz) = 3425157
diff --git a/math/libsemigroups/files/patch-Makefile.am b/math/libsemigroups/files/patch-Makefile.am
new file mode 100644
index 000000000000..f00338e4b2af
--- /dev/null
+++ b/math/libsemigroups/files/patch-Makefile.am
@@ -0,0 +1,11 @@
+--- Makefile.am.orig	2025-01-31 16:00:22 UTC
++++ Makefile.am
+@@ -12,7 +12,7 @@ endif
+ AM_CXXFLAGS += $(HPCOMBI_CXXFLAGS)
+ endif
+ 
+-AM_LDFLAGS  =  -no-undefined -lpthread $(FMT_LIBS)
++AM_LDFLAGS  =  -no-undefined -lpthread $(FMT_LIBS) -lexecinfo
+ 
+ if LIBSEMIGROUPS_DEBUG
+ AM_CPPFLAGS = -DDEBUG
diff --git a/math/libsemigroups/files/patch-extern_backward-cpp_backward.hpp b/math/libsemigroups/files/patch-extern_backward-cpp_backward.hpp
new file mode 100644
index 000000000000..2a9c20c213c4
--- /dev/null
+++ b/math/libsemigroups/files/patch-extern_backward-cpp_backward.hpp
@@ -0,0 +1,239 @@
+--- extern/backward-cpp/backward.hpp.orig	2024-01-19 14:15:04 UTC
++++ extern/backward-cpp/backward.hpp
+@@ -52,6 +52,9 @@
+ // #define BACKWARD_SYSTEM_DARWIN
+ //	- specialization for Mac OS X 10.5 and later.
+ //
++// #define BACKWARD_SYSTEM_FREEBSD
++//	- specialization for FreeBSD.
++//
+ // #define BACKWARD_SYSTEM_WINDOWS
+ //  - specialization for Windows (Clang 9 and MSVC2017)
+ //
+@@ -60,6 +63,7 @@
+ //
+ #if defined(BACKWARD_SYSTEM_LINUX)
+ #elif defined(BACKWARD_SYSTEM_DARWIN)
++#elif defined(BACKWARD_SYSTEM_FREEBSD)
+ #elif defined(BACKWARD_SYSTEM_UNKNOWN)
+ #elif defined(BACKWARD_SYSTEM_WINDOWS)
+ #else
+@@ -67,12 +71,18 @@
+ #define BACKWARD_SYSTEM_LINUX
+ #elif defined(__APPLE__)
+ #define BACKWARD_SYSTEM_DARWIN
++#elif defined(__FreeBSD__)
++#define BACKWARD_SYSTEM_FREEBSD
+ #elif defined(_WIN32)
+ #define BACKWARD_SYSTEM_WINDOWS
+ #else
+ #define BACKWARD_SYSTEM_UNKNOWN
+ #endif
+ #endif
++#if defined(__FreeBSD__)
++#include <pthread_np.h>
++#include <sys/ucontext.h>
++#endif
+ 
+ #define NOINLINE __attribute__((noinline))
+ 
+@@ -263,7 +273,7 @@
+ 
+ #endif  // defined(BACKWARD_SYSTEM_LINUX)
+ 
+-#if defined(BACKWARD_SYSTEM_DARWIN)
++#if defined(BACKWARD_SYSTEM_DARWIN) || defined(BACKWARD_SYSTEM_FREEBSD)
+ // On Darwin, backtrace can back-trace or "walk" the stack using the following
+ // libraries:
+ //
+@@ -329,7 +339,7 @@
+     || (BACKWARD_HAS_BACKTRACE_SYMBOL == 1)
+ #include <execinfo.h>
+ #endif
+-#endif  // defined(BACKWARD_SYSTEM_DARWIN)
++#endif  // defined(BACKWARD_SYSTEM_DARWIN) || defined(BACKWARD_SYSTEM_FREEBSD)
+ 
+ #if defined(BACKWARD_SYSTEM_WINDOWS)
+ 
+@@ -462,6 +472,7 @@ namespace backward {
+     struct linux_tag;  // seems that I cannot call that "linux" because the name
+     // is already defined... so I am adding _tag everywhere.
+     struct darwin_tag;
++    struct freebsd_tag;
+     struct windows_tag;
+     struct unknown_tag;
+ 
+@@ -469,6 +480,8 @@ namespace backward {
+     typedef linux_tag current_tag;
+ #elif defined(BACKWARD_SYSTEM_DARWIN)
+     typedef darwin_tag current_tag;
++#elif defined(BACKWARD_SYSTEM_FREEBSD)
++    typedef freebsd_tag current_tag;
+ #elif defined(BACKWARD_SYSTEM_WINDOWS)
+     typedef windows_tag current_tag;
+ #elif defined(BACKWARD_SYSTEM_UNKNOWN)
+@@ -496,7 +509,7 @@ namespace backward {
+ #else
+ #error "You shall not pass, until you know what you want."
+ #endif
+-#elif defined(BACKWARD_SYSTEM_DARWIN)
++#elif defined(BACKWARD_SYSTEM_DARWIN) || defined(BACKWARD_SYSTEM_FREEBSD)
+     struct backtrace_symbol;
+ 
+ #if BACKWARD_HAS_BACKTRACE_SYMBOL == 1
+@@ -654,7 +667,7 @@ namespace backward {
+       }
+     };
+ 
+-#if defined(BACKWARD_SYSTEM_LINUX) || defined(BACKWARD_SYSTEM_DARWIN)
++#if defined(BACKWARD_SYSTEM_LINUX) || defined(BACKWARD_SYSTEM_DARWIN) || defined(BACKWARD_SYSTEM_FREEBSD)
+ 
+     template <>
+     struct demangler_impl<system_tag::current_tag> {
+@@ -678,7 +691,7 @@ namespace backward {
+       size_t                 _demangle_buffer_length;
+     };
+ 
+-#endif  // BACKWARD_SYSTEM_LINUX || BACKWARD_SYSTEM_DARWIN
++#endif  // BACKWARD_SYSTEM_LINUX || BACKWARD_SYSTEM_DARWIN || defined(BACKWARD_SYSTEM_FREEBSD)
+ 
+     struct demangler : public demangler_impl<system_tag::current_tag> {};
+ 
+@@ -812,7 +825,7 @@ namespace backward {
+         // I like to keep little secret sometimes.
+         _thread_id = 0;
+       }
+-#elif defined(BACKWARD_SYSTEM_DARWIN)
++#elif defined(BACKWARD_SYSTEM_DARWIN) || defined(BACKWARD_SYSTEM_FREEBSD)
+       _thread_id = reinterpret_cast<size_t>(pthread_self());
+       if (pthread_main_np() == 1) {
+         // If the thread is the main one, let's hide that.
+@@ -1097,6 +1110,36 @@ namespace backward {
+         }
+         _stacktrace[index] = reinterpret_cast<void*>(ctx.data[16]);
+         ++index;
++#elif defined(__FreeBSD__) && defined(__x86_64__)
++        unw_getcontext(&ctx);
++        ctx.data[0]  = uctx->uc_mcontext.mc_rax;
++        ctx.data[1]  = uctx->uc_mcontext.mc_rbx;
++        ctx.data[2]  = uctx->uc_mcontext.mc_rcx;
++        ctx.data[3]  = uctx->uc_mcontext.mc_rdx;
++        ctx.data[4]  = uctx->uc_mcontext.mc_rdi;
++        ctx.data[5]  = uctx->uc_mcontext.mc_rsi;
++        ctx.data[6]  = uctx->uc_mcontext.mc_rbp;
++        ctx.data[7]  = uctx->uc_mcontext.mc_rsp;
++        ctx.data[8]  = uctx->uc_mcontext.mc_r8;
++        ctx.data[9]  = uctx->uc_mcontext.mc_r9;
++        ctx.data[10] = uctx->uc_mcontext.mc_r10;
++        ctx.data[11] = uctx->uc_mcontext.mc_r11;
++        ctx.data[12] = uctx->uc_mcontext.mc_r12;
++        ctx.data[13] = uctx->uc_mcontext.mc_r13;
++        ctx.data[14] = uctx->uc_mcontext.mc_r14;
++        ctx.data[15] = uctx->uc_mcontext.mc_r15;
++        ctx.data[16] = uctx->uc_mcontext.mc_rip;
++
++        // If the IP is the same as the crash address we have a bad function
++        // dereference The caller's address is pointed to by %rsp, so we
++        // dereference that value and set it to be the next frame's IP.
++        if (uctx->uc_mcontext.mc_rip
++            == reinterpret_cast<__uint64_t>(error_addr())) {
++          ctx.data[16]
++              = *reinterpret_cast<__uint64_t*>(uctx->uc_mcontext.mc_rsp);
++        }
++        _stacktrace[index] = reinterpret_cast<void*>(ctx.data[16]);
++        ++index;
+ #elif defined(__APPLE__)
+         unw_getcontext(&ctx);
+         // TODO: Convert the ucontext_t to libunwind's unw_context_t like
+@@ -1108,6 +1151,17 @@ namespace backward {
+         _stacktrace[index]
+             = reinterpret_cast<void*>(ctx.uc_mcontext->__ss.__eip);
+         ++index;
++#elif defined(__FreeBSD__)
++        unw_getcontext(&ctx);
++        // TODO: Convert the ucontext_t to libunwind's unw_context_t like
++        // we do in 64 bits
++        if (ctx.uc_mcontext.mc_eip
++            == reinterpret_cast<greg_t>(error_addr())) {
++          ctx.uc_mcontext.mc_eip = ctx.uc_mcontext.mc_esp;
++        }
++        _stacktrace[index]
++            = reinterpret_cast<void*>(ctx.uc_mcontext.mc_eip);
++        ++index;
+ #endif
+       }
+ 
+@@ -3659,7 +3713,7 @@ namespace backward {
+ 
+ #endif  // BACKWARD_SYSTEM_LINUX
+ 
+-#ifdef BACKWARD_SYSTEM_DARWIN
++#if defined(BACKWARD_SYSTEM_DARWIN) || defined(BACKWARD_SYSTEM_FREEBSD)
+ 
+   template <typename STACKTRACE_TAG>
+   class TraceResolverDarwinImpl;
+@@ -3739,10 +3793,14 @@ namespace backward {
+   };
+ 
+   template <>
++#ifdef BACKWARD_SYSTEM_DARWIN
+   class TraceResolverImpl<system_tag::darwin_tag>
++#else	// BACKWARD_SYSTEM_FREEBSD
++  class TraceResolverImpl<system_tag::freebsd_tag>
++#endif
+       : public TraceResolverDarwinImpl<trace_resolver_tag::current> {};
+ 
+-#endif  // BACKWARD_SYSTEM_DARWIN
++#endif  // BACKWARD_SYSTEM_DARWIN || BACKWARD_SYSTEM_FREEBSD
+ 
+ #ifdef BACKWARD_SYSTEM_WINDOWS
+ 
+@@ -4408,7 +4466,7 @@ namespace backward {
+ 
+   /*************** SIGNALS HANDLING ***************/
+ 
+-#if defined(BACKWARD_SYSTEM_LINUX) || defined(BACKWARD_SYSTEM_DARWIN)
++#if defined(BACKWARD_SYSTEM_LINUX) || defined(BACKWARD_SYSTEM_DARWIN) || defined(BACKWARD_SYSTEM_FREEBSD)
+ 
+   class SignalHandling {
+    public:
+@@ -4426,7 +4484,7 @@ namespace backward {
+         SIGTRAP,  // Trace/breakpoint trap
+         SIGXCPU,  // CPU time limit exceeded (4.2BSD)
+         SIGXFSZ,  // File size limit exceeded (4.2BSD)
+-#if defined(BACKWARD_SYSTEM_DARWIN)
++#if defined(BACKWARD_SYSTEM_DARWIN) || defined(BACKWARD_SYSTEM_FREEBSD)
+         SIGEMT,  // emulation instruction executed
+ #endif
+       };
+@@ -4496,6 +4554,8 @@ namespace backward {
+ #elif defined(__aarch64__)
+ #if defined(__APPLE__)
+       error_addr = reinterpret_cast<void*>(uctx->uc_mcontext->__ss.__pc);
++#elif defined(__FreeBSD__)
++      error_addr = reinterpret_cast<void*>(uctx->uc_mcontext.mc_pc);
+ #else
+       error_addr = reinterpret_cast<void*>(uctx->uc_mcontext.pc);
+ #endif
+@@ -4511,8 +4571,12 @@ namespace backward {
+       error_addr = reinterpret_cast<void*>(uctx->uc_mcontext.psw.addr);
+ #elif defined(__APPLE__) && defined(__x86_64__)
+       error_addr = reinterpret_cast<void*>(uctx->uc_mcontext->__ss.__rip);
++#elif defined(__FreeBSD__) && defined(__x86_64__)
++      error_addr = reinterpret_cast<void*>(uctx->uc_mcontext.mc_rip);
+ #elif defined(__APPLE__)
+       error_addr = reinterpret_cast<void*>(uctx->uc_mcontext->__ss.__eip);
++#elif defined(__FreeBSD__)
++      error_addr = reinterpret_cast<void*>(uctx->uc_mcontext.mc_eip);
+ #else
+ #warning ":/ sorry, ain't know no nothing none not of your architecture!"
+ #endif
+@@ -4555,7 +4619,7 @@ namespace backward {
+     }
+   };
+ 
+-#endif  // BACKWARD_SYSTEM_LINUX || BACKWARD_SYSTEM_DARWIN
++#endif  // BACKWARD_SYSTEM_LINUX || BACKWARD_SYSTEM_DARWIN || BACKWARD_SYSTEM_FREEBSD
+ 
+ #ifdef BACKWARD_SYSTEM_WINDOWS
+ 
diff --git a/math/libsemigroups/files/patch-include_libsemigroups_sims1.tpp b/math/libsemigroups/files/patch-include_libsemigroups_sims1.tpp
new file mode 100644
index 000000000000..f20df4c512d0
--- /dev/null
+++ b/math/libsemigroups/files/patch-include_libsemigroups_sims1.tpp
@@ -0,0 +1,11 @@
+--- include/libsemigroups/sims1.tpp.orig	2024-01-19 14:15:04 UTC
++++ include/libsemigroups/sims1.tpp
+@@ -619,7 +619,7 @@ namespace libsemigroups {
+   typename Sims1<T>::iterator_base&
+   Sims1<T>::iterator_base::operator=(Sims1<T>::iterator_base&& that) {
+     _extra           = std::move(that._extra);
+-    _longs           = std::move(that.long_rules());
++    _longs           = std::move(that._longs);
+     _max_num_classes = std::move(that._max_num_classes);
+     _min_target_node = std::move(that._min_target_node);
+     _felsch_graph    = std::move(that._felsch_graph);
diff --git a/math/libsemigroups/pkg-plist b/math/libsemigroups/pkg-plist
index 5d415fa1879f..b3ca22e9a68f 100644
--- a/math/libsemigroups/pkg-plist
+++ b/math/libsemigroups/pkg-plist
@@ -1,5 +1,21 @@
+include/libsemigroups/HPCombi/include/bmat8.hpp
+include/libsemigroups/HPCombi/include/bmat8_impl.hpp
+include/libsemigroups/HPCombi/include/epu.hpp
+include/libsemigroups/HPCombi/include/epu_impl.hpp
+include/libsemigroups/HPCombi/include/fallback/gcdlcm.hpp
+include/libsemigroups/HPCombi/include/fallback/seq.hpp
+include/libsemigroups/HPCombi/include/hpcombi.hpp
+include/libsemigroups/HPCombi/include/perm16.hpp
+include/libsemigroups/HPCombi/include/perm16_impl.hpp
+include/libsemigroups/HPCombi/include/perm_generic.hpp
+include/libsemigroups/HPCombi/include/perm_generic_impl.hpp
+include/libsemigroups/HPCombi/include/power.hpp
+include/libsemigroups/HPCombi/include/testtools.hpp
+include/libsemigroups/HPCombi/include/vect16.hpp
+include/libsemigroups/HPCombi/include/vect_generic.hpp
 include/libsemigroups/action.hpp
 include/libsemigroups/adapters.hpp
+include/libsemigroups/backward-cpp/backward.hpp
 include/libsemigroups/bipart.hpp
 include/libsemigroups/bitset.hpp
 include/libsemigroups/bmat.hpp
@@ -26,6 +42,7 @@ include/libsemigroups/felsch-digraph.hpp
 include/libsemigroups/felsch-digraph.tpp
 include/libsemigroups/felsch-tree.hpp
 include/libsemigroups/forest.hpp
+include/libsemigroups/fpsemi-examples.hpp
 include/libsemigroups/fpsemi-intf.hpp
 include/libsemigroups/fpsemi.hpp
 include/libsemigroups/freeband.hpp
@@ -44,6 +61,7 @@ include/libsemigroups/libsemigroups.hpp
 include/libsemigroups/make-froidure-pin.hpp
 include/libsemigroups/make-present.hpp
 include/libsemigroups/matrix.hpp
+include/libsemigroups/node-manager.hpp
 include/libsemigroups/obvinf.hpp
 include/libsemigroups/order.hpp
 include/libsemigroups/pbr.hpp
@@ -58,17 +76,21 @@ include/libsemigroups/schreier-sims.hpp
 include/libsemigroups/sims1.hpp
 include/libsemigroups/sims1.tpp
 include/libsemigroups/siso.hpp
+include/libsemigroups/stephen.hpp
 include/libsemigroups/stl.hpp
 include/libsemigroups/string-view.hpp
 include/libsemigroups/string.hpp
-include/libsemigroups/suffix-tree.hpp
 include/libsemigroups/tce.hpp
 include/libsemigroups/textflowcpp/TextFlow.hpp
 include/libsemigroups/timer.hpp
+include/libsemigroups/todd-coxeter-digraph.hpp
+include/libsemigroups/todd-coxeter-digraph.tpp
 include/libsemigroups/todd-coxeter.hpp
 include/libsemigroups/transf.hpp
 include/libsemigroups/types.hpp
 include/libsemigroups/uf.hpp
+include/libsemigroups/ukkonen.hpp
+include/libsemigroups/ukkonen.tpp
 include/libsemigroups/wilo.hpp
 include/libsemigroups/wislo.hpp
 include/libsemigroups/word.hpp