From aec07cfb10abf1e4ab099a58ec5c84413bece51f Mon Sep 17 00:00:00 2001 From: José Matos Date: Jun 02 2020 16:49:39 +0000 Subject: use upstream patch to avoid crash when exporting to latex --- diff --git a/wxMaxima.spec b/wxMaxima.spec index 9f2fe39..3a4ddd4 100644 --- a/wxMaxima.spec +++ b/wxMaxima.spec @@ -4,18 +4,19 @@ Summary: Graphical user interface for Maxima Name: wxMaxima Version: 20.04.0 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ URL: https://wxmaxima-developers.github.io/wxmaxima/ Source0: https://github.com/wxMaxima-developers/wxmaxima/archive/Version-%{version}.tar.gz -## upstreamable patches -# Hurray, none at this release :-) +## upstream patches +Patch0: wxmaxima-fix-latex-crash.patch # match archs maxima uses ExclusiveArch: %{arm} %{ix86} x86_64 aarch64 ppc sparcv9 +BuildRequires: git-core BuildRequires: dos2unix BuildRequires: gcc BuildRequires: gcc-c++ @@ -39,7 +40,7 @@ Maxima using wxWidgets. %prep -%autosetup -n wxmaxima-Version-%{version} -p1 +%autosetup -n wxmaxima-Version-%{version} -S git dos2unix data/io.github.wxmaxima_developers.wxMaxima.desktop desktop-file-validate data/io.github.wxmaxima_developers.wxMaxima.desktop @@ -107,6 +108,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/io.github.wxmaxima_de %changelog +* Tue Jun 2 2020 José Matos - 20.04.0-2 +- use upstream patch to avoid crash when exporting to latex + * Mon Jun 1 2020 José Matos - 20.04.0-1 - update to 20.04.0 - add the man pages in German diff --git a/wxmaxima-fix-latex-crash.patch b/wxmaxima-fix-latex-crash.patch new file mode 100644 index 0000000..7a46ff0 --- /dev/null +++ b/wxmaxima-fix-latex-crash.patch @@ -0,0 +1,42 @@ +From 213d70b532ed19a0ffdc39bf55ca9013eabf4cf7 Mon Sep 17 00:00:00 2001 +From: Kuba Ober +Date: Mon, 1 Jun 2020 02:35:30 -0400 +Subject: [PATCH] Fix the LaTeX copy caused by invalid format strings. Fixes + #1288. + +Note: When escaping runs of percent signs (`%`), each escaped `%` must consist of a pair `%%`. Thus, each run must have an even number of `%` signs (i.e. must consist of pairs only). +--- + src/GroupCell.cpp | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/GroupCell.cpp b/src/GroupCell.cpp +index 9db5ab08b..900852ba5 100644 +--- a/src/GroupCell.cpp ++++ b/src/GroupCell.cpp +@@ -1418,7 +1418,7 @@ wxString GroupCell::ToTeXCodeCell(wxString imgDir, wxString filename, int *imgCo + const std::string saved_lc_numeric{setlocale(LC_NUMERIC, NULL)}; // get current LC_NUMERIC locale + setlocale(LC_NUMERIC, "C"); + str += wxString::Format( +- "\n\n\\noindent\n%%%%%%%%%%%%%%%\n%%% INPUT:\n\\begin{minipage}[t]{%fem}\\color{red}\\bfseries\n", ++ "\n\n\\noindent\n%%%%%%%%%%%%%%%%\n%%%% INPUT:\n\\begin{minipage}[t]{%fem}\\color{red}\\bfseries\n", + (double)configuration->GetLabelWidth()/14 + ) + m_inputLabel->ToTeX() + + wxString("\n\\end{minipage}"); +@@ -1435,7 +1435,7 @@ wxString GroupCell::ToTeXCodeCell(wxString imgDir, wxString filename, int *imgCo + + if (m_output != NULL) + { +- str += wxT("\n%%% OUTPUT:\n"); ++ str += wxT("\n%%%% OUTPUT:\n"); + // Need to define labelcolor if this is Copy as LaTeX! + if (imgCounter == NULL) + str += wxT("\\definecolor{labelcolor}{RGB}{100,0,0}\n"); +@@ -1496,7 +1496,7 @@ wxString GroupCell::ToTeXCodeCell(wxString imgDir, wxString filename, int *imgCo + { + // Some invisible dummy content that keeps TeX happy if there really is + // no output to display. +- str += wxT("\\mbox{}\n\\]\n%%%%%%%%%%%%%%%"); ++ str += wxT("\\mbox{}\n\\]\n%%%%%%%%%%%%%%%%"); + } + } + else