all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#28954] [PATCH] Update Scribus to 1.5.3.  Re-vamp package.
@ 2017-10-23 10:46 Nicolas Goaziou
  2017-10-24  8:34 ` Eric Bavier
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2017-10-23 10:46 UTC (permalink / raw)
  To: 28954

[-- Attachment #1: Type: text/plain, Size: 961 bytes --]

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

[-- Attachment #2: Scribus re-vamp --]
[-- Type: text/x-diff, Size: 28160 bytes --]

From e42a5b62476e63184c3a4164d73410decbbb2a75 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
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 =						\
   %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/import/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 <poppler/PageTransition.h>
+ #include <poppler/ViewerPreferences.h>
+ #include <poppler/poppler-config.h>
++#include <poppler/cpp/poppler-version.h>
+ #include <poppler/SplashOutputDev.h>
+ #include <poppler/splash/SplashBitmap.h>
+ 
+@@ -59,6 +60,12 @@ for which a new license (GPL+exception) is in place.
+ #include "ui/multiprogressdialog.h"
+ #include "ui/propertiespalette.h"
+ 
++#define POPPLER_VERSION_ENCODE(major, minor, micro) (	\
++	  ((major) * 10000)				\
++	+ ((minor) *   100)				\
++	+ ((micro) *     1))
++#define POPPLER_ENCODED_VERSION POPPLER_VERSION_ENCODE(POPPLER_VERSION_MAJOR, POPPLER_VERSION_MINOR, POPPLER_VERSION_MICRO)
++
+ PdfPlug::PdfPlug(ScribusDoc* doc, int flags)
+ {
+ 	tmpSele = new Selection(this, false);
+@@ -507,12 +514,20 @@ bool PdfPlug::convert(const QString& fn)
+ 							{
+ 								for (int i = 0; i < order->getLength (); ++i)
+ 								{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++									Object orderItem = order->get(i);
++#else
+ 									Object orderItem;
+ 									order->get(i, &orderItem);
++#endif
+ 									if (orderItem.isDict())
+ 									{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++										Object ref = order->getNF(i);		
++#else
+ 										Object ref;
+ 										order->getNF(i, &ref);
++#endif
+ 										if (ref.isRef())
+ 										{
+ 											OptionalContentGroup *oc = ocg->findOcgByRef(ref.getRef());
+@@ -523,7 +538,9 @@ bool PdfPlug::convert(const QString& fn)
+ 												ocgNames.append(ocgName);
+ 											}
+ 										}
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 58, 0)
+ 										ref.free();
++#endif
+ 									}
+ 									else
+ 									{
+@@ -597,39 +614,71 @@ bool PdfPlug::convert(const QString& fn)
+ 							dev->layersSetByOCG = true;
+ 						}
+ #endif
++
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++						Object info = pdfDoc->getDocInfo();
++						if (info.isDict())
++						{
++							Object obj;
++							Dict *infoDict = info.getDict();
++							obj = infoDict->lookup((char*) "Title");
++							if (obj.isString())
++							{
++								m_Doc->documentInfo().setTitle(UnicodeParsedString(obj.getString()));
++							}
++							obj = infoDict->lookup((char*) "Author");
++							if (obj.isString())
++							{
++								m_Doc->documentInfo().setAuthor(UnicodeParsedString(obj.getString()));
++							}
++							obj = infoDict->lookup((char*) "Subject");
++							if (obj.isString())
++							{
++								m_Doc->documentInfo().setSubject(UnicodeParsedString(obj.getString()));
++							}
++							obj = infoDict->lookup((char*) "Keywords");
++							if (obj.isString())
++							{
++								//		s1 = obj.getString();
++								m_Doc->documentInfo().setKeywords(UnicodeParsedString(obj.getString()));
++							}
++						}
++						info = Object();
++#else
+ 						Object info;
+ 						pdfDoc->getDocInfo(&info);
+ 						if (info.isDict())
+ 						{
+ 							Object obj;
+-						//	GooString *s1;
++							//	GooString *s1;
+ 							Dict *infoDict = info.getDict();
+-							if (infoDict->lookup((char*)"Title", &obj )->isString())
++							if (infoDict->lookup((char*)"Title", &obj)->isString())
+ 							{
+-						//		s1 = obj.getString();
++								//		s1 = obj.getString();
+ 								m_Doc->documentInfo().setTitle(UnicodeParsedString(obj.getString()));
+ 								obj.free();
+ 							}
+-							if (infoDict->lookup((char*)"Author", &obj )->isString())
++							if (infoDict->lookup((char*)"Author", &obj)->isString())
+ 							{
+-						//		s1 = obj.getString();
++								//		s1 = obj.getString();
+ 								m_Doc->documentInfo().setAuthor(UnicodeParsedString(obj.getString()));
+ 								obj.free();
+ 							}
+-							if (infoDict->lookup((char*)"Subject", &obj )->isString())
++							if (infoDict->lookup((char*)"Subject", &obj)->isString())
+ 							{
+-						//		s1 = obj.getString();
++								//		s1 = obj.getString();
+ 								m_Doc->documentInfo().setSubject(UnicodeParsedString(obj.getString()));
+ 								obj.free();
+ 							}
+-							if (infoDict->lookup((char*)"Keywords", &obj )->isString())
++							if (infoDict->lookup((char*)"Keywords", &obj)->isString())
+ 							{
+-						//		s1 = obj.getString();
++								//		s1 = obj.getString();
+ 								m_Doc->documentInfo().setKeywords(UnicodeParsedString(obj.getString()));
+ 								obj.free();
+ 							}
+ 						}
+ 						info.free();
++#endif
+ 						if (cropped)
+ 						{
+ 							QRectF crBox = getCBox(contentRect, pageNs[0]);
+@@ -746,8 +795,13 @@ bool PdfPlug::convert(const QString& fn)
+ 									pdfDoc->displayPage(dev, pp, hDPI, vDPI, rotate, useMediaBox, crop, printing, NULL, NULL, dev->annotations_callback, dev);
+ 							}
+ 							PDFPresentationData ef;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++							Object trans = pdfDoc->getPage(pp)->getTrans();
++							Object *transi = &trans;
++#else
+ 							Object trans;
+ 							Object *transi = pdfDoc->getPage(pp)->getTrans(&trans);
++#endif
+ 							if (transi->isDict())
+ 							{
+ 								m_Doc->pdfOptions().PresentMode = true;
+@@ -793,32 +847,51 @@ bool PdfPlug::convert(const QString& fn)
+ 								delete pgTrans;
+ 							}
+ 							m_Doc->currentPage()->PresentVals = ef;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 58, 0)
+ 							trans.free();
+ 							transi->free();
++#endif
+ 						}
+ 						int numjs = pdfDoc->getCatalog()->numJS();
+ 						if (numjs > 0)
+ 						{
+ 							NameTree *jsNameTreeP = new NameTree();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++							Object catDict = pdfDoc->getXRef()->getCatalog();
++#else
+ 							Object catDict;
+ 							pdfDoc->getXRef()->getCatalog(&catDict);
++#endif
+ 							if (catDict.isDict())
+ 							{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++								Object names = catDict.dictLookup("Names");
++#else
+ 								Object names;
+ 								catDict.dictLookup("Names", &names);
++#endif
+ 								if (names.isDict())
+ 								{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++									Object obj = names.dictLookup("JavaScript");
++									jsNameTreeP->init(pdfDoc->getXRef(), &obj);
++#else
+ 									Object obj;
+ 									names.dictLookup("JavaScript", &obj);
+ 									jsNameTreeP->init(pdfDoc->getXRef(), &obj);
+ 									obj.free();
++#endif
+ 								}
+ 								for (int a = 0; a < numjs; a++)
+ 								{
+ 									m_Doc->JavaScripts.insert(UnicodeParsedString(jsNameTreeP->getName(a)), UnicodeParsedString(pdfDoc->getCatalog()->getJS(a)));
+ 								}
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++								names = catDict.dictLookup("OpenAction");
++#else
+ 								names.free();
+ 								catDict.dictLookup("OpenAction", &names);
++#endif
+ 								if (names.isDict())
+ 								{
+ 									LinkAction *linkAction = NULL;
+@@ -839,9 +912,13 @@ bool PdfPlug::convert(const QString& fn)
+ 										}
+ 									}
+ 								}
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 58, 0)
+ 								names.free();
++#endif
+ 							}
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 58, 0)
+ 							catDict.free();
++#endif
+ 							delete jsNameTreeP;
+ 						}
+ 						m_Doc->pdfOptions().Version = (PDFOptions::PDFVersion)qMin(15, qMax(13, pdfDoc->getPDFMajorVersion() * 10 + pdfDoc->getPDFMinorVersion()));
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/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.
+ */
+ 
+ #include "slaoutput.h"
++#include <poppler/cpp/poppler-version.h>
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -19,11 +20,49 @@ for which a new license (GPL+exception) is in place.
+ #include "util_math.h"
+ #include <tiffio.h>
+ 
++#define POPPLER_VERSION_ENCODE(major, minor, micro) (	\
++	  ((major) * 10000)				\
++	+ ((minor) *   100)				\
++	+ ((micro) *     1))
++#define POPPLER_ENCODED_VERSION POPPLER_VERSION_ENCODE(POPPLER_VERSION_MAJOR, POPPLER_VERSION_MINOR, POPPLER_VERSION_MICRO)
++
+ LinkSubmitForm::LinkSubmitForm(Object *actionObj)
+ {
+ 	Object obj1, obj2, obj3;
+ 	fileName = NULL;
+ 	m_flags = 0;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++	if (actionObj->isDict())
++	{
++		obj1 = actionObj->dictLookup("F");
++		if (!obj1.isNull())
++		{
++			if (obj1.isDict())
++			{
++				obj3 = obj1.dictLookup("FS");
++				if (!obj3.isNull())
++				{
++					if (obj3.isName())
++					{
++						char *name = obj3.getName();
++						if (!strcmp(name, "URL"))
++						{
++							obj2 = obj1.dictLookup("F");
++							if (!obj2.isNull())
++								fileName = obj2.getString()->copy();
++						}
++					}
++				}
++			}
++		}
++		obj1 = actionObj->dictLookup("Flags");
++		if (!obj1.isNull())
++		{
++			if (obj1.isNum())
++				m_flags = obj1.getInt();
++		}
++	}
++#else
+ 	if (actionObj->isDict())
+ 	{
+ 		if (!actionObj->dictLookup("F", &obj1)->isNull())
+@@ -54,6 +93,7 @@ LinkSubmitForm::LinkSubmitForm(Object *actionObj)
+ 		}
+ 		obj1.free();
+ 	}
++#endif
+ }
+ 
+ LinkSubmitForm::~LinkSubmitForm()
+@@ -66,11 +106,25 @@ LinkImportData::LinkImportData(Object *actionObj)
+ {
+ 	Object obj1, obj3;
+ 	fileName = NULL;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++	if (actionObj->isDict())
++	{
++		obj1 = actionObj->dictLookup("F");
++		if (!obj1.isNull())
++		{
++			obj3 = getFileSpecNameForPlatform(&obj1);
++			if (!obj3.isNull())
++			{
++				fileName = obj3.getString()->copy();
++			}
++		}
++	}
++#else
+ 	if (actionObj->isDict())
+ 	{
+ 		if (!actionObj->dictLookup("F", &obj1)->isNull())
+ 		{
+-			if (getFileSpecNameForPlatform (&obj1, &obj3))
++			if (getFileSpecNameForPlatform(&obj1, &obj3))
+ 			{
+ 				fileName = obj3.getString()->copy();
+ 				obj3.free();
+@@ -78,6 +132,7 @@ LinkImportData::LinkImportData(Object *actionObj)
+ 		}
+ 		obj1.free();
+ 	}
++#endif
+ }
+ 
+ LinkImportData::~LinkImportData()
+@@ -256,6 +311,27 @@ LinkAction* SlaOutputDev::SC_getAction(AnnotWidget *ano)
+ 	Object obj;
+ 	Ref refa = ano->getRef();
+ 	Object additionalActions;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++	obj = xref->fetch(refa.num, refa.gen);
++	if (obj.isDict())
++	{
++		Dict* adic = obj.getDict();
++		additionalActions = adic->lookupNF("A");
++		Object additionalActionsObject = additionalActions.fetch(pdfDoc->getXRef());
++		if (additionalActionsObject.isDict())
++		{
++			Object actionObject = additionalActionsObject.dictLookup("S");
++			if (actionObject.isName("ImportData"))
++			{
++				linkAction = new LinkImportData(&additionalActionsObject);
++			}
++			else if (actionObject.isName("SubmitForm"))
++			{
++				linkAction = new LinkSubmitForm(&additionalActionsObject);
++			}
++		}
++	}
++#else
+ 	Object *act = xref->fetch(refa.num, refa.gen, &obj);
+ 	if (act)
+ 	{
+@@ -283,6 +359,7 @@ LinkAction* SlaOutputDev::SC_getAction(AnnotWidget *ano)
+ 		}
+ 	}
+ 	obj.free();
++#endif
+ 	return linkAction;
+ }
+ 
+@@ -293,6 +370,22 @@ LinkAction* SlaOutputDev::SC_getAdditionalAction(const char *key, AnnotWidget *a
+ 	Object obj;
+ 	Ref refa = ano->getRef();
+ 	Object additionalActions;
++
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++	obj = xref->fetch(refa.num, refa.gen);
++	if (obj.isDict())
++	{
++		Dict* adic = obj.getDict();
++		additionalActions = adic->lookupNF("AA");
++		Object additionalActionsObject = additionalActions.fetch(pdfDoc->getXRef());
++		if (additionalActionsObject.isDict())
++		{
++			Object actionObject = additionalActionsObject.dictLookup(key);
++			if (actionObject.isDict())
++				linkAction = LinkAction::parseAction(&actionObject, pdfDoc->getCatalog()->getBaseURI());
++		}
++	}
++#else
+ 	Object *act = xref->fetch(refa.num, refa.gen, &obj);
+ 	if (act)
+ 	{
+@@ -313,6 +406,7 @@ LinkAction* SlaOutputDev::SC_getAdditionalAction(const char *key, AnnotWidget *a
+ 		}
+ 	}
+ 	obj.free();
++#endif
+ 	return linkAction;
+ }
+ 
+@@ -838,6 +932,33 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ 	{
+ 		Object obj1;
+ 		Ref refa = annota->getRef();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++		obj1 = xref->fetch(refa.num, refa.gen);
++		if (obj1.isDict())
++		{
++			Dict* dict = obj1.getDict();
++			Object obj2 = dict->lookup("Kids");
++			//childs
++			if (obj2.isArray())
++			{
++				// Load children
++				QList<int> radList;
++				for (int i = 0; i < obj2.arrayGetLength(); i++)
++				{
++					Object childRef = obj2.arrayGetNF(i);
++					if (!childRef.isRef())
++						continue;
++					Object childObj = obj2.arrayGet(i);
++					if (!childObj.isDict())
++						continue;
++					const Ref ref = childRef.getRef();
++					radList.append(ref.num);
++				}
++				QString tmTxt = UnicodeParsedString(annota->getName());
++				m_radioMap.insert(tmTxt, radList);
++			}
++		}
++#else
+ 		Object *act = xref->fetch(refa.num, refa.gen, &obj1);
+ 		if (act && act->isDict())
+ 		{
+@@ -873,6 +994,7 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ 			obj2.free();
+ 		}
+ 		obj1.free();
++#endif
+ 	}
+ 	return retVal;
+ }
+@@ -3007,6 +3129,23 @@ void SlaOutputDev::beginMarkedContent(char *name, Object *dictRef)
+ 		}
+ 		else
+ 		{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++			dictObj = dictRef->fetch(xref);
++			if (!dictObj.isDict())
++				return;
++			dict = dictObj.getDict();
++			dictType = dict->lookup("Type");
++			if (dictType.isName("OCG"))
++			{
++				oc = contentConfig->findOcgByRef(dictRef->getRef());
++				if (oc)
++				{
++					//					qDebug() << "Begin OCG Content with Name " << UnicodeParsedString(oc->getName());
++					m_doc->setActiveLayer(UnicodeParsedString(oc->getName()));
++					mSte.ocgName = UnicodeParsedString(oc->getName());
++				}
++			}
++#else
+ 			dictRef->fetch(xref, &dictObj);
+ 			if (!dictObj.isDict())
+ 			{
+@@ -3027,6 +3166,7 @@ void SlaOutputDev::beginMarkedContent(char *name, Object *dictRef)
+ 			}
+ 			dictType.free();
+ 			dictObj.free();
++#endif
+ 		}
+ 	}
+ 	m_mcStack.push(mSte);
+@@ -3046,14 +3186,20 @@ void SlaOutputDev::beginMarkedContent(char *name, Dict *properties)
+ 		{
+ 			if (layersSetByOCG)
+ 				return;
+-			Object obj;
+ 			QString lName = QString("Layer_%1").arg(layerNum + 1);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++			Object obj = properties->lookup((char*) "Title");
++			if (obj.isString())
++				lName = QString(obj.getString()->getCString());
++#else
++			Object obj;
+ 			if (properties->lookup((char*)"Title", &obj))
+ 			{
+ 				if (obj.isString())
+ 					lName =  QString(obj.getString()->getCString());
+ 				obj.free();
+ 			}
++#endif
+ 			for (ScLayers::iterator it = m_doc->Layers.begin(); it != m_doc->Layers.end(); ++it)
+ 			{
+ 				if (it->Name == lName)
+@@ -3066,6 +3212,29 @@ void SlaOutputDev::beginMarkedContent(char *name, Dict *properties)
+ 			if (!firstLayer)
+ 				currentLayer = m_doc->addLayer(lName, true);
+ 			firstLayer = false;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++			obj = properties->lookup((char*) "Visible");
++			if (obj.isBool())
++				m_doc->setLayerVisible(currentLayer, obj.getBool());
++			obj = properties->lookup((char*) "Editable");
++			if (obj.isBool())
++				m_doc->setLayerLocked(currentLayer, !obj.getBool());
++			obj = properties->lookup((char*) "Printed");
++			if (obj.isBool())
++				m_doc->setLayerPrintable(currentLayer, obj.getBool());
++			obj = properties->lookup((char*)"Color");
++			if (obj.isArray())
++			{
++				Object obj1;
++				obj1 = obj.arrayGet(0);
++				int r = obj1.getNum() / 256;
++				obj1 = obj.arrayGet(1);
++				int g = obj1.getNum() / 256;
++				obj1 = obj.arrayGet(2);
++				int b = obj1.getNum() / 256;
++				m_doc->setLayerMarker(currentLayer, QColor(r, g, b));
++			}
++#else
+ 			if (properties->lookup((char*)"Visible", &obj))
+ 			{
+ 				if (obj.isBool())
+@@ -3102,6 +3271,7 @@ void SlaOutputDev::beginMarkedContent(char *name, Dict *properties)
+ 				}
+ 				obj.free();
+ 			}
++#endif
+ 		}
+ 	}
+ }
+-- 
+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 libmspub-dev
+-      libcdr-dev libvisio-dev libharfbuzz-dev libharfbuzz-icu0
++      libopenscenegraph-dev libpoppler-dev libpoppler-cpp-dev libcairo2-dev libwpg-dev 
++      libmspub-dev libcdr-dev libvisio-dev libharfbuzz-dev libharfbuzz-icu0
+       coreutils binutils python-tk;
+     fi
+ # OSX
+diff --git a/cmake/modules/FindPOPPLER.cmake b/cmake/modules/FindPOPPLER.cmake
+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 _libPopplerLinkFlags _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>=0.19.0 poppler>=0.19.0)
+- endif (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.5)
++	if (POPPLER_FOUND)
++		pkg_search_module(POPPLER_CPP REQUIRED libpoppler-cpp>=0.19.0 poppler-cpp>=0.19.0)
++	endif(POPPLER_FOUND)
++endif (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.5)
++ 
+ find_path(POPPLER_INCLUDE_DIR 
+   NAMES poppler-config.h
+   PATHS ${PKG_POPPLER_INCLUDE_DIRS} ${POPPLER_INCLUDE_DIRS} /usr/local/include /usr/include
+@@ -14,16 +18,31 @@ find_path(POPPLER_INCLUDE_DIR
+   NO_DEFAULT_PATH
+ )
+ 
++find_path(POPPLER_CPP_INCLUDE_DIR 
++  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/local/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_DIR} )
++  endif (POPPLER_INCLUDE_DIR AND POPPLER_CPP_INCLUDE_DIR)
+ endif (POPPLER_LIBRARY)
+diff --git a/scribus/plugins/import/pdf/CMakeLists.txt b/scribus/plugins/import/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}
+ )
+ 
+-
+ set(IMPORTPDF_PLUGIN_UI_SRC
+ 	pdfimportoptions.ui
+ )
+-- 
+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 © 2015 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2017 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;;
 ;;; 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))
 
 (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-devel/"
                                   version "/scribus-" version ".tar.xz"))
               (sha256
                (base32
-                "1xbl7h4x32y2nfhn57ivjziyvlnwadcbizqwfqx5srfsmqiyqppc"))))
+                "0kyp45vidxa3v35ic9592db4zk3m8al26vck38q5v7z14x3hp8vk"))
+              (patches
+               ;; These patches are necessary to build package with Poppler >=
+               ;; 0.58.  They are extracted from trunk and will be included 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=-std=gnu++11")))
+       '("-DWANT_GRAPHICSMAGICK=1")
+       #:phases
+       (modify-phases %standard-phases
+         ;; Fix typo.  Patch included in trunk.  See
+         ;; <https://bugs.scribus.net/view.php?id=14850>.
+         (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 used
-- 
2.14.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#28954] [PATCH] Update Scribus to 1.5.3.  Re-vamp package.
  2017-10-23 10:46 [bug#28954] [PATCH] Update Scribus to 1.5.3. Re-vamp package Nicolas Goaziou
@ 2017-10-24  8:34 ` Eric Bavier
  2017-10-24 15:34   ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Bavier @ 2017-10-24  8:34 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: 28954

On Mon, 23 Oct 2017 12:46:51 +0200
Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:

> From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
> To: 28954@debbugs.gnu.org
> Subject: [bug#28954] [PATCH] Update Scribus to 1.5.3.  Re-vamp package.
> Date: Mon, 23 Oct 2017 12:46:51 +0200
> Sender: "Guix-patches"
>  <guix-patches-bounces+ericbavier=centurylink.net@gnu.org>
> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)
> 
> Hello,
> 
> The following patch updates Scribus to 1.5.3.  It requires changes to
> the package definition itself (in particular patches and additional
> inputs).  
> 
[...]
> From e42a5b62476e63184c3a4164d73410decbbb2a75 Mon Sep 17 00:00:00 2001
> From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
> 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.

Remove the blank line between entries.

> ---
>  gnu/local.mk                                       |   2 +
>  .../scribus-fix-poppler-0.58-breakage.patch        | 526 +++++++++++++++++++++
>  .../patches/scribus-fix-poppler-packaging.patch    |  95 ++++

Could you include a url where these patches came from in the patches
themselves?  You mention in the package definition that they came from
upstream's trunk.

Or, for large patches, some have experimented with using an origin that
fetches the patch from upstream rather than pulling the patch into
Guix.

>  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
> 
[...] 
>  (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-devel/"
>                                    version "/scribus-" version ".tar.xz"))
>                (sha256
>                 (base32
> -                "1xbl7h4x32y2nfhn57ivjziyvlnwadcbizqwfqx5srfsmqiyqppc"))))
> +                "0kyp45vidxa3v35ic9592db4zk3m8al26vck38q5v7z14x3hp8vk"))
> +              (patches
> +               ;; These patches are necessary to build package with Poppler >=
> +               ;; 0.58.  They are extracted from trunk and will be included 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

I see no need for this whitespace-only change.

>         #:configure-flags
> -       '("-DCMAKE_CXX_FLAGS=-std=gnu++11")))
> +       '("-DWANT_GRAPHICSMAGICK=1")
> +       #:phases
> +       (modify-phases %standard-phases
> +         ;; Fix typo.  Patch included in trunk.  See
> +         ;; <https://bugs.scribus.net/view.php?id=14850>.
> +         (add-before 'configure 'fix-podofo
> +           (lambda _
> +             (substitute* "cmake/modules/FindLIBPODOFO.cmake"
> +               (("find_package\\(OPENSSL\\)") "find_package(OpenSSL)"))
> +             #t)))))

Could you move this into an origin snippet instead?  We'd want a fix
like this included in the source when someone uses 'guix build -S
scribus'

>      (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)

Is boost really a native input?  I'm surprised.  Is it used only for
build-related things?


Otherwise LGTM.  Could you send an updated patch?  Then I'll try
building it.

Thanks,
`~Eric

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [bug#28954] [PATCH] Update Scribus to 1.5.3.  Re-vamp package.
  2017-10-24  8:34 ` Eric Bavier
@ 2017-10-24 15:34   ` Nicolas Goaziou
  2017-10-25 23:23     ` Eric Bavier
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2017-10-24 15:34 UTC (permalink / raw)
  To: Eric Bavier; +Cc: 28954

[-- Attachment #1: Type: text/plain, Size: 1746 bytes --]

Hello,

Eric Bavier <ericbavier@centurylink.net> writes:

> Remove the blank line between entries.

Fixed.

> Could you include a url where these patches came from in the patches
> themselves?  You mention in the package definition that they came from
> upstream's trunk.
>
> Or, for large patches, some have experimented with using an origin that
> fetches the patch from upstream rather than pulling the patch into
> Guix.

I cloned project's git mirror and picked two specific commits. There is
no proper URL that I know of.

You can see them at

  https://www.scribus.net/websvn/listing.php?repname=Scribus&peg=22197&rev=22154

and

  https://www.scribus.net/websvn/listing.php?repname=Scribus&peg=22197&rev=22155

although not as patch files.

>> +     `(#:tests? #f                      ;no test target
>
> I see no need for this whitespace-only change.

Considering I rewrote a large part of the package definition, I might as
well fix indentation issues. This one is going to bother anyone editing
the package with Emacs. With this change, the line isn't modified when
re-indenting the whole S-exp.

If you are not convinced, consider this to be a nitpicking of mine.

> Could you move this into an origin snippet instead?  We'd want a fix
> like this included in the source when someone uses 'guix build -S
> scribus'

Done.

> Is boost really a native input?  I'm surprised.  Is it used only for
> build-related things?

I don't know. I think Archlinux put that in the build side. However,
I never know when a package is meant to be a native-input or not. I know
the difference between native inputs and inputs, though.

Thank you for the review.

Regards,

-- 
Nicolas Goaziou                                                0x80A93738

[-- Attachment #2: scribus update - take 2 --]
[-- Type: text/x-diff, Size: 28127 bytes --]

From 6fdd0727a064cd041d3581eed0f8d2a30d1f8bfe Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
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                           |  56 ++-
 4 files changed, 667 insertions(+), 12 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 =						\
   %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/import/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 <poppler/PageTransition.h>
+ #include <poppler/ViewerPreferences.h>
+ #include <poppler/poppler-config.h>
++#include <poppler/cpp/poppler-version.h>
+ #include <poppler/SplashOutputDev.h>
+ #include <poppler/splash/SplashBitmap.h>
+ 
+@@ -59,6 +60,12 @@ for which a new license (GPL+exception) is in place.
+ #include "ui/multiprogressdialog.h"
+ #include "ui/propertiespalette.h"
+ 
++#define POPPLER_VERSION_ENCODE(major, minor, micro) (	\
++	  ((major) * 10000)				\
++	+ ((minor) *   100)				\
++	+ ((micro) *     1))
++#define POPPLER_ENCODED_VERSION POPPLER_VERSION_ENCODE(POPPLER_VERSION_MAJOR, POPPLER_VERSION_MINOR, POPPLER_VERSION_MICRO)
++
+ PdfPlug::PdfPlug(ScribusDoc* doc, int flags)
+ {
+ 	tmpSele = new Selection(this, false);
+@@ -507,12 +514,20 @@ bool PdfPlug::convert(const QString& fn)
+ 							{
+ 								for (int i = 0; i < order->getLength (); ++i)
+ 								{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++									Object orderItem = order->get(i);
++#else
+ 									Object orderItem;
+ 									order->get(i, &orderItem);
++#endif
+ 									if (orderItem.isDict())
+ 									{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++										Object ref = order->getNF(i);		
++#else
+ 										Object ref;
+ 										order->getNF(i, &ref);
++#endif
+ 										if (ref.isRef())
+ 										{
+ 											OptionalContentGroup *oc = ocg->findOcgByRef(ref.getRef());
+@@ -523,7 +538,9 @@ bool PdfPlug::convert(const QString& fn)
+ 												ocgNames.append(ocgName);
+ 											}
+ 										}
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 58, 0)
+ 										ref.free();
++#endif
+ 									}
+ 									else
+ 									{
+@@ -597,39 +614,71 @@ bool PdfPlug::convert(const QString& fn)
+ 							dev->layersSetByOCG = true;
+ 						}
+ #endif
++
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++						Object info = pdfDoc->getDocInfo();
++						if (info.isDict())
++						{
++							Object obj;
++							Dict *infoDict = info.getDict();
++							obj = infoDict->lookup((char*) "Title");
++							if (obj.isString())
++							{
++								m_Doc->documentInfo().setTitle(UnicodeParsedString(obj.getString()));
++							}
++							obj = infoDict->lookup((char*) "Author");
++							if (obj.isString())
++							{
++								m_Doc->documentInfo().setAuthor(UnicodeParsedString(obj.getString()));
++							}
++							obj = infoDict->lookup((char*) "Subject");
++							if (obj.isString())
++							{
++								m_Doc->documentInfo().setSubject(UnicodeParsedString(obj.getString()));
++							}
++							obj = infoDict->lookup((char*) "Keywords");
++							if (obj.isString())
++							{
++								//		s1 = obj.getString();
++								m_Doc->documentInfo().setKeywords(UnicodeParsedString(obj.getString()));
++							}
++						}
++						info = Object();
++#else
+ 						Object info;
+ 						pdfDoc->getDocInfo(&info);
+ 						if (info.isDict())
+ 						{
+ 							Object obj;
+-						//	GooString *s1;
++							//	GooString *s1;
+ 							Dict *infoDict = info.getDict();
+-							if (infoDict->lookup((char*)"Title", &obj )->isString())
++							if (infoDict->lookup((char*)"Title", &obj)->isString())
+ 							{
+-						//		s1 = obj.getString();
++								//		s1 = obj.getString();
+ 								m_Doc->documentInfo().setTitle(UnicodeParsedString(obj.getString()));
+ 								obj.free();
+ 							}
+-							if (infoDict->lookup((char*)"Author", &obj )->isString())
++							if (infoDict->lookup((char*)"Author", &obj)->isString())
+ 							{
+-						//		s1 = obj.getString();
++								//		s1 = obj.getString();
+ 								m_Doc->documentInfo().setAuthor(UnicodeParsedString(obj.getString()));
+ 								obj.free();
+ 							}
+-							if (infoDict->lookup((char*)"Subject", &obj )->isString())
++							if (infoDict->lookup((char*)"Subject", &obj)->isString())
+ 							{
+-						//		s1 = obj.getString();
++								//		s1 = obj.getString();
+ 								m_Doc->documentInfo().setSubject(UnicodeParsedString(obj.getString()));
+ 								obj.free();
+ 							}
+-							if (infoDict->lookup((char*)"Keywords", &obj )->isString())
++							if (infoDict->lookup((char*)"Keywords", &obj)->isString())
+ 							{
+-						//		s1 = obj.getString();
++								//		s1 = obj.getString();
+ 								m_Doc->documentInfo().setKeywords(UnicodeParsedString(obj.getString()));
+ 								obj.free();
+ 							}
+ 						}
+ 						info.free();
++#endif
+ 						if (cropped)
+ 						{
+ 							QRectF crBox = getCBox(contentRect, pageNs[0]);
+@@ -746,8 +795,13 @@ bool PdfPlug::convert(const QString& fn)
+ 									pdfDoc->displayPage(dev, pp, hDPI, vDPI, rotate, useMediaBox, crop, printing, NULL, NULL, dev->annotations_callback, dev);
+ 							}
+ 							PDFPresentationData ef;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++							Object trans = pdfDoc->getPage(pp)->getTrans();
++							Object *transi = &trans;
++#else
+ 							Object trans;
+ 							Object *transi = pdfDoc->getPage(pp)->getTrans(&trans);
++#endif
+ 							if (transi->isDict())
+ 							{
+ 								m_Doc->pdfOptions().PresentMode = true;
+@@ -793,32 +847,51 @@ bool PdfPlug::convert(const QString& fn)
+ 								delete pgTrans;
+ 							}
+ 							m_Doc->currentPage()->PresentVals = ef;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 58, 0)
+ 							trans.free();
+ 							transi->free();
++#endif
+ 						}
+ 						int numjs = pdfDoc->getCatalog()->numJS();
+ 						if (numjs > 0)
+ 						{
+ 							NameTree *jsNameTreeP = new NameTree();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++							Object catDict = pdfDoc->getXRef()->getCatalog();
++#else
+ 							Object catDict;
+ 							pdfDoc->getXRef()->getCatalog(&catDict);
++#endif
+ 							if (catDict.isDict())
+ 							{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++								Object names = catDict.dictLookup("Names");
++#else
+ 								Object names;
+ 								catDict.dictLookup("Names", &names);
++#endif
+ 								if (names.isDict())
+ 								{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++									Object obj = names.dictLookup("JavaScript");
++									jsNameTreeP->init(pdfDoc->getXRef(), &obj);
++#else
+ 									Object obj;
+ 									names.dictLookup("JavaScript", &obj);
+ 									jsNameTreeP->init(pdfDoc->getXRef(), &obj);
+ 									obj.free();
++#endif
+ 								}
+ 								for (int a = 0; a < numjs; a++)
+ 								{
+ 									m_Doc->JavaScripts.insert(UnicodeParsedString(jsNameTreeP->getName(a)), UnicodeParsedString(pdfDoc->getCatalog()->getJS(a)));
+ 								}
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++								names = catDict.dictLookup("OpenAction");
++#else
+ 								names.free();
+ 								catDict.dictLookup("OpenAction", &names);
++#endif
+ 								if (names.isDict())
+ 								{
+ 									LinkAction *linkAction = NULL;
+@@ -839,9 +912,13 @@ bool PdfPlug::convert(const QString& fn)
+ 										}
+ 									}
+ 								}
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 58, 0)
+ 								names.free();
++#endif
+ 							}
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 58, 0)
+ 							catDict.free();
++#endif
+ 							delete jsNameTreeP;
+ 						}
+ 						m_Doc->pdfOptions().Version = (PDFOptions::PDFVersion)qMin(15, qMax(13, pdfDoc->getPDFMajorVersion() * 10 + pdfDoc->getPDFMinorVersion()));
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/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.
+ */
+ 
+ #include "slaoutput.h"
++#include <poppler/cpp/poppler-version.h>
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -19,11 +20,49 @@ for which a new license (GPL+exception) is in place.
+ #include "util_math.h"
+ #include <tiffio.h>
+ 
++#define POPPLER_VERSION_ENCODE(major, minor, micro) (	\
++	  ((major) * 10000)				\
++	+ ((minor) *   100)				\
++	+ ((micro) *     1))
++#define POPPLER_ENCODED_VERSION POPPLER_VERSION_ENCODE(POPPLER_VERSION_MAJOR, POPPLER_VERSION_MINOR, POPPLER_VERSION_MICRO)
++
+ LinkSubmitForm::LinkSubmitForm(Object *actionObj)
+ {
+ 	Object obj1, obj2, obj3;
+ 	fileName = NULL;
+ 	m_flags = 0;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++	if (actionObj->isDict())
++	{
++		obj1 = actionObj->dictLookup("F");
++		if (!obj1.isNull())
++		{
++			if (obj1.isDict())
++			{
++				obj3 = obj1.dictLookup("FS");
++				if (!obj3.isNull())
++				{
++					if (obj3.isName())
++					{
++						char *name = obj3.getName();
++						if (!strcmp(name, "URL"))
++						{
++							obj2 = obj1.dictLookup("F");
++							if (!obj2.isNull())
++								fileName = obj2.getString()->copy();
++						}
++					}
++				}
++			}
++		}
++		obj1 = actionObj->dictLookup("Flags");
++		if (!obj1.isNull())
++		{
++			if (obj1.isNum())
++				m_flags = obj1.getInt();
++		}
++	}
++#else
+ 	if (actionObj->isDict())
+ 	{
+ 		if (!actionObj->dictLookup("F", &obj1)->isNull())
+@@ -54,6 +93,7 @@ LinkSubmitForm::LinkSubmitForm(Object *actionObj)
+ 		}
+ 		obj1.free();
+ 	}
++#endif
+ }
+ 
+ LinkSubmitForm::~LinkSubmitForm()
+@@ -66,11 +106,25 @@ LinkImportData::LinkImportData(Object *actionObj)
+ {
+ 	Object obj1, obj3;
+ 	fileName = NULL;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++	if (actionObj->isDict())
++	{
++		obj1 = actionObj->dictLookup("F");
++		if (!obj1.isNull())
++		{
++			obj3 = getFileSpecNameForPlatform(&obj1);
++			if (!obj3.isNull())
++			{
++				fileName = obj3.getString()->copy();
++			}
++		}
++	}
++#else
+ 	if (actionObj->isDict())
+ 	{
+ 		if (!actionObj->dictLookup("F", &obj1)->isNull())
+ 		{
+-			if (getFileSpecNameForPlatform (&obj1, &obj3))
++			if (getFileSpecNameForPlatform(&obj1, &obj3))
+ 			{
+ 				fileName = obj3.getString()->copy();
+ 				obj3.free();
+@@ -78,6 +132,7 @@ LinkImportData::LinkImportData(Object *actionObj)
+ 		}
+ 		obj1.free();
+ 	}
++#endif
+ }
+ 
+ LinkImportData::~LinkImportData()
+@@ -256,6 +311,27 @@ LinkAction* SlaOutputDev::SC_getAction(AnnotWidget *ano)
+ 	Object obj;
+ 	Ref refa = ano->getRef();
+ 	Object additionalActions;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++	obj = xref->fetch(refa.num, refa.gen);
++	if (obj.isDict())
++	{
++		Dict* adic = obj.getDict();
++		additionalActions = adic->lookupNF("A");
++		Object additionalActionsObject = additionalActions.fetch(pdfDoc->getXRef());
++		if (additionalActionsObject.isDict())
++		{
++			Object actionObject = additionalActionsObject.dictLookup("S");
++			if (actionObject.isName("ImportData"))
++			{
++				linkAction = new LinkImportData(&additionalActionsObject);
++			}
++			else if (actionObject.isName("SubmitForm"))
++			{
++				linkAction = new LinkSubmitForm(&additionalActionsObject);
++			}
++		}
++	}
++#else
+ 	Object *act = xref->fetch(refa.num, refa.gen, &obj);
+ 	if (act)
+ 	{
+@@ -283,6 +359,7 @@ LinkAction* SlaOutputDev::SC_getAction(AnnotWidget *ano)
+ 		}
+ 	}
+ 	obj.free();
++#endif
+ 	return linkAction;
+ }
+ 
+@@ -293,6 +370,22 @@ LinkAction* SlaOutputDev::SC_getAdditionalAction(const char *key, AnnotWidget *a
+ 	Object obj;
+ 	Ref refa = ano->getRef();
+ 	Object additionalActions;
++
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++	obj = xref->fetch(refa.num, refa.gen);
++	if (obj.isDict())
++	{
++		Dict* adic = obj.getDict();
++		additionalActions = adic->lookupNF("AA");
++		Object additionalActionsObject = additionalActions.fetch(pdfDoc->getXRef());
++		if (additionalActionsObject.isDict())
++		{
++			Object actionObject = additionalActionsObject.dictLookup(key);
++			if (actionObject.isDict())
++				linkAction = LinkAction::parseAction(&actionObject, pdfDoc->getCatalog()->getBaseURI());
++		}
++	}
++#else
+ 	Object *act = xref->fetch(refa.num, refa.gen, &obj);
+ 	if (act)
+ 	{
+@@ -313,6 +406,7 @@ LinkAction* SlaOutputDev::SC_getAdditionalAction(const char *key, AnnotWidget *a
+ 		}
+ 	}
+ 	obj.free();
++#endif
+ 	return linkAction;
+ }
+ 
+@@ -838,6 +932,33 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ 	{
+ 		Object obj1;
+ 		Ref refa = annota->getRef();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++		obj1 = xref->fetch(refa.num, refa.gen);
++		if (obj1.isDict())
++		{
++			Dict* dict = obj1.getDict();
++			Object obj2 = dict->lookup("Kids");
++			//childs
++			if (obj2.isArray())
++			{
++				// Load children
++				QList<int> radList;
++				for (int i = 0; i < obj2.arrayGetLength(); i++)
++				{
++					Object childRef = obj2.arrayGetNF(i);
++					if (!childRef.isRef())
++						continue;
++					Object childObj = obj2.arrayGet(i);
++					if (!childObj.isDict())
++						continue;
++					const Ref ref = childRef.getRef();
++					radList.append(ref.num);
++				}
++				QString tmTxt = UnicodeParsedString(annota->getName());
++				m_radioMap.insert(tmTxt, radList);
++			}
++		}
++#else
+ 		Object *act = xref->fetch(refa.num, refa.gen, &obj1);
+ 		if (act && act->isDict())
+ 		{
+@@ -873,6 +994,7 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ 			obj2.free();
+ 		}
+ 		obj1.free();
++#endif
+ 	}
+ 	return retVal;
+ }
+@@ -3007,6 +3129,23 @@ void SlaOutputDev::beginMarkedContent(char *name, Object *dictRef)
+ 		}
+ 		else
+ 		{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++			dictObj = dictRef->fetch(xref);
++			if (!dictObj.isDict())
++				return;
++			dict = dictObj.getDict();
++			dictType = dict->lookup("Type");
++			if (dictType.isName("OCG"))
++			{
++				oc = contentConfig->findOcgByRef(dictRef->getRef());
++				if (oc)
++				{
++					//					qDebug() << "Begin OCG Content with Name " << UnicodeParsedString(oc->getName());
++					m_doc->setActiveLayer(UnicodeParsedString(oc->getName()));
++					mSte.ocgName = UnicodeParsedString(oc->getName());
++				}
++			}
++#else
+ 			dictRef->fetch(xref, &dictObj);
+ 			if (!dictObj.isDict())
+ 			{
+@@ -3027,6 +3166,7 @@ void SlaOutputDev::beginMarkedContent(char *name, Object *dictRef)
+ 			}
+ 			dictType.free();
+ 			dictObj.free();
++#endif
+ 		}
+ 	}
+ 	m_mcStack.push(mSte);
+@@ -3046,14 +3186,20 @@ void SlaOutputDev::beginMarkedContent(char *name, Dict *properties)
+ 		{
+ 			if (layersSetByOCG)
+ 				return;
+-			Object obj;
+ 			QString lName = QString("Layer_%1").arg(layerNum + 1);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++			Object obj = properties->lookup((char*) "Title");
++			if (obj.isString())
++				lName = QString(obj.getString()->getCString());
++#else
++			Object obj;
+ 			if (properties->lookup((char*)"Title", &obj))
+ 			{
+ 				if (obj.isString())
+ 					lName =  QString(obj.getString()->getCString());
+ 				obj.free();
+ 			}
++#endif
+ 			for (ScLayers::iterator it = m_doc->Layers.begin(); it != m_doc->Layers.end(); ++it)
+ 			{
+ 				if (it->Name == lName)
+@@ -3066,6 +3212,29 @@ void SlaOutputDev::beginMarkedContent(char *name, Dict *properties)
+ 			if (!firstLayer)
+ 				currentLayer = m_doc->addLayer(lName, true);
+ 			firstLayer = false;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
++			obj = properties->lookup((char*) "Visible");
++			if (obj.isBool())
++				m_doc->setLayerVisible(currentLayer, obj.getBool());
++			obj = properties->lookup((char*) "Editable");
++			if (obj.isBool())
++				m_doc->setLayerLocked(currentLayer, !obj.getBool());
++			obj = properties->lookup((char*) "Printed");
++			if (obj.isBool())
++				m_doc->setLayerPrintable(currentLayer, obj.getBool());
++			obj = properties->lookup((char*)"Color");
++			if (obj.isArray())
++			{
++				Object obj1;
++				obj1 = obj.arrayGet(0);
++				int r = obj1.getNum() / 256;
++				obj1 = obj.arrayGet(1);
++				int g = obj1.getNum() / 256;
++				obj1 = obj.arrayGet(2);
++				int b = obj1.getNum() / 256;
++				m_doc->setLayerMarker(currentLayer, QColor(r, g, b));
++			}
++#else
+ 			if (properties->lookup((char*)"Visible", &obj))
+ 			{
+ 				if (obj.isBool())
+@@ -3102,6 +3271,7 @@ void SlaOutputDev::beginMarkedContent(char *name, Dict *properties)
+ 				}
+ 				obj.free();
+ 			}
++#endif
+ 		}
+ 	}
+ }
+-- 
+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 libmspub-dev
+-      libcdr-dev libvisio-dev libharfbuzz-dev libharfbuzz-icu0
++      libopenscenegraph-dev libpoppler-dev libpoppler-cpp-dev libcairo2-dev libwpg-dev 
++      libmspub-dev libcdr-dev libvisio-dev libharfbuzz-dev libharfbuzz-icu0
+       coreutils binutils python-tk;
+     fi
+ # OSX
+diff --git a/cmake/modules/FindPOPPLER.cmake b/cmake/modules/FindPOPPLER.cmake
+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 _libPopplerLinkFlags _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>=0.19.0 poppler>=0.19.0)
+- endif (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.5)
++	if (POPPLER_FOUND)
++		pkg_search_module(POPPLER_CPP REQUIRED libpoppler-cpp>=0.19.0 poppler-cpp>=0.19.0)
++	endif(POPPLER_FOUND)
++endif (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.5)
++ 
+ find_path(POPPLER_INCLUDE_DIR 
+   NAMES poppler-config.h
+   PATHS ${PKG_POPPLER_INCLUDE_DIRS} ${POPPLER_INCLUDE_DIRS} /usr/local/include /usr/include
+@@ -14,16 +18,31 @@ find_path(POPPLER_INCLUDE_DIR
+   NO_DEFAULT_PATH
+ )
+ 
++find_path(POPPLER_CPP_INCLUDE_DIR 
++  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/local/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_DIR} )
++  endif (POPPLER_INCLUDE_DIR AND POPPLER_CPP_INCLUDE_DIR)
+ endif (POPPLER_LIBRARY)
+diff --git a/scribus/plugins/import/pdf/CMakeLists.txt b/scribus/plugins/import/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}
+ )
+ 
+-
+ set(IMPORTPDF_PLUGIN_UI_SRC
+ 	pdfimportoptions.ui
+ )
+-- 
+2.14.2
+
diff --git a/gnu/packages/scribus.scm b/gnu/packages/scribus.scm
index d48051ee3..3c5232ec3 100644
--- a/gnu/packages/scribus.scm
+++ b/gnu/packages/scribus.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2017 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -24,53 +25,84 @@
   #: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))
 
 (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-devel/"
                                   version "/scribus-" version ".tar.xz"))
               (sha256
                (base32
-                "1xbl7h4x32y2nfhn57ivjziyvlnwadcbizqwfqx5srfsmqiyqppc"))))
+                "0kyp45vidxa3v35ic9592db4zk3m8al26vck38q5v7z14x3hp8vk"))
+              (patches
+               ;; These patches are necessary to build package with Poppler >=
+               ;; 0.58.  They are extracted from trunk and will be included in
+               ;; Scribus 1.5.4.
+               (search-patches "scribus-fix-poppler-0.58-breakage.patch"
+                               "scribus-fix-poppler-packaging.patch"))
+              (modules '((guix build utils)))
+              (snippet
+               ;; Fix typo.  Patch included in trunk.  See
+               ;; <https://bugs.scribus.net/view.php?id=14850>.
+               '(substitute* "cmake/modules/FindLIBPODOFO.cmake"
+                  (("find_package\\(OPENSSL\\)") "find_package(OpenSSL)")))))
     (build-system cmake-build-system)
     (arguments
-     `(#:tests? #f ; no test target
+     `(#:tests? #f                      ;no test target
        #:configure-flags
-       '("-DCMAKE_CXX_FLAGS=-std=gnu++11")))
+       '("-DWANT_GRAPHICSMAGICK=1")))
     (inputs
-     `(("cairo" ,cairo)
+     `(("boost" ,boost)
+       ("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")
+     `(("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 used
-- 
2.14.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#28954] [PATCH] Update Scribus to 1.5.3.  Re-vamp package.
  2017-10-24 15:34   ` Nicolas Goaziou
@ 2017-10-25 23:23     ` Eric Bavier
  2017-10-26  5:15       ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Bavier @ 2017-10-25 23:23 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: 28954

[-- Attachment #1: Type: text/plain, Size: 1145 bytes --]

Hello Nicolas,

Thanks for the quick fixes.


On Tue, 24 Oct 2017 17:34:18 +0200
Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:

> Hello,
> 
> Eric Bavier <ericbavier@centurylink.net> writes:
> 
> > Could you include a url where these patches came from in the patches
> > themselves?  You mention in the package definition that they came from
> > upstream's trunk.
> >
> > Or, for large patches, some have experimented with using an origin that
> > fetches the patch from upstream rather than pulling the patch into
> > Guix.  
> 
> I cloned project's git mirror and picked two specific commits. There is
> no proper URL that I know of.
> 
> You can see them at
> 
>   https://www.scribus.net/websvn/listing.php?repname=Scribus&peg=22197&rev=22154
> 
> and
> 
>   https://www.scribus.net/websvn/listing.php?repname=Scribus&peg=22197&rev=22155
> 
> although not as patch files.

The scribus team has a "mirror" on github that tracks the svn
repository.  I was able to find the patches there.  What do you think
of this version of your patch?

'guix lint scribus' complains about the patch file names, but that
should probably get a bug.

`~Eric

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-scribus-Update-to-1.5.3.-Add-inputs.patch --]
[-- Type: text/x-patch, Size: 5591 bytes --]

From a69f37e8dc715cc3fd6008ffc360dc8a3f84e3c9 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Date: Mon, 23 Oct 2017 12:25:13 +0200
Subject: [PATCH] gnu: scribus: Update to 1.5.3.  Add inputs.

* gnu/packages/scribus.scm (scribus): Update to 1.5.3.
[input]: Add fontconfig, harfbuzz, hunspell, icu4c, libcdr, libfreehand,
libmspub, librevenge, libvisio, openssl, podofo, poppler, and boost.  Move
qttools to ...
[native-input]: ... here.
[home-page]: Fix URL.

Co-authored-by: Eric Bavier <bavier@member.fsf.org>
---
 gnu/packages/scribus.scm | 79 +++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 61 insertions(+), 18 deletions(-)

diff --git a/gnu/packages/scribus.scm b/gnu/packages/scribus.scm
index d48051ee3..6230195ed 100644
--- a/gnu/packages/scribus.scm
+++ b/gnu/packages/scribus.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2017 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -24,53 +25,95 @@
   #: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))
 
 (define-public scribus
   (package
     (name "scribus")
-    (version "1.5.2")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append "mirror://sourceforge/scribus/scribus-devel/"
-                                  version "/scribus-" version ".tar.xz"))
-              (sha256
-               (base32
-                "1xbl7h4x32y2nfhn57ivjziyvlnwadcbizqwfqx5srfsmqiyqppc"))))
+    (version "1.5.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://sourceforge/scribus/scribus-devel/"
+                           version "/scribus-" version ".tar.xz"))
+       (sha256
+        (base32
+         "0kyp45vidxa3v35ic9592db4zk3m8al26vck38q5v7z14x3hp8vk"))
+       (patches
+        (list
+         (origin
+           (method url-fetch)
+           (uri (string-append "https://github.com/scribusproject/scribus/commit/"
+                               "61186c7ef083046b7e0c908952e8a773e2787d82.patch"))
+           (file-name "scribus-fix-poppler-0.58-breakage.patch")
+           (sha256
+            (base32 "189qw9xmgz01xz1w1bi9lzrp399zk1j1iz5qdhchdrhgnd69b7ly")))
+         (origin
+           (method url-fetch)
+           (uri (string-append "https://github.com/scribusproject/scribus/commit/"
+                               "d82b1c989bd0e79b5611521f671adbfb94996e5e.patch"))
+           (file-name "scribus-fix-poppler-packaging.patch")
+           (sha256
+            (base32 "1p9s18jjvj2h0ba1xvk1zhmnn4f4n3ykrgb56mjd6in30h0vrykx")))))
+       (modules '((guix build utils)))
+       (snippet
+        ;; Fix typo.  Equivalent to patch at
+        ;; https://bugs.scribus.net/view.php?id=14850
+        '(substitute* "cmake/modules/FindLIBPODOFO.cmake"
+           (("find_package\\(OPENSSL\\)") "find_package(OpenSSL)")))))
     (build-system cmake-build-system)
     (arguments
-     `(#:tests? #f ; no test target
+     `(#:tests? #f                      ;no test target
        #:configure-flags
-       '("-DCMAKE_CXX_FLAGS=-std=gnu++11")))
+       '("-DWANT_GRAPHICSMAGICK=1")))
     (inputs
-     `(("cairo" ,cairo)
+     `(("boost" ,boost)
+       ("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")
+     `(("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 used
-- 
2.14.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#28954] [PATCH] Update Scribus to 1.5.3.  Re-vamp package.
  2017-10-25 23:23     ` Eric Bavier
@ 2017-10-26  5:15       ` Nicolas Goaziou
  2017-10-29  8:14         ` bug#28954: " Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2017-10-26  5:15 UTC (permalink / raw)
  To: Eric Bavier; +Cc: 28954

Hello,

Eric Bavier <ericbavier@centurylink.net> writes:

> The scribus team has a "mirror" on github that tracks the svn
> repository.

That's the repository I cloned to generate the patches.

> I was able to find the patches there. What do you think of this
> version of your patch?

I didn't know you could generate a patch that way. That is better,
indeed!

Thank you.

Regards,

-- 
Nicolas Goaziou                                                0x80A93738

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#28954: [PATCH] Update Scribus to 1.5.3.  Re-vamp package.
  2017-10-26  5:15       ` Nicolas Goaziou
@ 2017-10-29  8:14         ` Nicolas Goaziou
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Goaziou @ 2017-10-29  8:14 UTC (permalink / raw)
  To: Eric Bavier; +Cc: 28954-done

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Eric Bavier <ericbavier@centurylink.net> writes:
>
>> I was able to find the patches there. What do you think of this
>> version of your patch?
>
> I didn't know you could generate a patch that way. That is better,
> indeed!

Since there was no more comment, I pushed the commit into master.

Thank you again for the help.

Regards,

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-10-29  8:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-23 10:46 [bug#28954] [PATCH] Update Scribus to 1.5.3. Re-vamp package Nicolas Goaziou
2017-10-24  8:34 ` Eric Bavier
2017-10-24 15:34   ` Nicolas Goaziou
2017-10-25 23:23     ` Eric Bavier
2017-10-26  5:15       ` Nicolas Goaziou
2017-10-29  8:14         ` bug#28954: " Nicolas Goaziou

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.