From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id oIhpO50fuF74DAAA0tVLHw (envelope-from ) for ; Sun, 10 May 2020 15:37:01 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id MDZ3IqsfuF5jWQAAbx9fmQ (envelope-from ) for ; Sun, 10 May 2020 15:37:15 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 25E26940C62 for ; Sun, 10 May 2020 15:37:13 +0000 (UTC) Received: from localhost ([::1]:57936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXo0v-0007TB-2N for larch@yhetil.org; Sun, 10 May 2020 11:37:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXo0l-0007Qi-3G for guix-patches@gnu.org; Sun, 10 May 2020 11:37:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38702) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jXo0k-0000iZ-P5 for guix-patches@gnu.org; Sun, 10 May 2020 11:37:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jXo0k-0003TT-M0 for guix-patches@gnu.org; Sun, 10 May 2020 11:37:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41176] [PATCH] gnu: scribus: Fix build against poppler-0.86 Resent-From: "Boris A. Dekshteyn" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 10 May 2020 15:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41176 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41176@debbugs.gnu.org Cc: "Boris A. Dekshteyn" X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.158912498113280 (code B ref -1); Sun, 10 May 2020 15:37:02 +0000 Received: (at submit) by debbugs.gnu.org; 10 May 2020 15:36:21 +0000 Received: from localhost ([127.0.0.1]:50248 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jXo04-0003S7-HJ for submit@debbugs.gnu.org; Sun, 10 May 2020 11:36:21 -0400 Received: from lists.gnu.org ([209.51.188.17]:33634) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jXo02-0003Rx-E2 for submit@debbugs.gnu.org; Sun, 10 May 2020 11:36:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXo01-0006si-KA for guix-patches@gnu.org; Sun, 10 May 2020 11:36:18 -0400 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]:46267) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jXnzw-0007eG-Qr for guix-patches@gnu.org; Sun, 10 May 2020 11:36:17 -0400 Received: by mail-lj1-x229.google.com with SMTP id f18so6747485lja.13 for ; Sun, 10 May 2020 08:36:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ErzxiaKcHvugcRr70Vvpr2Lz8A1H1KTlUwJpLHiCS9M=; b=ZsAuxaTVB9MJX4P/2aq05rrfR+ASVcouDeUsDvNWw3URZ+KM0F/lOa7N10rSnKmOTo Ohf/TgDPqZdoL7CKFjemHb3s6zkcXLLTIeoDHC2Vk/krEH/LjLO1ynTgDvuK/XmVlfSo RjTeDq3ppZ4kdOjMIQkiSeqcYq+o2tzWZp1y2OS7/8hx3XV89UOjMP3aoALlQ4tfi35V xxSurkFktzAQ8YigbOYT1JLXyJgPITosiu0uaypBOOmIY+eCS7nwBV44rSgm4gc5vEsl McdCbMMGa1Dmfl17I47yysZ/7rN5xzKKGWymiTnE7hIMbujr2zoii6U5xK4c9sZGU/dj AHAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ErzxiaKcHvugcRr70Vvpr2Lz8A1H1KTlUwJpLHiCS9M=; b=hzHTdrOQZARNenrZQKNRpT+dyRCovYO78jSG+hMvlUf2Bpd8btdqL9eGtzq8Bbqytc aNveyRdHnVtMSTntFuuM8eeqDRW9nCZu1eSNG3LI73yzzWP6ygt6Z4iB2c8UATDp/hgA K1B8xRloLPOzoCo7paGSR7RG3V/b0jgLZLMFFnaRmFT+ldWJrw/2xi2xndwI8eXEysmm B5ojyNP0nAwk+gzwZEAcPtiab4yU/QGg2KgbSgFv/4LeYsix67/RXDJctNtmVvR4T9Bm Bf7aC07k2bsLW/p/KSY+pV+xztu3oGBJ6xFXiuH7u4T/NqQ4hIwEDgaBShhscVQF7rna f7RQ== X-Gm-Message-State: AOAM531YKtUZj8mxLx8JvTaEsaG1dF/Ox4CyI0ukSyHrP21W2+OPyWhy rlWAzkY3WgSL27QHWCULxYP8GX38ua8= X-Google-Smtp-Source: ABdhPJyPIiLUw6XflMARj7Zu86IbjtzZDHWtSQDIqSwGS/GXt7TooYvImNGkBODKJi9R/0KU0LpJrg== X-Received: by 2002:a2e:8805:: with SMTP id x5mr7812360ljh.223.1589124969265; Sun, 10 May 2020 08:36:09 -0700 (PDT) Received: from localhost ([2001:470:24:e81:e248:c95d:b39b:cf51]) by smtp.gmail.com with ESMTPSA id h20sm3743297lfj.26.2020.05.10.08.36.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2020 08:36:08 -0700 (PDT) From: "Boris A. Dekshteyn" Date: Mon, 11 May 2020 03:35:55 +1200 Message-Id: <20200510153555.22994-1-boris.dekshteyn@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::229; envelope-from=boris.dekshteyn@gmail.com; helo=mail-lj1-x229.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: 0.6 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -2.3 (--) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 X-Spam-Score: 2.59 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=ZsAuxaTV; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Scan-Result: default: False [2.59 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.53887141670216]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.51.188.0/24:c]; R_DKIM_REJECT(1.00)[gmail.com:s=20161025]; DWL_DNSWL_FAIL(0.00)[209.51.188.17:server fail]; FREEMAIL_FROM(0.00)[gmail.com]; R_MISSING_CHARSET(2.50)[]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.08), country: US(-0.00), ip: 209.51.188.17(-0.54)]; DKIM_TRACE(0.00)[gmail.com:-]; RCPT_COUNT_TWO(0.00)[2]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_IN_DNSWL_FAIL(0.00)[209.51.188.17:server fail]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:22989, ipnet:209.51.188.0/24, country:US]; TAGGED_FROM(0.00)[larch=yhetil.org]; ARC_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[borisdekshteyn@gmail.com,guix-patches-bounces@gnu.org]; FROM_HAS_DN(0.00)[]; URIBL_BLOCKED(0.00)[scribus.info:email,libertysurf.fr:email]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.51.188.17:from]; FREEMAIL_CC(0.00)[gmail.com]; RCVD_COUNT_SEVEN(0.00)[11]; FORGED_SENDER_MAILLIST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : SPF not aligned (relaxed),none] X-TUID: 28Xy5UYyusNK * gnu/packages/scribus.scm (scribus): Fix build against poppler-0.86 * gnu/packages/patches/scribus-1.5.5-poppler-0.86-build-fix.patch: New file * gnu/local.mk (dist_patch_DATA): Add new patch The original series of patches authored by Craig Bradney and Jean Ghali , taken from https://gitweb.gentoo.org/repo/gentoo.git/tree/app-office/scribus/files --- gnu/local.mk | 1 + ...scribus-1.5.5-poppler-0.86-build-fix.patch | 651 ++++++++++++++++++ gnu/packages/scribus.scm | 1 + 3 files changed, 653 insertions(+) create mode 100644 gnu/packages/patches/scribus-1.5.5-poppler-0.86-build-f= ix.patch diff --git a/gnu/local.mk b/gnu/local.mk index a7ccec5e0b..8177cd3186 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1479,6 +1479,7 @@ dist_patch_DATA =3D \ %D%/packages/patches/scotch-build-parallelism.patch \ %D%/packages/patches/scotch-integer-declarations.patch \ %D%/packages/patches/screen-hurd-path-max.patch \ + %D%/packages/patches/scribus-1.5.5-poppler-0.86-build-fix.patch \ %D%/packages/patches/sdl-libx11-1.6.patch \ %D%/packages/patches/seq24-rename-mutex.patch \ %D%/packages/patches/sharutils-CVE-2018-1000097.patch \ diff --git a/gnu/packages/patches/scribus-1.5.5-poppler-0.86-build-fix.patc= h b/gnu/packages/patches/scribus-1.5.5-poppler-0.86-build-fix.patch new file mode 100644 index 0000000000..ca5d500f46 --- /dev/null +++ b/gnu/packages/patches/scribus-1.5.5-poppler-0.86-build-fix.patch @@ -0,0 +1,651 @@ + scribus/plugins/import/pdf/importpdf.cpp | 73 +++++++- + scribus/plugins/import/pdf/importpdf.h | 1 + + scribus/plugins/import/pdf/importpdfconfig.h | 12 ++ + scribus/plugins/import/pdf/slaoutput.cpp | 170 +++++++++++++++++-- + scribus/plugins/import/pdf/slaoutput.h | 15 +- + 5 files changed, 251 insertions(+), 20 deletions(-) + +diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/im= port/pdf/importpdf.cpp +index 77f076c..54ffb11 100644 +--- a/scribus/plugins/import/pdf/importpdf.cpp ++++ b/scribus/plugins/import/pdf/importpdf.cpp +@@ -75,7 +75,11 @@ PdfPlug::PdfPlug(ScribusDoc* doc, int flags) + QImage PdfPlug::readThumbnail(const QString& fName)=0D + {=0D + QString pdfFile =3D QDir::toNativeSeparators(fName);=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 83, 0)=0D ++ globalParams.reset(new GlobalParams());=0D ++#else=0D + globalParams =3D new GlobalParams();=0D ++#endif=0D + if (globalParams)=0D + {=0D + #if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_E= NCODE(0, 62, 0)=0D +@@ -90,7 +94,9 @@ QImage PdfPlug::readThumbnail(const QString& fName) + if (pdfDoc->getErrorCode() =3D=3D errEncrypted)=0D + {=0D + delete pdfDoc;=0D ++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)=0D + delete globalParams;=0D ++#endif=0D + return QImage();=0D + }=0D + if (pdfDoc->isOk())=0D +@@ -134,11 +140,15 @@ QImage PdfPlug::readThumbnail(const QString& fName) + image.setText("YSize", QString("%1").arg(h));=0D + delete dev;=0D + delete pdfDoc;=0D ++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)=0D + delete globalParams;=0D ++#endif=0D + return image;=0D + }=0D + delete pdfDoc;=0D ++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)=0D + delete globalParams;=0D ++#endif=0D + }=0D + }=0D + return QImage();=0D +@@ -387,7 +397,11 @@ bool PdfPlug::convert(const QString& fn) + qApp->processEvents();=0D + }=0D + =0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 83, 0)=0D ++ globalParams.reset(new GlobalParams());=0D ++#else=0D + globalParams =3D new GlobalParams();=0D ++#endif=0D + GooString *userPW =3D nullptr;=0D + if (globalParams)=0D + {=0D +@@ -429,7 +443,9 @@ bool PdfPlug::convert(const QString& fn) + if (progressDialog)=0D + progressDialog->close();=0D + delete pdfDoc;=0D ++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)=0D + delete globalParams;=0D ++#endif=0D + return false;=0D + }=0D + if (progressDialog)=0D +@@ -474,7 +490,9 @@ bool PdfPlug::convert(const QString& fn) + progressDialog->close();=0D + delete optImp;=0D + delete pdfDoc;=0D ++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)=0D + delete globalParams;=0D ++#endif=0D + return false;=0D + }=0D + pageString =3D optImp->getPagesString();=0D +@@ -838,11 +856,20 @@ bool PdfPlug::convert(const QString& fn) + names =3D catDict.dictLookup("OpenAction");=0D + if (names.isDict())=0D + {=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ std::unique_ptr linkAction;=0D ++ linkAction =3D LinkAction::parseAction(&names, pdfDoc->getCatalo= g()->getBaseURI());=0D ++#else=0D + LinkAction *linkAction =3D nullptr;=0D + linkAction =3D LinkAction::parseAction(&names, pdfDoc->getCatalo= g()->getBaseURI());=0D ++#endif=0D + if (linkAction)=0D + {=0D +- LinkJavaScript *jsa =3D (LinkJavaScript*)linkAction;=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ LinkJavaScript *jsa =3D (LinkJavaScript*) linkAction.get();=0D ++#else=0D ++ LinkJavaScript *jsa =3D (LinkJavaScript*) linkAction;=0D ++#endif=0D + if (jsa->isOk())=0D + {=0D + QString script =3D UnicodeParsedString(jsa->getScript());=0D +@@ -908,8 +935,12 @@ bool PdfPlug::convert(const QString& fn) + }=0D + delete pdfDoc;=0D + }=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 83, 0)=0D ++ globalParams.release();=0D ++#else=0D + delete globalParams;=0D + globalParams =3D nullptr;=0D ++#endif=0D + =0D + // qDebug() << "converting finished";=0D + // qDebug() << "Imported" << Elements.count() << "Elements";=0D +@@ -1046,3 +1077,43 @@ QString PdfPlug::UnicodeParsedString(POPPLER_CONST = GooString *s1) + }=0D + return result;=0D + }=0D ++=0D ++QString PdfPlug::UnicodeParsedString(const std::string& s1)=0D ++{=0D ++ if (s1.length() =3D=3D 0)=0D ++ return QString();=0D ++ GBool isUnicode;=0D ++ int i;=0D ++ Unicode u;=0D ++ QString result;=0D ++ if ((s1.at(0) & 0xff) =3D=3D 0xfe && (s1.length() > 1 && (s1.at(1) & 0xf= f) =3D=3D 0xff))=0D ++ {=0D ++ isUnicode =3D gTrue;=0D ++ i =3D 2;=0D ++ result.reserve((s1.length() - 2) / 2);=0D ++ }=0D ++ else=0D ++ {=0D ++ isUnicode =3D gFalse;=0D ++ i =3D 0;=0D ++ result.reserve(s1.length());=0D ++ }=0D ++ while (i < s1.length())=0D ++ {=0D ++ if (isUnicode)=0D ++ {=0D ++ u =3D ((s1.at(i) & 0xff) << 8) | (s1.at(i+1) & 0xff);=0D ++ i +=3D 2;=0D ++ }=0D ++ else=0D ++ {=0D ++ u =3D s1.at(i) & 0xff;=0D ++ ++i;=0D ++ }=0D ++ // #15616: imagemagick may write unicode strings incorrectly in PDF=0D ++ if (u =3D=3D 0)=0D ++ continue;=0D ++ result +=3D QChar( u );=0D ++ }=0D ++ return result;=0D ++}=0D +diff --git a/scribus/plugins/import/pdf/importpdf.h b/scribus/plugins/impo= rt/pdf/importpdf.h +index 9dbfecc..df95bc9 100644 +--- a/scribus/plugins/import/pdf/importpdf.h ++++ b/scribus/plugins/import/pdf/importpdf.h +@@ -82,6 +82,7 @@ private: + bool convert(const QString& fn); + QRectF getCBox(int box, int pgNum); + QString UnicodeParsedString(POPPLER_CONST GooString *s1); ++ QString UnicodeParsedString(const std::string& s1); +=20=09 + QList Elements; + double baseX, baseY; +diff --git a/scribus/plugins/import/pdf/importpdfconfig.h b/scribus/plugin= s/import/pdf/importpdfconfig.h +index 2a13b0d..5a7e0d2 100644 +--- a/scribus/plugins/import/pdf/importpdfconfig.h ++++ b/scribus/plugins/import/pdf/importpdfconfig.h +@@ -52,4 +52,16 @@ for which a new license (GPL+exception) is in place. + #define POPPLER_REF=0D + #endif=0D + =0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 82, 0)=0D ++#define POPPLER_CONST_082 const=0D ++#else=0D ++#define POPPLER_CONST_082=0D ++#endif=0D ++=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 83, 0)=0D ++#define POPPLER_CONST_083 const=0D ++#else=0D ++#define POPPLER_CONST_083=0D ++#endif=0D ++=0D + #endif=0D +diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/im= port/pdf/slaoutput.cpp +index 6094f3d..c5122ca 100644 +--- a/scribus/plugins/import/pdf/slaoutput.cpp ++++ b/scribus/plugins/import/pdf/slaoutput.cpp +@@ -308,9 +308,15 @@ LinkAction* SlaOutputDev::SC_getAction(AnnotWidget *a= no) + }=0D + =0D + /* Replacement for the crippled Poppler function LinkAction* AnnotWidget:= :getAdditionalAction(AdditionalActionsType type) */=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++std::unique_ptr SlaOutputDev::SC_getAdditionalAction(const ch= ar *key, AnnotWidget *ano)=0D ++{=0D ++ std::unique_ptr linkAction;=0D ++#else=0D + LinkAction* SlaOutputDev::SC_getAdditionalAction(const char *key, AnnotWi= dget *ano)=0D + {=0D + LinkAction *linkAction =3D nullptr;=0D ++#endif=0D + Object obj;=0D + Ref refa =3D ano->getRef();=0D + =0D +@@ -455,7 +461,11 @@ bool SlaOutputDev::handleLinkAnnot(Annot* annota, dou= ble xCoor, double yCoor, do + POPPLER_CONST GooString *ndst =3D gto->getNamedDest();=0D + if (ndst)=0D + {=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ std::unique_ptr dstn =3D pdfDoc->findDest(ndst);=0D ++#else=0D + LinkDest *dstn =3D pdfDoc->findDest(ndst);=0D ++#endif=0D + if (dstn)=0D + {=0D + if (dstn->getKind() =3D=3D destXYZ)=0D +@@ -499,7 +509,11 @@ bool SlaOutputDev::handleLinkAnnot(Annot* annota, dou= ble xCoor, double yCoor, do + POPPLER_CONST GooString *ndst =3D gto->getNamedDest();=0D + if (ndst)=0D + {=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ std::unique_ptr dstn =3D pdfDoc->findDest(ndst);=0D ++#else=0D + LinkDest *dstn =3D pdfDoc->findDest(ndst);=0D ++#endif=0D + if (dstn)=0D + {=0D + if (dstn->getKind() =3D=3D destXYZ)=0D +@@ -967,7 +981,11 @@ void SlaOutputDev::handleActions(PageItem* ite, Annot= Widget *ano) + POPPLER_CONST GooString *ndst =3D gto->getNamedDest();=0D + if (ndst)=0D + {=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ std::unique_ptr dstn =3D pdfDoc->findDest(ndst);=0D ++#else=0D + LinkDest *dstn =3D pdfDoc->findDest(ndst);=0D ++#endif=0D + if (dstn)=0D + {=0D + if (dstn->getKind() =3D=3D destXYZ)=0D +@@ -1019,7 +1037,11 @@ void SlaOutputDev::handleActions(PageItem* ite, Ann= otWidget *ano) + POPPLER_CONST GooString *ndst =3D gto->getNamedDest();=0D + if (ndst)=0D + {=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ std::unique_ptr dstn =3D pdfDoc->findDest(ndst);=0D ++#else=0D + LinkDest *dstn =3D pdfDoc->findDest(ndst);=0D ++#endif=0D + if (dstn)=0D + {=0D + if (dstn->getKind() =3D=3D destXYZ)=0D +@@ -1088,96 +1110,148 @@ void SlaOutputDev::handleActions(PageItem* ite, A= nnotWidget *ano) + else=0D + qDebug() << "Found unsupported Action of type" << Lact->getKind();=0D + }=0D +- LinkAction *Aact =3D SC_getAdditionalAction("D", ano);=0D ++ auto Aact =3D SC_getAdditionalAction("D", ano);=0D + if (Aact)=0D + {=0D + if (Aact->getKind() =3D=3D actionJavaScript)=0D + {=0D +- LinkJavaScript *jsa =3D (LinkJavaScript*)Aact;=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ LinkJavaScript *jsa =3D (LinkJavaScript*) Aact.get();=0D ++#else=0D ++ LinkJavaScript *jsa =3D (LinkJavaScript*) Aact;=0D ++#endif=0D + if (jsa->isOk())=0D + {=0D + ite->annotation().setD_act(UnicodeParsedString(jsa->getScript()));=0D + ite->annotation().setAAact(true);=0D + }=0D + }=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ Aact.reset();=0D ++#else=0D + Aact =3D nullptr;=0D ++#endif=0D + }=0D + Aact =3D SC_getAdditionalAction("E", ano);=0D + if (Aact)=0D + {=0D + if (Aact->getKind() =3D=3D actionJavaScript)=0D + {=0D +- LinkJavaScript *jsa =3D (LinkJavaScript*)Aact;=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ LinkJavaScript *jsa =3D (LinkJavaScript*) Aact.get();=0D ++#else=0D ++ LinkJavaScript *jsa =3D (LinkJavaScript*) Aact;=0D ++#endif=0D + if (jsa->isOk())=0D + {=0D + ite->annotation().setE_act(UnicodeParsedString(jsa->getScript()));=0D + ite->annotation().setAAact(true);=0D + }=0D + }=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ Aact.reset();=0D ++#else=0D + Aact =3D nullptr;=0D ++#endif=0D + }=0D + Aact =3D SC_getAdditionalAction("X", ano);=0D + if (Aact)=0D + {=0D + if (Aact->getKind() =3D=3D actionJavaScript)=0D + {=0D +- LinkJavaScript *jsa =3D (LinkJavaScript*)Aact;=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ LinkJavaScript *jsa =3D (LinkJavaScript*) Aact.get();=0D ++#else=0D ++ LinkJavaScript *jsa =3D (LinkJavaScript*) Aact;=0D ++#endif=0D + if (jsa->isOk())=0D + {=0D + ite->annotation().setX_act(UnicodeParsedString(jsa->getScript()));=0D + ite->annotation().setAAact(true);=0D + }=0D + }=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ Aact.reset();=0D ++#else=0D + Aact =3D nullptr;=0D ++#endif=0D + }=0D + Aact =3D SC_getAdditionalAction("Fo", ano);=0D + if (Aact)=0D + {=0D + if (Aact->getKind() =3D=3D actionJavaScript)=0D + {=0D +- LinkJavaScript *jsa =3D (LinkJavaScript*)Aact;=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ LinkJavaScript *jsa =3D (LinkJavaScript*) Aact.get();=0D ++#else=0D ++ LinkJavaScript *jsa =3D (LinkJavaScript*) Aact;=0D ++#endif=0D + if (jsa->isOk())=0D + {=0D + ite->annotation().setFo_act(UnicodeParsedString(jsa->getScript()));=0D + ite->annotation().setAAact(true);=0D + }=0D + }=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ Aact.reset();=0D ++#else=0D + Aact =3D nullptr;=0D ++#endif=0D + }=0D + Aact =3D SC_getAdditionalAction("Bl", ano);=0D + if (Aact)=0D + {=0D + if (Aact->getKind() =3D=3D actionJavaScript)=0D + {=0D +- LinkJavaScript *jsa =3D (LinkJavaScript*)Aact;=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ LinkJavaScript *jsa =3D (LinkJavaScript*) Aact.get();=0D ++#else=0D ++ LinkJavaScript *jsa =3D (LinkJavaScript*) Aact;=0D ++#endif=0D + if (jsa->isOk())=0D + {=0D + ite->annotation().setBl_act(UnicodeParsedString(jsa->getScript()));=0D + ite->annotation().setAAact(true);=0D + }=0D + }=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ Aact.reset();=0D ++#else=0D + Aact =3D nullptr;=0D ++#endif=0D + }=0D + Aact =3D SC_getAdditionalAction("C", ano);=0D + if (Aact)=0D + {=0D + if (Aact->getKind() =3D=3D actionJavaScript)=0D + {=0D +- LinkJavaScript *jsa =3D (LinkJavaScript*)Aact;=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ LinkJavaScript *jsa =3D (LinkJavaScript*) Aact.get();=0D ++#else=0D ++ LinkJavaScript *jsa =3D (LinkJavaScript*) Aact;=0D ++#endif=0D + if (jsa->isOk())=0D + {=0D + ite->annotation().setC_act(UnicodeParsedString(jsa->getScript()));=0D + ite->annotation().setAAact(true);=0D + }=0D + }=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ Aact.reset();=0D ++#else=0D + Aact =3D nullptr;=0D ++#endif=0D + }=0D + Aact =3D SC_getAdditionalAction("F", ano);=0D + if (Aact)=0D + {=0D + if (Aact->getKind() =3D=3D actionJavaScript)=0D + {=0D +- LinkJavaScript *jsa =3D (LinkJavaScript*)Aact;=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ LinkJavaScript *jsa =3D (LinkJavaScript*) Aact.get();=0D ++#else=0D ++ LinkJavaScript *jsa =3D (LinkJavaScript*) Aact;=0D ++#endif=0D + if (jsa->isOk())=0D + {=0D + ite->annotation().setF_act(UnicodeParsedString(jsa->getScript()));=0D +@@ -1185,14 +1259,22 @@ void SlaOutputDev::handleActions(PageItem* ite, An= notWidget *ano) + ite->annotation().setFormat(5);=0D + }=0D + }=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ Aact.reset();=0D ++#else=0D + Aact =3D nullptr;=0D ++#endif=0D + }=0D + Aact =3D SC_getAdditionalAction("K", ano);=0D + if (Aact)=0D + {=0D + if (Aact->getKind() =3D=3D actionJavaScript)=0D + {=0D +- LinkJavaScript *jsa =3D (LinkJavaScript*)Aact;=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ LinkJavaScript *jsa =3D (LinkJavaScript*) Aact.get();=0D ++#else=0D ++ LinkJavaScript *jsa =3D (LinkJavaScript*) Aact;=0D ++#endif=0D + if (jsa->isOk())=0D + {=0D + ite->annotation().setK_act(UnicodeParsedString(jsa->getScript()));=0D +@@ -1200,21 +1282,33 @@ void SlaOutputDev::handleActions(PageItem* ite, An= notWidget *ano) + ite->annotation().setFormat(5);=0D + }=0D + }=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ Aact.reset();=0D ++#else=0D + Aact =3D nullptr;=0D ++#endif=0D + }=0D + Aact =3D SC_getAdditionalAction("V", ano);=0D + if (Aact)=0D + {=0D + if (Aact->getKind() =3D=3D actionJavaScript)=0D + {=0D +- LinkJavaScript *jsa =3D (LinkJavaScript*)Aact;=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ LinkJavaScript *jsa =3D (LinkJavaScript*) Aact.get();=0D ++#else=0D ++ LinkJavaScript *jsa =3D (LinkJavaScript*) Aact;=0D ++#endif=0D + if (jsa->isOk())=0D + {=0D + ite->annotation().setV_act(UnicodeParsedString(jsa->getScript()));=0D + ite->annotation().setAAact(true);=0D + }=0D + }=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ Aact.reset();=0D ++#else=0D + Aact =3D nullptr;=0D ++#endif=0D + }=0D + }=0D + =0D +@@ -1224,6 +1318,11 @@ void SlaOutputDev::startDoc(PDFDoc *doc, XRef *xref= A, Catalog *catA) + catalog =3D catA;=0D + pdfDoc =3D doc;=0D + updateGUICounter =3D 0;=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 84, 0)=0D ++ m_fontEngine =3D new SplashFontEngine(true, true, true, true);=0D ++#elif POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 61, 0)=0D ++ m_fontEngine =3D new SplashFontEngine(globalParams->getEnableFreeType(),= true, true, true);=0D ++#else=0D + m_fontEngine =3D new SplashFontEngine(=0D + #if HAVE_T1LIB_H=0D + globalParams->getEnableT1lib(),=0D +@@ -1234,6 +1333,7 @@ void SlaOutputDev::startDoc(PDFDoc *doc, XRef *xrefA= , Catalog *catA) + true,=0D + #endif=0D + true);=0D ++#endif=0D + }=0D + =0D + void SlaOutputDev::startPage(int pageNum, GfxState *, XRef *)=0D +@@ -2784,7 +2884,7 @@ void SlaOutputDev::drawMaskedImage(GfxState *state, = Object *ref, Stream *str, i + delete[] mbuffer;=0D + }=0D + =0D +-void SlaOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, i= nt width, int height, GfxImageColorMap *colorMap, GBool interpolate, int *m= askColors, GBool inlineImg)=0D ++void SlaOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, i= nt width, int height, GfxImageColorMap *colorMap, GBool interpolate, POPPLE= R_CONST_082 int* maskColors, GBool inlineImg)=0D + {=0D + ImageStream * imgStr =3D new ImageStream(str, width, colorMap->getNumPix= elComps(), colorMap->getBits());=0D + // qDebug() << "Image Components" << colorMap->getNumPixelComps() << "Mas= k" << maskColors;=0D +@@ -3365,7 +3465,7 @@ err1: + fontsrc->unref();=0D + }=0D + =0D +-void SlaOutputDev::drawChar(GfxState *state, double x, double y, double d= x, double dy, double originX, double originY, CharCode code, int nBytes, Un= icode *u, int uLen)=0D ++void SlaOutputDev::drawChar(GfxState *state, double x, double y, double d= x, double dy, double originX, double originY, CharCode code, int nBytes, PO= PPLER_CONST_082 Unicode *u, int uLen)=0D + {=0D + double x1, y1, x2, y2;=0D + int render;=0D +@@ -3452,7 +3552,7 @@ void SlaOutputDev::drawChar(GfxState *state, double = x, double y, double dx, doub + }=0D + }=0D + =0D +-GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, d= ouble dx, double dy, CharCode code, Unicode *u, int uLen)=0D ++GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, d= ouble dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)= =0D + {=0D + // qDebug() << "beginType3Char";=0D + GfxFont *gfxFont;=0D +@@ -3705,7 +3805,7 @@ QString SlaOutputDev::getAnnotationColor(const Annot= Color *color) + return fNam;=0D + }=0D + =0D +-QString SlaOutputDev::convertPath(GfxPath *path)=0D ++QString SlaOutputDev::convertPath(POPPLER_CONST_083 GfxPath *path)=0D + {=0D + if (! path)=0D + return QString();=0D +@@ -3715,7 +3815,7 @@ QString SlaOutputDev::convertPath(GfxPath *path) + =0D + for (int i =3D 0; i < path->getNumSubpaths(); ++i)=0D + {=0D +- GfxSubpath * subpath =3D path->getSubpath(i);=0D ++ POPPLER_CONST_083 GfxSubpath * subpath =3D path->getSubpath(i);=0D + if (subpath->getNumPoints() > 0)=0D + {=0D + output +=3D QString("M %1 %2").arg(subpath->getX(0)).arg(subpath->getY= (0));=0D +@@ -3922,6 +4022,46 @@ QString SlaOutputDev::UnicodeParsedString(POPPLER_C= ONST GooString *s1) + return result;=0D + }=0D + =0D ++QString SlaOutputDev::UnicodeParsedString(const std::string& s1)=0D ++{=0D ++ if (s1.length() =3D=3D 0)=0D ++ return QString();=0D ++ GBool isUnicode;=0D ++ int i;=0D ++ Unicode u;=0D ++ QString result;=0D ++ if ((s1.at(0) & 0xff) =3D=3D 0xfe && (s1.length() > 1 && (s1.at(1) & 0xf= f) =3D=3D 0xff))=0D ++ {=0D ++ isUnicode =3D gTrue;=0D ++ i =3D 2;=0D ++ result.reserve((s1.length() - 2) / 2);=0D ++ }=0D ++ else=0D ++ {=0D ++ isUnicode =3D gFalse;=0D ++ i =3D 0;=0D ++ result.reserve(s1.length());=0D ++ }=0D ++ while (i < s1.length())=0D ++ {=0D ++ if (isUnicode)=0D ++ {=0D ++ u =3D ((s1.at(i) & 0xff) << 8) | (s1.at(i+1) & 0xff);=0D ++ i +=3D 2;=0D ++ }=0D ++ else=0D ++ {=0D ++ u =3D s1.at(i) & 0xff;=0D ++ ++i;=0D ++ }=0D ++ // #15616: imagemagick may write unicode strings incorrectly in PDF=0D ++ if (u =3D=3D 0)=0D ++ continue;=0D ++ result +=3D QChar( u );=0D ++ }=0D ++ return result;=0D ++}=0D ++=0D + bool SlaOutputDev::checkClip()=0D + {=0D + bool ret =3D false;=0D +diff --git a/scribus/plugins/import/pdf/slaoutput.h b/scribus/plugins/impo= rt/pdf/slaoutput.h +index bc4350a..704ca3f 100644 +--- a/scribus/plugins/import/pdf/slaoutput.h ++++ b/scribus/plugins/import/pdf/slaoutput.h +@@ -20,6 +20,8 @@ for which a new license (GPL+exception) is in place. + #include =0D + #include =0D + =0D ++#include =0D ++=0D + #include "fpointarray.h"=0D + #include "importpdfconfig.h"=0D + #include "pageitem.h"=0D +@@ -159,7 +161,11 @@ public: + virtual ~SlaOutputDev();=0D + =0D + LinkAction* SC_getAction(AnnotWidget *ano);=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 86, 0)=0D ++ std::unique_ptr SC_getAdditionalAction(const char *key, Anno= tWidget *ano);=0D ++#else=0D + LinkAction* SC_getAdditionalAction(const char *key, AnnotWidget *ano);=0D ++#endif=0D + static GBool annotations_callback(Annot *annota, void *user_data);=0D + bool handleTextAnnot(Annot* annota, double xCoor, double yCoor, double w= idth, double height);=0D + bool handleLinkAnnot(Annot* annota, double xCoor, double yCoor, double w= idth, double height);=0D +@@ -229,7 +235,7 @@ public: + =0D + //----- image drawing=0D + void drawImageMask(GfxState *state, Object *ref, Stream *str, int width,= int height, GBool invert, GBool interpolate, GBool inlineImg) override;=0D +- void drawImage(GfxState *state, Object *ref, Stream *str, int width, int= height, GfxImageColorMap *colorMap, GBool interpolate, int *maskColors, GB= ool inlineImg) override;=0D ++ void drawImage(GfxState *state, Object *ref, Stream *str, int width, int= height, GfxImageColorMap *colorMap, GBool interpolate, POPPLER_CONST_082 i= nt *maskColors, GBool inlineImg) override;=0D + void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,=0D + int width, int height,=0D + GfxImageColorMap *colorMap,=0D +@@ -261,8 +267,8 @@ public: + //----- text drawing=0D + void beginTextObject(GfxState *state) override;=0D + void endTextObject(GfxState *state) override;=0D +- void drawChar(GfxState *state, double /*x*/, double /*y*/, double /*dx*= /, double /*dy*/, double /*originX*/, double /*originY*/, CharCode /*code*/= , int /*nBytes*/, Unicode * /*u*/, int /*uLen*/) override;=0D +- GBool beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/, d= ouble /*dx*/, double /*dy*/, CharCode /*code*/, Unicode * /*u*/, int /*uLen= */) override;=0D ++ void drawChar(GfxState *state, double /*x*/, double /*y*/, double /*dx*= /, double /*dy*/, double /*originX*/, double /*originY*/, CharCode /*code*/= , int /*nBytes*/, POPPLER_CONST_082 Unicode * /*u*/, int /*uLen*/) override= ;=0D ++ GBool beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/, d= ouble /*dx*/, double /*dy*/, CharCode /*code*/, POPPLER_CONST_082 Unicode *= /*u*/, int /*uLen*/) override;=0D + void endType3Char(GfxState * /*state*/) override;=0D + void type3D0(GfxState * /*state*/, double /*wx*/, double /*wy*/) overri= de;=0D + void type3D1(GfxState * /*state*/, double /*wx*/, double /*wy*/, double= /*llx*/, double /*lly*/, double /*urx*/, double /*ury*/) override;=0D +@@ -282,11 +288,12 @@ private: + void getPenState(GfxState *state);=0D + QString getColor(GfxColorSpace *color_space, POPPLER_CONST_070 GfxColor = *color, int *shade);=0D + QString getAnnotationColor(const AnnotColor *color);=0D +- QString convertPath(GfxPath *path);=0D ++ QString convertPath(POPPLER_CONST_083 GfxPath *path);=0D + int getBlendMode(GfxState *state);=0D + void applyMask(PageItem *ite);=0D + void pushGroup(const QString& maskName =3D "", GBool forSoftMask =3D gFa= lse, GBool alpha =3D gFalse, bool inverted =3D false);=0D + QString UnicodeParsedString(POPPLER_CONST GooString *s1);=0D ++ QString UnicodeParsedString(const std::string& s1);=0D + bool checkClip();=0D + bool pathIsClosed;=0D + QString CurrColorFill;=0D +--=20 +2.26.2 + diff --git a/gnu/packages/scribus.scm b/gnu/packages/scribus.scm index 385017f2c2..6519ce7a7f 100644 --- a/gnu/packages/scribus.scm +++ b/gnu/packages/scribus.scm @@ -54,6 +54,7 @@ (method url-fetch) (uri (string-append "mirror://sourceforge/scribus/scribus-devel/" version "/scribus-" version ".tar.xz")) + (patches (search-patches "scribus-1.5.5-poppler-0.86-build-fix.patc= h")) (sha256 (base32 "0w9zzsiaq3f7vpxybk01c9z2b4qqg67mzpyfb2gjchz8dhdb423r")))) --=20 2.26.2