diff --git a/community/scribus/APKBUILD b/community/scribus/APKBUILD index 9e88352130e4af811ad768faf79e5994a442406a..8a5436d5961d30f745ab8151ec2a96a80011940b 100644 --- a/community/scribus/APKBUILD +++ b/community/scribus/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Milan P. Stanić <mps@arvanta.net> pkgname=scribus pkgver=1.5.8 -pkgrel=1 +pkgrel=2 pkgdesc="libre desktop publishing" url="https://www.scribus.net/" arch="all" @@ -16,6 +16,8 @@ makedepends="cmake boost-dev cairo-dev cups-dev harfbuzz-dev hunspell-dev subpackages="$pkgname-doc $pkgname-lang" source="https://downloads.sourceforge.net/scribus/scribus-$pkgver.tar.xz fix-util_debug.cpp.patch + poppler-22.02.patch + poppler-22.03.patch " langdir="/usr/share/scribus/translations" @@ -29,7 +31,8 @@ build() { -DBUILD_SHARED_LIBS=True \ -DCMAKE_BUILD_TYPE=None \ -DWANT_DISTROBUILD=True \ - $CMAKE_CROSSOPTS . + -DWANT_CPP17=True \ + $CMAKE_CROSSOPTS cmake --build build } @@ -45,4 +48,6 @@ package() { sha512sums=" eb46be0165eeb0d8974aa744fc8ffac321b206ca0015da39bb2f50d9fd4a5e28300a49ada0f963b4e0cf9a3301dc746ffba74f359f5e76d308d80b71ee669c2d scribus-1.5.8.tar.xz b56359d5e7aa3001cef6a9d6330e5c32a4c7570880b9eeeb79f6ff0ea7a050a5f3964ad0fef653a437e200dfc5d714a8a9c6b30158bbb1abf5d4bc98445f5205 fix-util_debug.cpp.patch +fba5da56416c8a84d66e664ccd07cb4fc451de7bc94effa8bcbd1240cc0370ba4a43c89e4283e8a67627cb1070a6a398c196a368c5825f93c349d38574b0805d poppler-22.02.patch +f696e1be43d9280829260545888cc83c575e10cbfc766e7c4899fed0521716566149becd1895d721469ca5e9d2c531487eda1547b2d8c3831388e657235fa3fb poppler-22.03.patch " diff --git a/community/scribus/poppler-22.02.patch b/community/scribus/poppler-22.02.patch new file mode 100644 index 0000000000000000000000000000000000000000..d0843ed623f4d0b30139d807eb478be39d3d1321 --- /dev/null +++ b/community/scribus/poppler-22.02.patch @@ -0,0 +1,132 @@ +Patch-Source: https://github.com/archlinux/svntogit-community/blob/b51bcb6c80f4b4102b4d59dcded7901a4e30a3bb/trunk/poppler-22.02.0.patch +diff -upr scribus-1.5.8.orig/scribus/plugins/import/pdf/slaoutput.cpp scribus-1.5.8/scribus/plugins/import/pdf/slaoutput.cpp +--- scribus-1.5.8.orig/scribus/plugins/import/pdf/slaoutput.cpp 2022-01-23 18:16:01.000000000 +0200 ++++ scribus-1.5.8/scribus/plugins/import/pdf/slaoutput.cpp 2022-02-02 12:21:07.441133975 +0200 +@@ -7,6 +7,8 @@ for which a new license (GPL+exception) + + #include "slaoutput.h" + ++#include <memory> ++#include <optional> + #include <poppler/GlobalParams.h> + #include <poppler/poppler-config.h> + #include <poppler/FileSpec.h> +@@ -3027,14 +3029,19 @@ void SlaOutputDev::markPoint(POPPLER_CON + void SlaOutputDev::updateFont(GfxState *state) + { + GfxFont *gfxFont; +- GfxFontLoc *fontLoc; ++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0) ++ std::optional<GfxFontLoc> fontLoc; ++ const GooString *fileName = nullptr; ++#else ++ GfxFontLoc *fontLoc = nullptr; ++ GooString *fileName = nullptr; ++ FoFiTrueType *ff; ++#endif + GfxFontType fontType; + SlaOutFontFileID *id; + SplashFontFile *fontFile; + SplashFontSrc *fontsrc = nullptr; +- FoFiTrueType *ff; + Object refObj, strObj; +- GooString *fileName; + char *tmpBuf; + int tmpBufLen = 0; + int *codeToGID; +@@ -3046,9 +3053,7 @@ void SlaOutputDev::updateFont(GfxState * + SplashCoord matrix[6]; + + m_font = nullptr; +- fileName = nullptr; + tmpBuf = nullptr; +- fontLoc = nullptr; + + gfxFont = state->getFont(); + if (!gfxFont) +@@ -3083,7 +3088,11 @@ void SlaOutputDev::updateFont(GfxState * + } + else + { // gfxFontLocExternal ++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0) ++ fileName = fontLoc->pathAsGooString(); ++#else + fileName = fontLoc->path; ++#endif + fontType = fontLoc->fontType; + } + +@@ -3130,15 +3139,23 @@ void SlaOutputDev::updateFont(GfxState * + break; + case fontTrueType: + case fontTrueTypeOT: ++ { ++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0) ++ std::unique_ptr<FoFiTrueType> ff; ++#endif + if (fileName) + ff = FoFiTrueType::load(fileName->getCString()); + else + ff = FoFiTrueType::make(tmpBuf, tmpBufLen); + if (ff) + { ++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0) ++ codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff.get()); ++#else + codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff); +- n = 256; + delete ff; ++#endif ++ n = 256; + } + else + { +@@ -3154,6 +3171,7 @@ void SlaOutputDev::updateFont(GfxState * + gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)"); + goto err2; + } ++ } + break; + case fontCIDType0: + case fontCIDType0C: +@@ -3203,14 +3221,21 @@ void SlaOutputDev::updateFont(GfxState * + } + else + { ++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0) ++ std::unique_ptr<FoFiTrueType> ff; ++#endif + if (fileName) + ff = FoFiTrueType::load(fileName->getCString()); + else + ff = FoFiTrueType::make(tmpBuf, tmpBufLen); + if (! ff) + goto err2; ++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0) ++ codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff.get(), &n); ++#else + codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n); + delete ff; ++#endif + } + if (!(fontFile = m_fontEngine->loadTrueTypeFont( + id, +@@ -3247,14 +3272,18 @@ void SlaOutputDev::updateFont(GfxState * + mat[3] = -m22; + m_font = m_fontEngine->getFont(fontFile, mat, matrix); + ++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0) + delete fontLoc; ++#endif + if (fontsrc && !fontsrc->isFile) + fontsrc->unref(); + return; + + err2: + delete id; ++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0) + delete fontLoc; ++#endif + err1: + if (fontsrc && !fontsrc->isFile) + fontsrc->unref(); diff --git a/community/scribus/poppler-22.03.patch b/community/scribus/poppler-22.03.patch new file mode 100644 index 0000000000000000000000000000000000000000..d185b2765cc8e2d742f7d6f4b635911dbbb1c178 --- /dev/null +++ b/community/scribus/poppler-22.03.patch @@ -0,0 +1,40 @@ +Patch-Source: https://github.com/archlinux/svntogit-community/blob/b51bcb6c80f4b4102b4d59dcded7901a4e30a3bb/trunk/poppler-22.03.0.patch +diff -upr scribus-1.5.8.orig/scribus/plugins/import/pdf/importpdf.cpp scribus-1.5.8/scribus/plugins/import/pdf/importpdf.cpp +--- scribus-1.5.8.orig/scribus/plugins/import/pdf/importpdf.cpp 2022-01-23 18:16:01.000000000 +0200 ++++ scribus-1.5.8/scribus/plugins/import/pdf/importpdf.cpp 2022-03-02 14:03:29.851352471 +0200 +@@ -90,7 +90,11 @@ QImage PdfPlug::readThumbnail(const QStr + #endif + globalParams->setErrQuiet(gTrue); + ++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0) ++ PDFDoc pdfDoc{std::make_unique<GooString>(fname)}; ++#else + PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr}; ++#endif + if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted) + return QImage(); + +@@ -343,7 +347,11 @@ bool PdfPlug::convert(const QString& fn) + globalParams->setErrQuiet(gTrue); + // globalParams->setPrintCommands(gTrue); + QList<OptionalContentGroup*> ocgGroups; ++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0) ++ auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(std::make_unique<GooString>(fname))); ++#else + auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr)); ++#endif + if (pdfDoc) + { + if (pdfDoc->getErrorCode() == errEncrypted) +@@ -363,7 +371,11 @@ bool PdfPlug::convert(const QString& fn) + auto fname = new GooString(QFile::encodeName(fn).data()); + #endif + auto userPW = new GooString(text.toLocal8Bit().data()); ++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0) ++ pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), GooString(userPW), GooString(userPW))); ++#else + pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr)); ++#endif + qApp->changeOverrideCursor(QCursor(Qt::WaitCursor)); + } + if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))