From 0971f2b53c873eb4541e374af9ed5551615813f9 Mon Sep 17 00:00:00 2001 From: Mateusz Sylwestrzak Date: Sun, 23 Feb 2025 18:41:06 +0100 Subject: [PATCH] scribus: update to 1.6.3 --- .../fix_build_with_poppler_25.02.0.patch | 172 ++++++++++++++++++ srcpkgs/scribus/template | 6 +- 2 files changed, 175 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/scribus/patches/fix_build_with_poppler_25.02.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 new file mode 100644 index 00000000000..db775a8e050 --- /dev/null +++ b/srcpkgs/scribus/patches/fix_build_with_poppler_25.02.0.patch @@ -0,0 +1,172 @@ +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..b3d35f0 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..72e11b4 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) +- codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n); +- ff.reset(); ++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 2, 0) ++ codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get()); + #else +- codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n); +- delete ff; ++ codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n); + #endif ++ ff.reset(); + } +-#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)"); diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template index 9570625dad0..d65ddc5df3e 100644 --- a/srcpkgs/scribus/template +++ b/srcpkgs/scribus/template @@ -1,7 +1,7 @@ # Template file for 'scribus' pkgname=scribus -version=1.6.2 -revision=2 +version=1.6.3 +revision=1 build_style=cmake configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP20=ON" @@ -17,7 +17,7 @@ maintainer="Enno Boland " license="GPL-2.0-or-later" homepage="https://scribus.net" distfiles="$SOURCEFORGE_SITE/scribus/scribus/${version}/scribus-${version}.tar.xz" -checksum=7eff9b1f47e372e56bb369f1dbe18fe49101789b5e6bcfdb7890e0346b641383 +checksum=0ae58ced410101e82655e3b4c20a070cf1767145ada233dcef7c20b8ba6bd487 python_version=3 do_patch() {