From 504d9a5c35a6aa8f9d792b3afc5dc38bdc388963 Mon Sep 17 00:00:00 2001 From: Mateusz Sylwestrzak Date: Sat, 21 Jun 2025 19:56:58 +0200 Subject: [PATCH] scribus: update to 1.6.4 --- .../fix_build_with_poppler_25.02.0.patch | 172 ------------------ .../fix_build_with_poppler_25.06.0.patch | 17 ++ srcpkgs/scribus/template | 6 +- 3 files changed, 20 insertions(+), 175 deletions(-) delete mode 100644 srcpkgs/scribus/patches/fix_build_with_poppler_25.02.0.patch create mode 100644 srcpkgs/scribus/patches/fix_build_with_poppler_25.06.0.patch diff --git a/srcpkgs/scribus/patches/fix_build_with_poppler_25.02.0.patch b/srcpkgs/scribus/patches/fix_build_with_poppler_25.02.0.patch deleted file mode 100644 index 8bdf7dbc571..00000000000 --- a/srcpkgs/scribus/patches/fix_build_with_poppler_25.02.0.patch +++ /dev/null @@ -1,172 +0,0 @@ -diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp -index 92539d1..ac8e2eb 100644 ---- a/scribus/plugins/import/pdf/importpdf.cpp -+++ b/scribus/plugins/import/pdf/importpdf.cpp -@@ -462,11 +462,11 @@ bool PdfPlug::convert(const QString& fn) - - if (dev->isOk()) - { -- OCGs* ocg = pdfDoc->getOptContentConfig(); -+ POPPLER_CONST_25_02 OCGs* ocg = pdfDoc->getOptContentConfig(); - if (ocg && ocg->hasOCGs()) - { - QStringList ocgNames; -- Array *order = ocg->getOrderArray(); -+ POPPLER_CONST_25_02 Array *order = ocg->getOrderArray(); - if (order) - { - for (int i = 0; i < order->getLength (); ++i) -diff --git a/scribus/plugins/import/pdf/importpdfconfig.h b/scribus/plugins/import/pdf/importpdfconfig.h -index b922816..7ae96a8 100644 ---- a/scribus/plugins/import/pdf/importpdfconfig.h -+++ b/scribus/plugins/import/pdf/importpdfconfig.h -@@ -15,6 +15,12 @@ for which a new license (GPL+exception) is in place. - + ((micro) * 1)) - #define POPPLER_ENCODED_VERSION POPPLER_VERSION_ENCODE(POPPLER_VERSION_MAJOR, POPPLER_VERSION_MINOR, POPPLER_VERSION_MICRO) - -+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 2, 0) -+#define POPPLER_CONST_25_02 const -+#else -+#define POPPLER_CONST_25_02 -+#endif -+ - #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 82, 0) - #define POPPLER_CONST_082 const - #else -diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp -index 0244c9f..09a90f3 100644 ---- a/scribus/plugins/import/pdf/slaoutput.cpp -+++ b/scribus/plugins/import/pdf/slaoutput.cpp -@@ -2932,7 +2932,7 @@ void SlaOutputDev::beginMarkedContent(const char *name, Object *dictRef) - { - if (dictRef->isNull()) - return; -- OCGs *contentConfig = m_catalog->getOptContentConfig(); -+ POPPLER_CONST_25_02 OCGs *contentConfig = m_catalog->getOptContentConfig(); - OptionalContentGroup *oc; - if (dictRef->isRef()) - { -@@ -3081,10 +3081,11 @@ void SlaOutputDev::updateFont(GfxState *state) - SplashFontFile *fontFile; - SplashFontSrc *fontsrc = nullptr; - Object refObj, strObj; --#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 4, 0) -- int tmpBufLen = 0; --#endif -+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 2, 0) -+ std::vector codeToGID; -+#else - int *codeToGID = nullptr; -+#endif - const double *textMat = nullptr; - double m11, m12, m21, m22, fontSize; - SplashCoord mat[4] = { 1.0, 0.0, 0.0, 1.0 }; -@@ -3244,10 +3245,20 @@ void SlaOutputDev::updateFont(GfxState *state) - } - else - { -+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 2, 0) -+ codeToGID.clear(); -+#else - codeToGID = nullptr; -+#endif - n = 0; - } --#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(24, 11, 0) -+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 2, 0) -+ if (!(fontFile = m_fontEngine->loadTrueTypeFont(std::move(id), fontsrc, std::move(codeToGID), fontLoc->fontNum))) -+ { -+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)"); -+ goto err2; -+ } -+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(24, 11, 0) - if (!(fontFile = m_fontEngine->loadTrueTypeFont(std::move(id), fontsrc, codeToGID, n, fontLoc->fontNum))) - { - error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)"); -@@ -3278,6 +3289,18 @@ void SlaOutputDev::updateFont(GfxState *state) - #endif - break; - case fontCIDType0COT: -+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 2, 0) -+ if (((GfxCIDFont*) gfxFont)->getCIDToGIDLen() > 0) -+ { -+ codeToGID = ((GfxCIDFont*) gfxFont)->getCIDToGID(); -+ n = codeToGID.size(); -+ } -+ else -+ { -+ codeToGID.clear(); -+ n = 0; -+ } -+#else - if (((GfxCIDFont *) gfxFont)->getCIDToGID()) - { - n = ((GfxCIDFont *) gfxFont)->getCIDToGIDLen(); -@@ -3289,7 +3312,15 @@ void SlaOutputDev::updateFont(GfxState *state) - codeToGID = nullptr; - n = 0; - } --#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(24, 11, 0) -+#endif -+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 2, 0) -+ if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(std::move(id), fontsrc, std::move(codeToGID), fontLoc->fontNum))) -+ { -+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", -+ gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)"); -+ goto err2; -+ } -+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(24, 11, 0) - if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(std::move(id), fontsrc, codeToGID, n, fontLoc->fontNum))) - { - error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", -@@ -3307,6 +3338,15 @@ void SlaOutputDev::updateFont(GfxState *state) - break; - case fontCIDType2: - case fontCIDType2OT: -+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 2, 0) -+ codeToGID.clear(); -+ n = 0; -+ if (((GfxCIDFont*) gfxFont)->getCIDToGIDLen() > 0) -+ { -+ codeToGID = ((GfxCIDFont*) gfxFont)->getCIDToGID(); -+ n = codeToGID.size(); -+ } -+#else - codeToGID = nullptr; - n = 0; - if (((GfxCIDFont *) gfxFont)->getCIDToGID()) -@@ -3318,6 +3358,7 @@ void SlaOutputDev::updateFont(GfxState *state) - memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(), n * sizeof(*codeToGID)); - } - } -+#endif - else - { - #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(24, 11, 0) -@@ -3338,15 +3379,20 @@ void SlaOutputDev::updateFont(GfxState *state) - #endif - if (! ff) - goto err2; --#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0) -+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 2, 0) -+ codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get()); -+#else - codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n); -+#endif - ff.reset(); --#else -- codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n); -- delete ff; --#endif -+ } -+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 2, 0) -+ if (!(fontFile = m_fontEngine->loadTrueTypeFont(std::move(id), fontsrc, std::move(codeToGID), fontLoc->fontNum))) -+ { -+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)"); -+ goto err2; - } --#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(24, 11, 0) -+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(24, 11, 0) - if (!(fontFile = m_fontEngine->loadTrueTypeFont(std::move(id), fontsrc, codeToGID, n, fontLoc->fontNum))) - { - error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)"); diff --git a/srcpkgs/scribus/patches/fix_build_with_poppler_25.06.0.patch b/srcpkgs/scribus/patches/fix_build_with_poppler_25.06.0.patch new file mode 100644 index 00000000000..07633fbf1ec --- /dev/null +++ b/srcpkgs/scribus/patches/fix_build_with_poppler_25.06.0.patch @@ -0,0 +1,17 @@ +diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp +index 4518fa4..8214243 100644 +--- a/scribus/plugins/import/pdf/slaoutput.cpp ++++ b/scribus/plugins/import/pdf/slaoutput.cpp +@@ -606,7 +606,12 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor, + FormWidget *fm = m_formWidgets->getWidget(i); + if (!fm) + continue; ++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 06, 0) ++ std::shared_ptr anoSharedPtr = fm->getWidgetAnnotation(); ++ AnnotWidget* ano = anoSharedPtr.get(); ++#else + AnnotWidget *ano = fm->getWidgetAnnotation(); ++#endif + if (!ano) + continue; + if (ano != (AnnotWidget*) annota) diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template index d65ddc5df3e..a4b002d90a6 100644 --- a/srcpkgs/scribus/template +++ b/srcpkgs/scribus/template @@ -1,6 +1,6 @@ # Template file for 'scribus' pkgname=scribus -version=1.6.3 +version=1.6.4 revision=1 build_style=cmake configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr @@ -17,10 +17,10 @@ maintainer="Enno Boland " license="GPL-2.0-or-later" homepage="https://scribus.net" distfiles="$SOURCEFORGE_SITE/scribus/scribus/${version}/scribus-${version}.tar.xz" -checksum=0ae58ced410101e82655e3b4c20a070cf1767145ada233dcef7c20b8ba6bd487 +checksum=533be7af03acfaa736ec5f7a3fc2562abd200fef5ca2a7cdee02b5f44d61829e python_version=3 -do_patch() { +pre_patch() { vsed -i CMakeLists.txt -e 's|WANT_CPP17|WANT_CPP20|g' \ -e 's|CMAKE_CXX_STANDARD 17|CMAKE_CXX_STANDARD 20|g' }