public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Miroslav Šulc" <fordfrog@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-office/scribus/files/, app-office/scribus/
Date: Thu, 10 Feb 2022 19:38:05 +0000 (UTC)	[thread overview]
Message-ID: <1644521863.a7e4e34c72ef8b2df011b995ba3c85fac10a5394.fordfrog@gentoo> (raw)

commit:     a7e4e34c72ef8b2df011b995ba3c85fac10a5394
Author:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 10 19:37:43 2022 +0000
Commit:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Thu Feb 10 19:37:43 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a7e4e34c

app-office/scribus: added patches for poppler 2.22.0

Bug: https://bugs.gentoo.org/833086
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>

 .../files/scribus-1.5.8-poppler-22.2.0-1.patch     | 129 +++++++++++++++++++++
 .../files/scribus-1.5.8-poppler-22.2.0-2.patch     |  28 +++++
 app-office/scribus/scribus-1.5.8.ebuild            |   2 +
 3 files changed, 159 insertions(+)

diff --git a/app-office/scribus/files/scribus-1.5.8-poppler-22.2.0-1.patch b/app-office/scribus/files/scribus-1.5.8-poppler-22.2.0-1.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/app-office/scribus/files/scribus-1.5.8-poppler-22.2.0-1.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ 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;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					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);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	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/app-office/scribus/files/scribus-1.5.8-poppler-22.2.0-2.patch b/app-office/scribus/files/scribus-1.5.8-poppler-22.2.0-2.patch
new file mode 100644
index 000000000000..73beac2d70d0
--- /dev/null
+++ b/app-office/scribus/files/scribus-1.5.8-poppler-22.2.0-2.patch
@@ -0,0 +1,28 @@
+From f75c1613db67f4067643d0218a2db3235e42ec9f Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Thu, 3 Feb 2022 19:46:13 +0000
+Subject: [PATCH] Small update vs latest code in poppler
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24885 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 3650c96f52..a6f4e00fa9 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -3072,10 +3072,10 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		delete id;
+ 	else
+ 	{
+-		if (!(fontLoc = gfxFont->locateFont(xref, nullptr)))
++		fontLoc = gfxFont->locateFont((xref) ? xref : pdfDoc->getXRef(), nullptr);
++		if (!fontLoc)
+ 		{
+-			error(errSyntaxError, -1, "Couldn't find a font for '{0:s}'",
+-			gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++			error(errSyntaxError, -1, "Couldn't find a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 			goto err2;
+ 		}
+ 

diff --git a/app-office/scribus/scribus-1.5.8.ebuild b/app-office/scribus/scribus-1.5.8.ebuild
index 472e6c130552..506619d80133 100644
--- a/app-office/scribus/scribus-1.5.8.ebuild
+++ b/app-office/scribus/scribus-1.5.8.ebuild
@@ -76,6 +76,8 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-1.5.6-docdir.patch
 	"${FILESDIR}"/${PN}-1.5.8-findhyphen-1.patch
 	"${FILESDIR}"/${PN}-1.5.6-findhyphen.patch
+	"${FILESDIR}"/${PN}-1.5.8-poppler-22.2.0-1.patch
+	"${FILESDIR}"/${PN}-1.5.8-poppler-22.2.0-2.patch
 )
 
 CMAKE_BUILD_TYPE="Release"


             reply	other threads:[~2022-02-10 20:25 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-10 19:38 Miroslav Šulc [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-11-03 20:36 [gentoo-commits] repo/gentoo:master commit in: app-office/scribus/files/, app-office/scribus/ Andreas Sturmlechner
2024-06-03 17:36 Miroslav Šulc
2024-05-22  7:39 Miroslav Šulc
2024-05-14 17:25 Andreas Sturmlechner
2024-03-04 22:18 Andreas Sturmlechner
2024-01-14 10:24 Miroslav Šulc
2024-01-14  9:38 Miroslav Šulc
2024-01-01  9:30 Miroslav Šulc
2023-03-17  6:52 Miroslav Šulc
2023-02-06 10:36 Andreas Sturmlechner
2022-03-27  6:05 Miroslav Šulc
2021-10-09 19:38 Sam James
2021-05-30 10:45 Miroslav Šulc
2021-03-07  1:30 Andreas Sturmlechner
2020-07-18  8:41 Andreas Sturmlechner
2020-05-30  9:31 Andreas Sturmlechner
2020-04-07  7:49 Andreas Sturmlechner
2019-12-29 11:54 Andreas Sturmlechner
2019-11-08 20:13 Andreas Sturmlechner
2019-10-01 23:43 Andreas Sturmlechner
2019-08-16  8:52 Miroslav Šulc
2019-06-23 16:44 Miroslav Šulc
2018-06-20 16:31 Andreas Sturmlechner
2018-05-10 15:55 Andreas Sturmlechner
2018-03-13 22:50 Andreas Sturmlechner
2018-01-09 13:46 Andreas Sturmlechner
2017-12-20 21:34 Justin Lecher
2016-11-06  8:25 Justin Lecher
2016-10-23 20:25 Justin Lecher
2016-09-27 18:50 Michael Weber
2015-10-19 12:06 Justin Lecher
2015-10-16 13:04 Justin Lecher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1644521863.a7e4e34c72ef8b2df011b995ba3c85fac10a5394.fordfrog@gentoo \
    --to=fordfrog@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox