From 807bb9a19c07f8b2ed4bcd83e36511d4c84e14b6 Mon Sep 17 00:00:00 2001 From: starlet-dx <15929766099@163.com> Date: Wed, 25 Dec 2024 15:21:46 +0800 Subject: [PATCH] Fix build failure caused by Ghostscript updated --- reverted-changes-to-Ghostscript-class.patch | 62 +++++++++++++++++++++ texlive-base.spec | 7 ++- 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 reverted-changes-to-Ghostscript-class.patch diff --git a/reverted-changes-to-Ghostscript-class.patch b/reverted-changes-to-Ghostscript-class.patch new file mode 100644 index 0000000..cc27f5a --- /dev/null +++ b/reverted-changes-to-Ghostscript-class.patch @@ -0,0 +1,62 @@ +From d10a3a282c0345ecb08400b83b15c6c73f9335df Mon Sep 17 00:00:00 2001 +From: Martin Gieseking +Date: Tue, 6 Dec 2022 16:26:20 +0100 +Subject: [PATCH] reverted changes to Ghostscript class introduced by + c6d578aea100b28625737942c37ce1269e976dba closes #206 + +Origin: +https://github.com/mgieseki/dvisvgm/commit/d10a3a282c0345ecb08400b83b15c6c73f9335df +--- + texlive-20210325-source/texk/dvisvgm/dvisvgm-src/src/Ghostscript.cpp | 14 ++------------ + texlive-20210325-source/texk/dvisvgm/dvisvgm-src/src/Ghostscript.hpp | 4 ++-- + 2 files changed, 4 insertions(+), 14 deletions(-) + +diff --git a/texlive-20210325-source/texk/dvisvgm/dvisvgm-src/src/Ghostscript.cpp b/texlive-20210325-source/texk/dvisvgm/dvisvgm-src/src/Ghostscript.cpp +index 24d2cb8b..3675c5a9 100644 +--- a/texlive-20210325-source/texk/dvisvgm/dvisvgm-src/src/Ghostscript.cpp ++++ b/texlive-20210325-source/texk/dvisvgm/dvisvgm-src/src/Ghostscript.cpp +@@ -130,7 +130,7 @@ static string get_libgs (const string &fname) { + return get_gsdll32(); + #else + // try to find libgs.so.X on the user's system +- const int abi_min=7, abi_max=9; // supported libgs ABI versions ++ const int abi_min=7, abi_max=10; // supported libgs ABI versions + for (int i=abi_max; i >= abi_min; i--) { + #if defined(__CYGWIN__) + string dlname = "cyggs-" + to_string(i) + ".dll"; +@@ -378,19 +378,9 @@ const char* Ghostscript::error_name (int code) { + if (code < 0) + code = -code; + const char *error_names[] = { ERROR_NAMES }; +- if (code == 0 || (size_t)code > sizeof(error_names)/sizeof(error_names[0])) ++ if (code == 0 || size_t(code) > sizeof(error_names)/sizeof(error_names[0])) + return nullptr; +-#if defined(HAVE_LIBGS) +- // use array defined in libgs to avoid linking the error strings into the binary +- return gs_error_names[code-1]; +-#elif defined(_WIN32) +- // gs_error_names is private in the Ghostscript DLL so we can't access it here + return error_names[code-1]; +-#else +- if (auto error_names = loadSymbol("gs_error_names")) +- return error_names[code-1]; +- return nullptr; +-#endif + } + + #endif // !DISABLE_GS +diff --git a/texlive-20210325-source/texk/dvisvgm/dvisvgm-src/src/Ghostscript.hpp b/texlive-20210325-source/texk/dvisvgm/dvisvgm-src/src/Ghostscript.hpp +index 9faa63e3..ce3b72fa 100644 +--- a/texlive-20210325-source/texk/dvisvgm/dvisvgm-src/src/Ghostscript.hpp ++++ b/texlive-20210325-source/texk/dvisvgm/dvisvgm-src/src/Ghostscript.hpp +@@ -47,8 +47,8 @@ struct Ghostscript { + Ghostscript (int argc, const char **argv, void *caller=0) {} + bool init (int argc, const char **argv, void *caller=0) {return false;} + bool available () {return false;} +- bool revision (gsapi_revision_t *r) {return false;} +- int revision () {return 0;} ++ bool revision (gsapi_revision_t *r) const {return false;} ++ int revision () const {return 0;} + std::string revisionstr () {return "";} + int set_stdio (Stdin in, Stdout out, Stderr err) {return 0;} + int run_string_begin (int user_errors, int *pexit_code) {return 0;} diff --git a/texlive-base.spec b/texlive-base.spec index 429e9ea..efa24e3 100644 --- a/texlive-base.spec +++ b/texlive-base.spec @@ -4,7 +4,7 @@ Name: texlive-base Version: 20210325 -Release: 9 +Release: 10 Epoch: 9 Summary: TeX formatting system License: ASL 2.0 and LGPL-2.1-only and Zlib and OFL-1.1 and Public Domain and LGPL-2.0-only and GPLv2+ and MPL-1.1 and Libpng and LGPL-3.0-only and BSL-1.0 and GPLv2 and GPLv3 and CPL-1.0 and IJG and MIT and LPPL-1.3c and ICU and psutils @@ -431,6 +431,8 @@ Patch0034: CVE-2023-32700.patch Patch0035: CVE-2023-46048.patch Patch0036: CVE-2023-46051.patch +Patch0037: reverted-changes-to-Ghostscript-class.patch + BuildRequires: xz libXaw-devel libXi-devel ncurses-devel bison flex file perl(Digest::MD5) texinfo gcc-c++ BuildRequires: gd-devel freetype-devel libpng-devel zlib-devel potrace-devel BuildRequires: zziplib-devel libicu-devel cairo-devel harfbuzz-devel perl-generators pixman-devel graphite2-devel @@ -8621,6 +8623,9 @@ yes | %{_bindir}/updmap-sys --quiet --syncwithtrees >/dev/null 2>&1 || : %doc %{_datadir}/texlive/texmf-dist/doc/latex/yplan/ %changelog +* Wed Dec 25 2024 yaoxin - 9:20210325-10 +- Fix build failure caused by Ghostscript updated + * Wed Aug 21 2024 xu_ping <707078654@qq.com> - 9:20210325-9 - License compliance rectification. -- Gitee