diff --git a/math/wxmaxima/Makefile b/math/wxmaxima/Makefile index 6bd3e32bf2b0..ffcf2364ca9f 100644 --- a/math/wxmaxima/Makefile +++ b/math/wxmaxima/Makefile @@ -1,32 +1,33 @@ PORTNAME= wxmaxima DISTVERSIONPREFIX= Version- DISTVERSION= 25.04.0 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= math MAINTAINER= tiga@FreeBSD.org COMMENT= WxWidgets GUI for the computer algebra system maxima WWW= https://wxmaxima-developers.github.io/wxmaxima/ LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING RUN_DEPENDS= maxima:math/maxima USES= cmake compiler:c++14-lang desktop-file-utils shared-mime-info USE_GITHUB= yes GH_ACCOUNT= wxMaxima-Developers -USE_WX= 3.0 +USE_WX= 3.2 WX_COMPS= wx WX_CONF_ARGS= absolute PLIST_SUB= DESKTOPDIR=${DESKTOPDIR:S,${PREFIX}/,,} OPTIONS_DEFINE= DOCS NLS OPTIONS_SUB= yes NLS_USES= gettext NLS_EXTRA_PATCHES_OFF= ${PATCHDIR}/extra-patch-CMakeLists.txt .include diff --git a/math/wxmaxima/files/patch-src_Dirstructure.cpp b/math/wxmaxima/files/patch-src_Dirstructure.cpp index 42ab59c742be..aa019c94d05b 100644 --- a/math/wxmaxima/files/patch-src_Dirstructure.cpp +++ b/math/wxmaxima/files/patch-src_Dirstructure.cpp @@ -1,10 +1,10 @@ ---- src/Dirstructure.cpp.orig 2023-02-19 14:20:34 UTC +--- src/Dirstructure.cpp.orig 2025-04-27 13:21:48 UTC +++ src/Dirstructure.cpp -@@ -120,6 +120,7 @@ wxString Dirstructure::ResourcesDir() const { +@@ -121,6 +121,7 @@ wxString Dirstructure::ResourcesDir() { exepath = exe.GetPath(); } else { exepath = CMAKE_INSTALL_PREFIX; + exepath.Append("/share"); } return exepath; } diff --git a/math/wxmaxima/files/patch-src_Maxima.cpp b/math/wxmaxima/files/patch-src_Maxima.cpp new file mode 100644 index 000000000000..9476a615be43 --- /dev/null +++ b/math/wxmaxima/files/patch-src_Maxima.cpp @@ -0,0 +1,45 @@ +--- src/Maxima.cpp.orig 2025-10-22 20:06:30 UTC ++++ src/Maxima.cpp +@@ -115,8 +115,18 @@ Maxima::~Maxima() { + wxEvtHandler::DeletePendingEvents(); + } + ++ ++// revert https://github.com/wxMaxima-developers/wxmaxima/commit/5d8dff1564c4d8e0d07e6fdb262b476cad0cb643 ++// as per https://github.com/wxMaxima-developers/wxmaxima/issues/2028 ++// NOTE: this is temporary solution until wx 3.3.2 + bool Maxima::Write(const void *buffer, std::size_t length) { +- if(!buffer) ++ if (!m_socketOutputData.IsEmpty()) { ++ if (buffer && length) ++ m_socketOutputData.AppendData(buffer, length); ++ buffer = m_socketOutputData.GetData(); ++ length = m_socketOutputData.GetDataLen(); ++ } ++ if (!length) + return false; + if (length == 0) + return false; +@@ -125,8 +135,21 @@ bool Maxima::Write(const void *buffer, std::size_t len + wxThreadEvent *sendevent = new wxThreadEvent(EVT_MAXIMA); + sendevent->SetInt(WRITE_ERROR); + QueueEvent(sendevent); +- return false; ++ m_socketOutputData.Clear(); ++ return true; + } ++ auto const wrote = m_socket->LastWriteCount(); ++ if (wrote < length) { ++ auto *const source = reinterpret_cast(buffer); ++ auto const leftToWrite = length - wrote; ++ if (m_socketOutputData.IsEmpty()) ++ m_socketOutputData.AppendData(source + wrote, leftToWrite); ++ else { ++ memmove(m_socketOutputData.GetData(), source + wrote, leftToWrite); ++ m_socketOutputData.SetDataLen(leftToWrite); ++ } ++ } else ++ m_socketOutputData.Clear(); + return true; + } + diff --git a/math/wxmaxima/files/patch-src_Maxima.h b/math/wxmaxima/files/patch-src_Maxima.h new file mode 100644 index 000000000000..d6d252c06caf --- /dev/null +++ b/math/wxmaxima/files/patch-src_Maxima.h @@ -0,0 +1,28 @@ +--- src/Maxima.h.orig 2025-10-22 20:10:06 UTC ++++ src/Maxima.h +@@ -123,6 +123,12 @@ class Maxima : public wxEvtHandler (private) + private: + //! If this is set to true by XmlInspectorActive we send all data we get to the XML inspector + bool m_xmlInspector = false; ++ /*! Send still-unsent data to wxMaxima ++ * ++ * \todo As we tell wxWidgets to send all data in one go at the end of a write command ++ * there should no more be unsent data. ++ */ ++ void SendDataTowxMaxima(); + //! The configuration of our wxMaxima process + Configuration *m_configuration; + //! The thread handler for SendDataTowxMaxima, the thread that parses the data from maxima. +@@ -152,6 +158,12 @@ class Maxima : public wxEvtHandler (private) + waits for the other to exit before writing new data to this variable. + */ + wxString m_socketInputData; ++ /*! Data we didn't manage to send to wxMaxima until now ++ * ++ * \todo Do we still need this variable? We tell wxWidgets to send all data in ++ * one go, so there should be no data be left at the end of a write command. ++ */ ++ wxMemoryBuffer m_socketOutputData; + + //! true = Maxima still has to send us its first prompt + bool m_firstPrompt = true;