From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6aH8-0004Zd-8g for guix-patches@gnu.org; Mon, 23 Oct 2017 06:48:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e6aH4-00070H-Se for guix-patches@gnu.org; Mon, 23 Oct 2017 06:48:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:47956) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e6aH4-00070B-Mp for guix-patches@gnu.org; Mon, 23 Oct 2017 06:48:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e6aH4-0004SW-AZ for guix-patches@gnu.org; Mon, 23 Oct 2017 06:48:02 -0400 Subject: [bug#28954] [PATCH] Update Scribus to 1.5.3. Re-vamp package. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55078) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6aG3-0004Vd-VB for guix-patches@gnu.org; Mon, 23 Oct 2017 06:47:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e6aG0-0006Z4-9y for guix-patches@gnu.org; Mon, 23 Oct 2017 06:47:00 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:41155) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e6aFz-0006YK-Nr for guix-patches@gnu.org; Mon, 23 Oct 2017 06:46:56 -0400 Received: from saiph.selenimh (000043010000000000000469.ipv6.commingeshautdebit.fr [IPv6:2a03:a0a0:0:4301::469]) (Authenticated sender: mail@nicolasgoaziou.fr) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id D6EBEC5A8B for ; Mon, 23 Oct 2017 12:46:52 +0200 (CEST) Received: from ngz by saiph.selenimh with local (Exim 4.89) (envelope-from ) id 1e6aFw-0008Aq-07 for guix-patches@gnu.org; Mon, 23 Oct 2017 12:46:52 +0200 From: Nicolas Goaziou Date: Mon, 23 Oct 2017 12:46:51 +0200 Message-ID: <8760b6rvj8.fsf@nicolasgoaziou.fr> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 28954@debbugs.gnu.org --=-=-= Content-Type: text/plain Hello, The following patch updates Scribus to 1.5.3. It requires changes to the package definition itself (in particular patches and additional inputs). While at it, i also added some more inputs so as to get a more complete package. I discussed the possibility to split the patch in two (update on the one hand, and additional inputs on the other one), but the clear cut between the two is difficult to find. For example, "libcdr", "libfreehand", "libmspub", "libpagemaker, "librevenge" and "libvisio" obviously belongs to the second patch, but "fontconfig", "harfbuzz", "openssl" and "boost" would need to be tested. In any case, notwithstanding my laziness, I think the split is not worth it: current Scribus package is not working at the moment. The package may still be missing Tkinter and Mesa as inputs. I have no use for them at the moment, though. WDYT? Regards, -- Nicolas Goaziou 0x80A93738 --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-scribus-Update-to-1.5.3.-Re-vamp-package.patch Content-Transfer-Encoding: quoted-printable Content-Description: Scribus re-vamp >From e42a5b62476e63184c3a4164d73410decbbb2a75 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Mon, 23 Oct 2017 12:25:13 +0200 Subject: [PATCH] gnu: scribus: Update to 1.5.3. Re-vamp package. * gnu/packages/patches/scribus-fix-poppler-0.58-breakage.patch: * gnu/packages/patches/scribus-fix-poppler-packaging.patch: New files. * gnu/local.mk (dist_patch_DATA): Register new files. * gnu/packages/scribus.scm (scribus): Update to 1.5.3. [input]: Add fontconfig, harfbuzz, hunspell, icu4c, libcdr, libfreehand, libmspub, librevenge, libvisio, openssl, podofo, poppler. [native-input]: Move qttools from inputs. Add boost. [home-page]: Fix URL. --- gnu/local.mk | 2 + .../scribus-fix-poppler-0.58-breakage.patch | 526 +++++++++++++++++= ++++ .../patches/scribus-fix-poppler-packaging.patch | 95 ++++ gnu/packages/scribus.scm | 57 ++- 4 files changed, 669 insertions(+), 11 deletions(-) create mode 100644 gnu/packages/patches/scribus-fix-poppler-0.58-breakage.= patch create mode 100644 gnu/packages/patches/scribus-fix-poppler-packaging.patch diff --git a/gnu/local.mk b/gnu/local.mk index 6b70300ff..ff0e74a0b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1022,6 +1022,8 @@ dist_patch_DATA =3D \ %D%/packages/patches/rxvt-unicode-escape-sequences.patch \ %D%/packages/patches/scheme48-tests.patch \ %D%/packages/patches/scotch-test-threading.patch \ + %D%/packages/patches/scribus-fix-poppler-0.58-breakage.patch \ + %D%/packages/patches/scribus-fix-poppler-packaging.patch \ %D%/packages/patches/sdl-libx11-1.6.patch \ %D%/packages/patches/seq24-rename-mutex.patch \ %D%/packages/patches/shishi-fix-libgcrypt-detection.patch \ diff --git a/gnu/packages/patches/scribus-fix-poppler-0.58-breakage.patch b= /gnu/packages/patches/scribus-fix-poppler-0.58-breakage.patch new file mode 100644 index 000000000..cd95e9b2a --- /dev/null +++ b/gnu/packages/patches/scribus-fix-poppler-0.58-breakage.patch @@ -0,0 +1,526 @@ +diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/im= port/pdf/importpdf.cpp +index 4c462bead..1c0bd8a88 100644 +--- a/scribus/plugins/import/pdf/importpdf.cpp ++++ b/scribus/plugins/import/pdf/importpdf.cpp +@@ -22,6 +22,7 @@ for which a new license (GPL+exception) is in place. + #include =0D + #include =0D + #include =0D ++#include =0D + #include =0D + #include =0D + =0D +@@ -59,6 +60,12 @@ for which a new license (GPL+exception) is in place. + #include "ui/multiprogressdialog.h"=0D + #include "ui/propertiespalette.h"=0D + =0D ++#define POPPLER_VERSION_ENCODE(major, minor, micro) ( \ ++ ((major) * 10000) \ ++ + ((minor) * 100) \ ++ + ((micro) * 1))=0D ++#define POPPLER_ENCODED_VERSION POPPLER_VERSION_ENCODE(POPPLER_VERSION_MA= JOR, POPPLER_VERSION_MINOR, POPPLER_VERSION_MICRO)=0D ++=0D + PdfPlug::PdfPlug(ScribusDoc* doc, int flags)=0D + {=0D + tmpSele =3D new Selection(this, false);=0D +@@ -507,12 +514,20 @@ bool PdfPlug::convert(const QString& fn) + {=0D + for (int i =3D 0; i < order->getLength (); ++i)=0D + {=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 58, 0)=0D ++ Object orderItem =3D order->get(i);=0D ++#else=0D + Object orderItem;=0D + order->get(i, &orderItem);=0D ++#endif=0D + if (orderItem.isDict())=0D + {=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 58, 0)=0D ++ Object ref =3D order->getNF(i); =0D ++#else=0D + Object ref;=0D + order->getNF(i, &ref);=0D ++#endif=0D + if (ref.isRef())=0D + {=0D + OptionalContentGroup *oc =3D ocg->findOcgByRef(ref.getRef());= =0D +@@ -523,7 +538,9 @@ bool PdfPlug::convert(const QString& fn) + ocgNames.append(ocgName);=0D + }=0D + }=0D ++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 58, 0)=0D + ref.free();=0D ++#endif=0D + }=0D + else=0D + {=0D +@@ -597,39 +614,71 @@ bool PdfPlug::convert(const QString& fn) + dev->layersSetByOCG =3D true;=0D + }=0D + #endif=0D ++=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 58, 0)=0D ++ Object info =3D pdfDoc->getDocInfo();=0D ++ if (info.isDict())=0D ++ {=0D ++ Object obj;=0D ++ Dict *infoDict =3D info.getDict();=0D ++ obj =3D infoDict->lookup((char*) "Title");=0D ++ if (obj.isString())=0D ++ {=0D ++ m_Doc->documentInfo().setTitle(UnicodeParsedString(obj.getString(= )));=0D ++ }=0D ++ obj =3D infoDict->lookup((char*) "Author");=0D ++ if (obj.isString())=0D ++ {=0D ++ m_Doc->documentInfo().setAuthor(UnicodeParsedString(obj.getString= ()));=0D ++ }=0D ++ obj =3D infoDict->lookup((char*) "Subject");=0D ++ if (obj.isString())=0D ++ {=0D ++ m_Doc->documentInfo().setSubject(UnicodeParsedString(obj.getStrin= g()));=0D ++ }=0D ++ obj =3D infoDict->lookup((char*) "Keywords");=0D ++ if (obj.isString())=0D ++ {=0D ++ // s1 =3D obj.getString();=0D ++ m_Doc->documentInfo().setKeywords(UnicodeParsedString(obj.getStri= ng()));=0D ++ }=0D ++ }=0D ++ info =3D Object();=0D ++#else=0D + Object info;=0D + pdfDoc->getDocInfo(&info);=0D + if (info.isDict())=0D + {=0D + Object obj;=0D +- // GooString *s1;=0D ++ // GooString *s1;=0D + Dict *infoDict =3D info.getDict();=0D +- if (infoDict->lookup((char*)"Title", &obj )->isString())=0D ++ if (infoDict->lookup((char*)"Title", &obj)->isString())=0D + {=0D +- // s1 =3D obj.getString();=0D ++ // s1 =3D obj.getString();=0D + m_Doc->documentInfo().setTitle(UnicodeParsedString(obj.getString(= )));=0D + obj.free();=0D + }=0D +- if (infoDict->lookup((char*)"Author", &obj )->isString())=0D ++ if (infoDict->lookup((char*)"Author", &obj)->isString())=0D + {=0D +- // s1 =3D obj.getString();=0D ++ // s1 =3D obj.getString();=0D + m_Doc->documentInfo().setAuthor(UnicodeParsedString(obj.getString= ()));=0D + obj.free();=0D + }=0D +- if (infoDict->lookup((char*)"Subject", &obj )->isString())=0D ++ if (infoDict->lookup((char*)"Subject", &obj)->isString())=0D + {=0D +- // s1 =3D obj.getString();=0D ++ // s1 =3D obj.getString();=0D + m_Doc->documentInfo().setSubject(UnicodeParsedString(obj.getStrin= g()));=0D + obj.free();=0D + }=0D +- if (infoDict->lookup((char*)"Keywords", &obj )->isString())=0D ++ if (infoDict->lookup((char*)"Keywords", &obj)->isString())=0D + {=0D +- // s1 =3D obj.getString();=0D ++ // s1 =3D obj.getString();=0D + m_Doc->documentInfo().setKeywords(UnicodeParsedString(obj.getStri= ng()));=0D + obj.free();=0D + }=0D + }=0D + info.free();=0D ++#endif=0D + if (cropped)=0D + {=0D + QRectF crBox =3D getCBox(contentRect, pageNs[0]);=0D +@@ -746,8 +795,13 @@ bool PdfPlug::convert(const QString& fn) + pdfDoc->displayPage(dev, pp, hDPI, vDPI, rotate, useMediaBox, cr= op, printing, NULL, NULL, dev->annotations_callback, dev);=0D + }=0D + PDFPresentationData ef;=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 58, 0)=0D ++ Object trans =3D pdfDoc->getPage(pp)->getTrans();=0D ++ Object *transi =3D &trans;=0D ++#else=0D + Object trans;=0D + Object *transi =3D pdfDoc->getPage(pp)->getTrans(&trans);=0D ++#endif=0D + if (transi->isDict())=0D + {=0D + m_Doc->pdfOptions().PresentMode =3D true;=0D +@@ -793,32 +847,51 @@ bool PdfPlug::convert(const QString& fn) + delete pgTrans;=0D + }=0D + m_Doc->currentPage()->PresentVals =3D ef;=0D ++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 58, 0)=0D + trans.free();=0D + transi->free();=0D ++#endif=0D + }=0D + int numjs =3D pdfDoc->getCatalog()->numJS();=0D + if (numjs > 0)=0D + {=0D + NameTree *jsNameTreeP =3D new NameTree();=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 58, 0)=0D ++ Object catDict =3D pdfDoc->getXRef()->getCatalog();=0D ++#else=0D + Object catDict;=0D + pdfDoc->getXRef()->getCatalog(&catDict);=0D ++#endif=0D + if (catDict.isDict())=0D + {=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 58, 0)=0D ++ Object names =3D catDict.dictLookup("Names");=0D ++#else=0D + Object names;=0D + catDict.dictLookup("Names", &names);=0D ++#endif=0D + if (names.isDict())=0D + {=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 58, 0)=0D ++ Object obj =3D names.dictLookup("JavaScript");=0D ++ jsNameTreeP->init(pdfDoc->getXRef(), &obj);=0D ++#else=0D + Object obj;=0D + names.dictLookup("JavaScript", &obj);=0D + jsNameTreeP->init(pdfDoc->getXRef(), &obj);=0D + obj.free();=0D ++#endif=0D + }=0D + for (int a =3D 0; a < numjs; a++)=0D + {=0D + m_Doc->JavaScripts.insert(UnicodeParsedString(jsNameTreeP->getNa= me(a)), UnicodeParsedString(pdfDoc->getCatalog()->getJS(a)));=0D + }=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 58, 0)=0D ++ names =3D catDict.dictLookup("OpenAction");=0D ++#else=0D + names.free();=0D + catDict.dictLookup("OpenAction", &names);=0D ++#endif=0D + if (names.isDict())=0D + {=0D + LinkAction *linkAction =3D NULL;=0D +@@ -839,9 +912,13 @@ bool PdfPlug::convert(const QString& fn) + }=0D + }=0D + }=0D ++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 58, 0)=0D + names.free();=0D ++#endif=0D + }=0D ++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 58, 0)=0D + catDict.free();=0D ++#endif=0D + delete jsNameTreeP;=0D + }=0D + m_Doc->pdfOptions().Version =3D (PDFOptions::PDFVersion)qMin(15, qM= ax(13, pdfDoc->getPDFMajorVersion() * 10 + pdfDoc->getPDFMinorVersion()));= =0D +diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/im= port/pdf/slaoutput.cpp +index 32cfed101..ffa417a3b 100644 +--- a/scribus/plugins/import/pdf/slaoutput.cpp ++++ b/scribus/plugins/import/pdf/slaoutput.cpp +@@ -6,6 +6,7 @@ for which a new license (GPL+exception) is in place. + */=0D + =0D + #include "slaoutput.h"=0D ++#include =0D + #include =0D + #include =0D + #include =0D +@@ -19,11 +20,49 @@ for which a new license (GPL+exception) is in place. + #include "util_math.h"=0D + #include =0D + =0D ++#define POPPLER_VERSION_ENCODE(major, minor, micro) ( \ ++ ((major) * 10000) \ ++ + ((minor) * 100) \ ++ + ((micro) * 1))=0D ++#define POPPLER_ENCODED_VERSION POPPLER_VERSION_ENCODE(POPPLER_VERSION_MA= JOR, POPPLER_VERSION_MINOR, POPPLER_VERSION_MICRO)=0D ++=0D + LinkSubmitForm::LinkSubmitForm(Object *actionObj)=0D + {=0D + Object obj1, obj2, obj3;=0D + fileName =3D NULL;=0D + m_flags =3D 0;=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 58, 0)=0D ++ if (actionObj->isDict())=0D ++ {=0D ++ obj1 =3D actionObj->dictLookup("F");=0D ++ if (!obj1.isNull())=0D ++ {=0D ++ if (obj1.isDict())=0D ++ {=0D ++ obj3 =3D obj1.dictLookup("FS");=0D ++ if (!obj3.isNull())=0D ++ {=0D ++ if (obj3.isName())=0D ++ {=0D ++ char *name =3D obj3.getName();=0D ++ if (!strcmp(name, "URL"))=0D ++ {=0D ++ obj2 =3D obj1.dictLookup("F");=0D ++ if (!obj2.isNull())=0D ++ fileName =3D obj2.getString()->copy();=0D ++ }=0D ++ }=0D ++ }=0D ++ }=0D ++ }=0D ++ obj1 =3D actionObj->dictLookup("Flags");=0D ++ if (!obj1.isNull())=0D ++ {=0D ++ if (obj1.isNum())=0D ++ m_flags =3D obj1.getInt();=0D ++ }=0D ++ }=0D ++#else=0D + if (actionObj->isDict())=0D + {=0D + if (!actionObj->dictLookup("F", &obj1)->isNull())=0D +@@ -54,6 +93,7 @@ LinkSubmitForm::LinkSubmitForm(Object *actionObj) + }=0D + obj1.free();=0D + }=0D ++#endif=0D + }=0D + =0D + LinkSubmitForm::~LinkSubmitForm()=0D +@@ -66,11 +106,25 @@ LinkImportData::LinkImportData(Object *actionObj) + {=0D + Object obj1, obj3;=0D + fileName =3D NULL;=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 58, 0)=0D ++ if (actionObj->isDict())=0D ++ {=0D ++ obj1 =3D actionObj->dictLookup("F");=0D ++ if (!obj1.isNull())=0D ++ {=0D ++ obj3 =3D getFileSpecNameForPlatform(&obj1);=0D ++ if (!obj3.isNull())=0D ++ {=0D ++ fileName =3D obj3.getString()->copy();=0D ++ }=0D ++ }=0D ++ }=0D ++#else=0D + if (actionObj->isDict())=0D + {=0D + if (!actionObj->dictLookup("F", &obj1)->isNull())=0D + {=0D +- if (getFileSpecNameForPlatform (&obj1, &obj3))=0D ++ if (getFileSpecNameForPlatform(&obj1, &obj3))=0D + {=0D + fileName =3D obj3.getString()->copy();=0D + obj3.free();=0D +@@ -78,6 +132,7 @@ LinkImportData::LinkImportData(Object *actionObj) + }=0D + obj1.free();=0D + }=0D ++#endif=0D + }=0D + =0D + LinkImportData::~LinkImportData()=0D +@@ -256,6 +311,27 @@ LinkAction* SlaOutputDev::SC_getAction(AnnotWidget *a= no) + Object obj;=0D + Ref refa =3D ano->getRef();=0D + Object additionalActions;=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 58, 0)=0D ++ obj =3D xref->fetch(refa.num, refa.gen);=0D ++ if (obj.isDict())=0D ++ {=0D ++ Dict* adic =3D obj.getDict();=0D ++ additionalActions =3D adic->lookupNF("A");=0D ++ Object additionalActionsObject =3D additionalActions.fetch(pdfDoc->getX= Ref());=0D ++ if (additionalActionsObject.isDict())=0D ++ {=0D ++ Object actionObject =3D additionalActionsObject.dictLookup("S");=0D ++ if (actionObject.isName("ImportData"))=0D ++ {=0D ++ linkAction =3D new LinkImportData(&additionalActionsObject);=0D ++ }=0D ++ else if (actionObject.isName("SubmitForm"))=0D ++ {=0D ++ linkAction =3D new LinkSubmitForm(&additionalActionsObject);=0D ++ }=0D ++ }=0D ++ }=0D ++#else=0D + Object *act =3D xref->fetch(refa.num, refa.gen, &obj);=0D + if (act)=0D + {=0D +@@ -283,6 +359,7 @@ LinkAction* SlaOutputDev::SC_getAction(AnnotWidget *an= o) + }=0D + }=0D + obj.free();=0D ++#endif=0D + return linkAction;=0D + }=0D + =0D +@@ -293,6 +370,22 @@ LinkAction* SlaOutputDev::SC_getAdditionalAction(cons= t char *key, AnnotWidget *a + Object obj;=0D + Ref refa =3D ano->getRef();=0D + Object additionalActions;=0D ++=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 58, 0)=0D ++ obj =3D xref->fetch(refa.num, refa.gen);=0D ++ if (obj.isDict())=0D ++ {=0D ++ Dict* adic =3D obj.getDict();=0D ++ additionalActions =3D adic->lookupNF("AA");=0D ++ Object additionalActionsObject =3D additionalActions.fetch(pdfDoc->getX= Ref());=0D ++ if (additionalActionsObject.isDict())=0D ++ {=0D ++ Object actionObject =3D additionalActionsObject.dictLookup(key);=0D ++ if (actionObject.isDict())=0D ++ linkAction =3D LinkAction::parseAction(&actionObject, pdfDoc->getCata= log()->getBaseURI());=0D ++ }=0D ++ }=0D ++#else=0D + Object *act =3D xref->fetch(refa.num, refa.gen, &obj);=0D + if (act)=0D + {=0D +@@ -313,6 +406,7 @@ LinkAction* SlaOutputDev::SC_getAdditionalAction(const= char *key, AnnotWidget *a + }=0D + }=0D + obj.free();=0D ++#endif=0D + return linkAction;=0D + }=0D + =0D +@@ -838,6 +932,33 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, d= ouble xCoor, double yCoor, + {=0D + Object obj1;=0D + Ref refa =3D annota->getRef();=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 58, 0)=0D ++ obj1 =3D xref->fetch(refa.num, refa.gen);=0D ++ if (obj1.isDict())=0D ++ {=0D ++ Dict* dict =3D obj1.getDict();=0D ++ Object obj2 =3D dict->lookup("Kids");=0D ++ //childs=0D ++ if (obj2.isArray())=0D ++ {=0D ++ // Load children=0D ++ QList radList;=0D ++ for (int i =3D 0; i < obj2.arrayGetLength(); i++)=0D ++ {=0D ++ Object childRef =3D obj2.arrayGetNF(i);=0D ++ if (!childRef.isRef())=0D ++ continue;=0D ++ Object childObj =3D obj2.arrayGet(i);=0D ++ if (!childObj.isDict())=0D ++ continue;=0D ++ const Ref ref =3D childRef.getRef();=0D ++ radList.append(ref.num);=0D ++ }=0D ++ QString tmTxt =3D UnicodeParsedString(annota->getName());=0D ++ m_radioMap.insert(tmTxt, radList);=0D ++ }=0D ++ }=0D ++#else=0D + Object *act =3D xref->fetch(refa.num, refa.gen, &obj1);=0D + if (act && act->isDict())=0D + {=0D +@@ -873,6 +994,7 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, do= uble xCoor, double yCoor, + obj2.free();=0D + }=0D + obj1.free();=0D ++#endif=0D + }=0D + return retVal;=0D + }=0D +@@ -3007,6 +3129,23 @@ void SlaOutputDev::beginMarkedContent(char *name, O= bject *dictRef) + }=0D + else=0D + {=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 58, 0)=0D ++ dictObj =3D dictRef->fetch(xref);=0D ++ if (!dictObj.isDict())=0D ++ return;=0D ++ dict =3D dictObj.getDict();=0D ++ dictType =3D dict->lookup("Type");=0D ++ if (dictType.isName("OCG"))=0D ++ {=0D ++ oc =3D contentConfig->findOcgByRef(dictRef->getRef());=0D ++ if (oc)=0D ++ {=0D ++ // qDebug() << "Begin OCG Content with Name " << UnicodeParsedSt= ring(oc->getName());=0D ++ m_doc->setActiveLayer(UnicodeParsedString(oc->getName()));=0D ++ mSte.ocgName =3D UnicodeParsedString(oc->getName());=0D ++ }=0D ++ }=0D ++#else=0D + dictRef->fetch(xref, &dictObj);=0D + if (!dictObj.isDict())=0D + {=0D +@@ -3027,6 +3166,7 @@ void SlaOutputDev::beginMarkedContent(char *name, Ob= ject *dictRef) + }=0D + dictType.free();=0D + dictObj.free();=0D ++#endif=0D + }=0D + }=0D + m_mcStack.push(mSte);=0D +@@ -3046,14 +3186,20 @@ void SlaOutputDev::beginMarkedContent(char *name, = Dict *properties) + {=0D + if (layersSetByOCG)=0D + return;=0D +- Object obj;=0D + QString lName =3D QString("Layer_%1").arg(layerNum + 1);=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 58, 0)=0D ++ Object obj =3D properties->lookup((char*) "Title");=0D ++ if (obj.isString())=0D ++ lName =3D QString(obj.getString()->getCString());=0D ++#else=0D ++ Object obj;=0D + if (properties->lookup((char*)"Title", &obj))=0D + {=0D + if (obj.isString())=0D + lName =3D QString(obj.getString()->getCString());=0D + obj.free();=0D + }=0D ++#endif=0D + for (ScLayers::iterator it =3D m_doc->Layers.begin(); it !=3D m_doc->L= ayers.end(); ++it)=0D + {=0D + if (it->Name =3D=3D lName)=0D +@@ -3066,6 +3212,29 @@ void SlaOutputDev::beginMarkedContent(char *name, D= ict *properties) + if (!firstLayer)=0D + currentLayer =3D m_doc->addLayer(lName, true);=0D + firstLayer =3D false;=0D ++#if POPPLER_ENCODED_VERSION >=3D POPPLER_VERSION_ENCODE(0, 58, 0)=0D ++ obj =3D properties->lookup((char*) "Visible");=0D ++ if (obj.isBool())=0D ++ m_doc->setLayerVisible(currentLayer, obj.getBool());=0D ++ obj =3D properties->lookup((char*) "Editable");=0D ++ if (obj.isBool())=0D ++ m_doc->setLayerLocked(currentLayer, !obj.getBool());=0D ++ obj =3D properties->lookup((char*) "Printed");=0D ++ if (obj.isBool())=0D ++ m_doc->setLayerPrintable(currentLayer, obj.getBool());=0D ++ obj =3D properties->lookup((char*)"Color");=0D ++ if (obj.isArray())=0D ++ {=0D ++ Object obj1;=0D ++ obj1 =3D obj.arrayGet(0);=0D ++ int r =3D obj1.getNum() / 256;=0D ++ obj1 =3D obj.arrayGet(1);=0D ++ int g =3D obj1.getNum() / 256;=0D ++ obj1 =3D obj.arrayGet(2);=0D ++ int b =3D obj1.getNum() / 256;=0D ++ m_doc->setLayerMarker(currentLayer, QColor(r, g, b));=0D ++ }=0D ++#else=0D + if (properties->lookup((char*)"Visible", &obj))=0D + {=0D + if (obj.isBool())=0D +@@ -3102,6 +3271,7 @@ void SlaOutputDev::beginMarkedContent(char *name, Di= ct *properties) + }=0D + obj.free();=0D + }=0D ++#endif=0D + }=0D + }=0D + }=0D +--=20 +2.14.2 + diff --git a/gnu/packages/patches/scribus-fix-poppler-packaging.patch b/gnu= /packages/patches/scribus-fix-poppler-packaging.patch new file mode 100644 index 000000000..2659bafa6 --- /dev/null +++ b/gnu/packages/patches/scribus-fix-poppler-packaging.patch @@ -0,0 +1,95 @@ +diff --git a/.travis.yml b/.travis.yml +index 6e9562b2c..f4273227a 100644 +--- a/.travis.yml ++++ b/.travis.yml +@@ -31,8 +31,8 @@ before_install: + libhyphen-dev liblcms2-dev libpodofo-dev libtiff-dev libxml2-dev + python-all-dev zlib1g-dev qt58base qt58declarative + qt58tools libgraphicsmagick++1-dev +- libopenscenegraph-dev libpoppler-dev libcairo2-dev libwpg-dev libms= pub-dev +- libcdr-dev libvisio-dev libharfbuzz-dev libharfbuzz-icu0 ++ libopenscenegraph-dev libpoppler-dev libpoppler-cpp-dev libcairo2-d= ev libwpg-dev=20 ++ libmspub-dev libcdr-dev libvisio-dev libharfbuzz-dev libharfbuzz-ic= u0 + coreutils binutils python-tk; + fi + # OSX +diff --git a/cmake/modules/FindPOPPLER.cmake b/cmake/modules/FindPOPPLER.c= make +index d684bd503..899284db6 100644 +--- a/cmake/modules/FindPOPPLER.cmake ++++ b/cmake/modules/FindPOPPLER.cmake +@@ -1,12 +1,16 @@ + if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.5) + include(UsePkgConfig) + PKGCONFIG(poppler _libPopplerIncDir _libPopplerLinkDir _libPopplerLinkFl= ags _libPopplerCflags) +- set(PKG_POPPLER_INCLUDE_DIRS ${_libPopplerIncDir}) +- set(PKG_POPPLER_LIBRARIES ${_libPopplerLinkDir}) +- else (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.5) +- include(FindPkgConfig) ++ set(PKG_POPPLER_INCLUDE_DIRS ${_libPopplerIncDir}) ++ set(PKG_POPPLER_LIBRARIES ${_libPopplerLinkDir}) ++else (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.5) ++ include(FindPkgConfig) + pkg_search_module(POPPLER libpoppler>=3D0.19.0 poppler>=3D0.19.0) +- endif (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.5) ++ if (POPPLER_FOUND) ++ pkg_search_module(POPPLER_CPP REQUIRED libpoppler-cpp>=3D0.19.0 poppler= -cpp>=3D0.19.0) ++ endif(POPPLER_FOUND) ++endif (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.5) ++=20 + find_path(POPPLER_INCLUDE_DIR=20 + NAMES poppler-config.h + PATHS ${PKG_POPPLER_INCLUDE_DIRS} ${POPPLER_INCLUDE_DIRS} /usr/local/in= clude /usr/include +@@ -14,16 +18,31 @@ find_path(POPPLER_INCLUDE_DIR + NO_DEFAULT_PATH + ) +=20 ++find_path(POPPLER_CPP_INCLUDE_DIR=20 ++ NAMES poppler-version.h ++ PATHS ${PKG_POPPLER_CPP_INCLUDE_DIRS} ${POPPLER_CPP_INCLUDE_DIRS} /usr/= local/include /usr/include ++ PATH_SUFFIXES poppler ++ NO_DEFAULT_PATH ++) ++ + find_library(POPPLER_LIBRARY + NAMES libpoppler poppler + PATHS ${PKG_POPPLER_LIBRARIES} ${POPPLER_LIBRARY_DIRS} /usr/local/lib /= usr/lib /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} + PATH_SUFFIXES poppler + NO_DEFAULT_PATH + ) ++ ++find_library(POPPLER_CPP_LIBRARY ++ NAMES libpoppler-cpp poppler-cpp ++ PATHS ${PKG_POPPLER_CPP_LIBRARIES} ${POPPLER_CPP_LIBRARY_DIRS} /usr/loc= al/lib /usr/lib /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} ++ PATH_SUFFIXES poppler ++ NO_DEFAULT_PATH ++) ++ + if (POPPLER_LIBRARY) +- if (POPPLER_INCLUDE_DIR) ++ if (POPPLER_INCLUDE_DIR AND POPPLER_CPP_INCLUDE_DIR) + set( FOUND_POPPLER 1 ) +- set( POPPLER_LIBRARIES ${POPPLER_LIBRARY} ) +- set( POPPLER_INCLUDES ${POPPLER_INCLUDE_DIR}) +- endif (POPPLER_INCLUDE_DIR) ++ set( POPPLER_LIBRARIES ${POPPLER_LIBRARY} ${POPPLER_CPP_LIBRARY} ) ++ set( POPPLER_INCLUDES ${POPPLER_INCLUDE_DIR} ${POPPLER_CPP_INCLUDE_DI= R} ) ++ endif (POPPLER_INCLUDE_DIR AND POPPLER_CPP_INCLUDE_DIR) + endif (POPPLER_LIBRARY) +diff --git a/scribus/plugins/import/pdf/CMakeLists.txt b/scribus/plugins/i= mport/pdf/CMakeLists.txt +index cd1610298..85760d96e 100644 +--- a/scribus/plugins/import/pdf/CMakeLists.txt ++++ b/scribus/plugins/import/pdf/CMakeLists.txt +@@ -2,9 +2,9 @@ include_directories( + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/scribus + ${POPPLER_INCLUDE_DIR} ++ ${POPPLER_CPP_INCLUDE_DIR} + ) +=20 +- + set(IMPORTPDF_PLUGIN_UI_SRC + pdfimportoptions.ui + ) +--=20 +2.14.2 + diff --git a/gnu/packages/scribus.scm b/gnu/packages/scribus.scm index d48051ee3..02280f555 100644 --- a/gnu/packages/scribus.scm +++ b/gnu/packages/scribus.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2015 Ricardo Wurmus ;;; Copyright =C2=A9 2016 Efraim Flashner +;;; Copyright =C2=A9 2017 Nicolas Goaziou ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,53 +25,87 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (guix build-system cmake) #:use-module (gnu packages) + #:use-module (gnu packages boost) #:use-module (gnu packages compression) #:use-module (gnu packages cups) #:use-module (gnu packages fontutils) #:use-module (gnu packages ghostscript) #:use-module (gnu packages gtk) + #:use-module (gnu packages icu4c) #:use-module (gnu packages image) + #:use-module (gnu packages imagemagick) + #:use-module (gnu packages libreoffice) #:use-module (gnu packages linux) + #:use-module (gnu packages pdf) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages qt) - #:use-module (gnu packages imagemagick) + #:use-module (gnu packages tls) #:use-module (gnu packages xml)) =20 (define-public scribus (package (name "scribus") - (version "1.5.2") + (version "1.5.3") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/scribus/scribus-de= vel/" version "/scribus-" version ".tar.xz")) (sha256 (base32 - "1xbl7h4x32y2nfhn57ivjziyvlnwadcbizqwfqx5srfsmqiyqppc")))) + "0kyp45vidxa3v35ic9592db4zk3m8al26vck38q5v7z14x3hp8vk")) + (patches + ;; These patches are necessary to build package with Popple= r >=3D + ;; 0.58. They are extracted from trunk and will be include= d in + ;; Scribus 1.5.4. + (search-patches "scribus-fix-poppler-0.58-breakage.patch" + "scribus-fix-poppler-packaging.patch")))) (build-system cmake-build-system) (arguments - `(#:tests? #f ; no test target + `(#:tests? #f ;no test target #:configure-flags - '("-DCMAKE_CXX_FLAGS=3D-std=3Dgnu++11"))) + '("-DWANT_GRAPHICSMAGICK=3D1") + #:phases + (modify-phases %standard-phases + ;; Fix typo. Patch included in trunk. See + ;; . + (add-before 'configure 'fix-podofo + (lambda _ + (substitute* "cmake/modules/FindLIBPODOFO.cmake" + (("find_package\\(OPENSSL\\)") "find_package(OpenSSL)")) + #t))))) (inputs `(("cairo" ,cairo) ("cups" ,cups) + ("fontconfig" ,fontconfig) + ("freetype" ,freetype) ("graphicsmagick" ,graphicsmagick) + ("harfbuzz" ,harfbuzz) + ("hunspell" ,hunspell) + ("icu4c" ,icu4c) ("lcms" ,lcms) + ("libcdr" ,libcdr) + ("libfreehand" ,libfreehand) ("libjpeg" ,libjpeg) + ("libmspub" ,libmspub) + ("libpagemaker" ,libpagemaker) + ("librevenge" ,librevenge) ("libtiff" ,libtiff) + ("libvisio" ,libvisio) ("libxml2" ,libxml2) - ("python" ,python-2) - ("freetype" ,freetype) + ("openssl" ,openssl) + ("podofo" ,podofo) + ("poppler" ,poppler) + ("python" ,python-2) ;need Python library ("qtbase" ,qtbase) ("qtdeclarative" ,qtdeclarative) - ("qttools" ,qttools) ("zlib" ,zlib))) (native-inputs - `(("util-linux" ,util-linux) - ("pkg-config" ,pkg-config))) - (home-page "http://scribus.net") + `(("boost" ,boost) + ("pkg-config" ,pkg-config) + ("qttools" ,qttools) + ("util-linux" ,util-linux))) + (home-page "https://www.scribus.net") (synopsis "Desktop publishing and page layout program") (description "Scribus is a @dfn{desktop publishing} (DTP) application and can be u= sed --=20 2.14.2 --=-=-=--