From cdddaea7a802a570a60e749b5179c0760d36e3fd Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Sat, 18 Feb 2023 11:44:02 +0100 Subject: kde-apps/okular: Fix build with >=app-text/discount-3 Closes: https://bugs.gentoo.org/892633 Signed-off-by: Andreas Sturmlechner --- .../okular/files/okular-22.12.2-discount-3.patch | 47 ++++++++++++++++++++++ kde-apps/okular/okular-22.12.2.ebuild | 1 + 2 files changed, 48 insertions(+) create mode 100644 kde-apps/okular/files/okular-22.12.2-discount-3.patch diff --git a/kde-apps/okular/files/okular-22.12.2-discount-3.patch b/kde-apps/okular/files/okular-22.12.2-discount-3.patch new file mode 100644 index 000000000000..e9fef2679adb --- /dev/null +++ b/kde-apps/okular/files/okular-22.12.2-discount-3.patch @@ -0,0 +1,47 @@ +From f1f638c2c51a6ef699dee22f6e90aff67beff8ec Mon Sep 17 00:00:00 2001 +From: Albert Astals Cid +Date: Wed, 1 Feb 2023 22:01:52 +0100 +Subject: [PATCH] Compile with discount 3 + +--- + generators/markdown/converter.cpp | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/generators/markdown/converter.cpp b/generators/markdown/converter.cpp +index 20d3c725f..3c8546b32 100644 +--- a/generators/markdown/converter.cpp ++++ b/generators/markdown/converter.cpp +@@ -93,6 +93,8 @@ QTextDocument *Converter::convertOpenFile() + { + rewind(m_markdownFile); + ++#if defined(MKD_NOLINKS) ++ // on discount 2 MKD_NOLINKS is a define + MMIOT *markdownHandle = mkd_in(m_markdownFile, 0); + + int flags = MKD_FENCEDCODE | MKD_GITHUBTAGS | MKD_AUTOLINK | MKD_TOC | MKD_IDANCHOR; +@@ -103,6 +105,21 @@ QTextDocument *Converter::convertOpenFile() + Q_EMIT error(i18n("Failed to compile the Markdown document."), -1); + return nullptr; + } ++#else ++ // on discount 3 MKD_NOLINKS is an enum value ++ MMIOT *markdownHandle = mkd_in(m_markdownFile, nullptr); ++ ++ mkd_flag_t *flags = mkd_flags(); ++ mkd_set_flag_bitmap(flags, MKD_FENCEDCODE | MKD_GITHUBTAGS | MKD_AUTOLINK | MKD_TOC | MKD_IDANCHOR); ++ if (!m_isFancyPantsEnabled) { ++ mkd_set_flag_num(flags, MKD_NOPANTS); ++ } ++ if (!mkd_compile(markdownHandle, flags)) { ++ Q_EMIT error(i18n("Failed to compile the Markdown document."), -1); ++ return nullptr; ++ } ++ mkd_free_flags(flags); ++#endif + + char *htmlDocument; + const int size = mkd_document(markdownHandle, &htmlDocument); +-- +GitLab + diff --git a/kde-apps/okular/okular-22.12.2.ebuild b/kde-apps/okular/okular-22.12.2.ebuild index b53a5f62b2fd..02e1c3eb56af 100644 --- a/kde-apps/okular/okular-22.12.2.ebuild +++ b/kde-apps/okular/okular-22.12.2.ebuild @@ -72,6 +72,7 @@ RDEPEND="${DEPEND} PATCHES=( "${FILESDIR}/${PN}-21.11.80-tests.patch" # bug 734138 "${FILESDIR}/${PN}-20.08.2-hide-mobile-app.patch" # avoid same-name entry + "${FILESDIR}/${PN}-22.12.2-discount-3.patch" # bug 892633 ) src_configure() { -- cgit v1.2.3-65-gdbad