From b4d60cafda649162e4c246984d2b1542e5931431 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Mon, 7 May 2018 22:49:45 +1000 Subject: [PATCH] Scribus: add recipe for 1.5.2 version. * don't bump this version! i'ts last worked version for now! --- .../scribus/additional-files/scribus.rdef.in | 61 + .../scribus/patches/scribus-1.5.2.patchset | 1018 +++++++++++++++++ ...ibus-1.5.3.recipe => scribus-1.5.2.recipe} | 52 +- 3 files changed, 1110 insertions(+), 21 deletions(-) create mode 100644 app-office/scribus/additional-files/scribus.rdef.in create mode 100644 app-office/scribus/patches/scribus-1.5.2.patchset rename app-office/scribus/{scribus-1.5.3.recipe => scribus-1.5.2.recipe} (75%) diff --git a/app-office/scribus/additional-files/scribus.rdef.in b/app-office/scribus/additional-files/scribus.rdef.in new file mode 100644 index 000000000..b2f5dbf65 --- /dev/null +++ b/app-office/scribus/additional-files/scribus.rdef.in @@ -0,0 +1,61 @@ + +resource app_flags B_MULTIPLE_LAUNCH; + +resource app_version { + major = @MAJOR@, + middle = @MIDDLE@, + minor = @MINOR@, + + variety = B_APPV_FINAL, + internal = 0, + + short_info = "Scribus", + long_info = "@LONG_INFO@" +}; + +resource app_signature "@APP_SIGNATURE@"; + +resource file_types message { + "types" = "application/x-scribus", + "types" = "application/illustrator", + "types" = "application/postscript", + "types" = "application/pdf", + "types" = "image/svg+xml", + "types" = "image/wmf", + "types" = "image/x-xfig", + "types" = "application/x-coreldraw", + "types" = "application/vnd.adobe.indesign-idml-package", + "types" = "application/vnd.ms-xpsdocument", + "types" = "application/x-mspublisher", + "types" = "application/ms-visio" +}; + +resource vector_icon { + $"6E6369660D0400660500056E02001602BBF2CEB8AE15BC922B3FC9AE491ECB40" + $"189F00A7FF7D0200160238C6EA33DEF4BABF173FF0CD4785994317EC00E2FFC1" + $"0200160235C3F9B61B943EFBAF3EAA2CC844BB49FEFF00FFFFDC02001602BD4D" + $"003B2E06BD78BCBF9A8E4AD8C24C08E500E0FFB0050002000602BC0428BD063D" + $"3D063DBC042849E11E4A0A8F00095986FF56A8EB020006023D4C66398FFFB98F" + $"FF3D4C6649A9D74A3B8F0084C5F5FFFFFFFF0366512302000602B8B3D7B77A3D" + $"377A3DB8B3D74B877A4486B80083560BFFFFF2BC03C8BA96090204BF75B389C6" + $"35B389B8B8B389B340BFBEB340B900B340C67ABF75CBEFB8B8CBEFC635CBEFCB" + $"ACBFBECBACC67BCBACB9000205C7D1B855C7D1B855C5F7B6D5C653B4A4C5F4B5" + $"40C69FB425CAB5B531C828B30CCC69B6A2CBC6B8F3CC66B861CB6DB946C7D1B8" + $"58CA9BBA33C7D1B8580204B5D3C641B24FC0FAB959CB87C5DBC949C087CCE3CB" + $"33C5AFC927B934CCADBE7DC5A3B3F0B92028BE75B295B3C8B9C80605FE02B465" + $"BC6BBD8FB453B5FDB586BEC1B683BD29BF27C003B96EBA2DC519BE0356BE0356" + $"B6A6C442B465BC6C0605EF02C74FB4DEC74FB4DEC640B755BEA7C8A7BFE8BE99" + $"C26AC244C7D5C1DDCB3EB81BC7CABB93CA57B3FDC74FB4DE0604EF53B550C74B" + $"B52AC67FB74EBF0DC7DBC0BFBE01C347C1AEC7A9C1F0CB01B853C78FBBC35AB4" + $"3E0606BF0FC3683AC328BD4FC3CEBD6CC327BE6BC357BDFCC318BE92C274BF33" + $"47BF00C15CC1B8BF40C6F6C257BEDEC175C0E2C283BE77C283BE12C242BE81C2" + $"BBBDB40605EE02CA08B69CC455C1D6C441C09CC587C05FC6D8C012CA92B715C6" + $"E2BC5DCA92B715CA08B69C02044030C34530BC3A30304030BC3A30C3454050BC" + $"3A50C34550504050C34550BC3A090A000108024180000000000000003FE000C8" + $"80004760000A070100023FD9000000000000003FE0EA3589CDB916650A070101" + $"023FB8250000000000003FC006400FF33FB8BD0A080102023FB8250000000000" + $"003FC006400FF33FB8BD0A090103023FB8250000000000003FC006400FF33FB8" + $"BD0A0A0104023FB8250000000000003FC006400FF33FB8BD0A0B0105023FB825" + $"0000000000003FC006400FF33FB8BD0A0A0106023FB8250000000000003FC006" + $"400FF33FB8BD0A0C0107023FB8250000000000003FC006400FF33FB8BD" +}; diff --git a/app-office/scribus/patches/scribus-1.5.2.patchset b/app-office/scribus/patches/scribus-1.5.2.patchset new file mode 100644 index 000000000..6aebc63b1 --- /dev/null +++ b/app-office/scribus/patches/scribus-1.5.2.patchset @@ -0,0 +1,1018 @@ +From a5a203dff83cde11754037ec038f3ff5f0c76908 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Thu, 3 May 2018 21:03:11 +1000 +Subject: Fix build for Haiku + + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 788235e..1ef8100 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -386,7 +386,7 @@ IF(WANT_CPP11) + ENDIF(WANT_CPP11) + + #PLUGINS +-IF(WIN32) ++IF(WIN32 OR HAIKU) + SET(PLUGINDIR "plugins") + ELSE(WIN32) + IF (APPLEBUNDLE) +diff --git a/scribus/third_party/pgf/PGFplatform.h b/scribus/third_party/pgf/PGFplatform.h +index 5598df2..73e5cd4 100644 +--- a/scribus/third_party/pgf/PGFplatform.h ++++ b/scribus/third_party/pgf/PGFplatform.h +@@ -338,6 +338,12 @@ inline OSError SetFPos(HANDLE hFile, int posMode, INT64 posOff) { + #define __POSIX__ + #endif // __sun + ++//------------------------------------------------------------------------------- ++// HAIKU ++//------------------------------------------------------------------------------- ++#ifdef __HAIKU__ ++#define __POSIX__ ++#endif // __sun + + //------------------------------------------------------------------------------- + // *BSD +@@ -528,7 +534,7 @@ __inline OSError FileWrite(HANDLE hFile, int *count, void *buffPtr) { + } + + __inline OSError GetFPos(HANDLE hFile, UINT64 *pos) { +- #ifdef __APPLE__ ++ #if defined(__APPLE__) || defined(__HAIKU__) + off_t ret; + if ((ret = lseek(hFile, 0, SEEK_CUR)) == -1) { + return errno; +@@ -548,7 +554,7 @@ __inline OSError GetFPos(HANDLE hFile, UINT64 *pos) { + } + + __inline OSError SetFPos(HANDLE hFile, int posMode, INT64 posOff) { +- #ifdef __APPLE__ ++ #if defined(__APPLE__) || defined(__HAIKU__) + if ((lseek(hFile, (off_t)posOff, posMode)) == -1) { + return errno; + } else { +diff --git a/scribus/ui/printdialog.cpp b/scribus/ui/printdialog.cpp +index 3fea6d0..a6238d6 100644 +--- a/scribus/ui/printdialog.cpp ++++ b/scribus/ui/printdialog.cpp +@@ -24,7 +24,7 @@ for which a new license (GPL+exception) is in place. + #if defined(_WIN32) + #include + #include +-#else ++#elif !defined(__HAIKU__) + #include + #endif + #include "util_printer.h" +diff --git a/scribus/util_debug.cpp b/scribus/util_debug.cpp +index 04d07b0..1b636c7 100644 +--- a/scribus/util_debug.cpp ++++ b/scribus/util_debug.cpp +@@ -51,7 +51,7 @@ void tDebug(QString message) + */ + void printBacktrace ( int nFrames ) + { +-#if !defined(_WIN32) && !defined(Q_OS_MAC) && !defined(Q_OS_OPENBSD) && !defined(Q_OS_FREEBSD) ++#if !defined(_WIN32) && !defined(Q_OS_MAC) && !defined(Q_OS_OPENBSD) && !defined(Q_OS_FREEBSD) && !defined(Q_OS_HAIKU) + void ** trace = new void*[nFrames + 1]; + char **messages = ( char ** ) NULL; + int i, trace_size = 0; +-- +2.16.2 + + +From f2cd2e7bc492e588f49e5c790e2bfffcfdf2e717 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Fri, 4 May 2018 21:51:22 +1000 +Subject: Add support new versions of poppler. Backport pdf import plugin from + 1.5.3 and 1.5.4 scribus. + + +diff --git a/scribus/plugins/import/pdf/CMakeLists.txt b/scribus/plugins/import/pdf/CMakeLists.txt +index d529d70..85760d9 100644 +--- a/scribus/plugins/import/pdf/CMakeLists.txt ++++ b/scribus/plugins/import/pdf/CMakeLists.txt +@@ -1,50 +1,50 @@ +-INCLUDE_DIRECTORIES( ++include_directories( + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/scribus + ${POPPLER_INCLUDE_DIR} ++ ${POPPLER_CPP_INCLUDE_DIR} + ) + +- +-SET(IMPORTPDF_PLUGIN_UI_SRC ++set(IMPORTPDF_PLUGIN_UI_SRC + pdfimportoptions.ui + ) + +-SET(IMPORTPDF_PLUGIN_MOC_CLASSES ++set(IMPORTPDF_PLUGIN_MOC_CLASSES + importpdf.h + importpdfplugin.h + pdfimportoptions.h + ) + +-SET(IMPORTPDF_PLUGIN_SOURCES ++set(IMPORTPDF_PLUGIN_SOURCES + importpdf.cpp + importpdfplugin.cpp + pdfimportoptions.cpp + slaoutput.cpp + ) + +-IF(HAVE_POPPLER) +- IF(HAVE_LCMS1) +- ADD_DEFINITIONS(-DUSE_CMS) +- ENDIF(HAVE_LCMS1) +- ADD_DEFINITIONS(-DHAVE_FREETYPE_H) +-ENDIF(HAVE_POPPLER) ++if(HAVE_POPPLER) ++ if(HAVE_LCMS1) ++ add_definitions(-DUSE_CMS) ++ endif() ++ add_definitions(-DHAVE_FREETYPE_H) ++endif() + +-SET(SCRIBUS_IMPORTPDF_PLUGIN "importpdf") ++set(SCRIBUS_IMPORTPDF_PLUGIN "importpdf") + + QT5_WRAP_UI(IMPORTPDF_PLUGIN_UI_SOURCES ${IMPORTPDF_PLUGIN_UI_SRC} ) + QT5_WRAP_CPP(IMPORTPDF_PLUGIN_MOC_SOURCES ${IMPORTPDF_PLUGIN_MOC_CLASSES}) + +-ADD_LIBRARY(${SCRIBUS_IMPORTPDF_PLUGIN} MODULE ${IMPORTPDF_PLUGIN_SOURCES} ${IMPORTPDF_PLUGIN_MOC_SOURCES} ${IMPORTPDF_PLUGIN_UI_SOURCES}) ++add_library(${SCRIBUS_IMPORTPDF_PLUGIN} MODULE ${IMPORTPDF_PLUGIN_SOURCES} ${IMPORTPDF_PLUGIN_MOC_SOURCES} ${IMPORTPDF_PLUGIN_UI_SOURCES}) + +-LINK_DIRECTORIES( /usr/local/lib ) +-TARGET_LINK_LIBRARIES(${SCRIBUS_IMPORTPDF_PLUGIN} ${PLUGIN_LIBRARIES} ${POPPLER_LIBRARY}) ++link_directories( /usr/local/lib ) ++target_link_libraries(${SCRIBUS_IMPORTPDF_PLUGIN} ${PLUGIN_LIBRARIES} ${POPPLER_LIBRARY}) + +-INSTALL(TARGETS ${SCRIBUS_IMPORTPDF_PLUGIN} ++install(TARGETS ${SCRIBUS_IMPORTPDF_PLUGIN} + LIBRARY + DESTINATION ${PLUGINDIR} + PERMISSIONS ${PLUGIN_PERMISSIONS} + ) + +-ADD_DEPENDENCIES(${SCRIBUS_IMPORTPDF_PLUGIN} ${EXE_NAME}) ++add_dependencies(${SCRIBUS_IMPORTPDF_PLUGIN} ${EXE_NAME}) + +-# SET_TARGET_PROPERTIES(${SCRIBUS_FONTPREVIEW_PLUGIN} PROPERTIES VERSION "0.0.0") ++# set_target_properties(${SCRIBUS_FONTPREVIEW_PLUGIN} PROPERTIES VERSION "0.0.0") +diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp +index 05e46ae..c180286 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 + #include + #include ++#include + #include + #include + +@@ -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); +@@ -75,7 +82,11 @@ QImage PdfPlug::readThumbnail(QString fName) + globalParams = new GlobalParams(); + if (globalParams) + { ++#if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 62, 0) ++ GooString *fname = new GooString(pdfFile.toUtf8().data()); ++#else + GooString *fname = new GooString(QFile::encodeName(pdfFile).data()); ++#endif + globalParams->setErrQuiet(gTrue); + PDFDoc *pdfDoc = new PDFDoc(fname, NULL, NULL, NULL); + if (pdfDoc) +@@ -145,7 +156,7 @@ QImage PdfPlug::readThumbnail(QString fName) + /* Old Code to be backed up + QString tmp, cmd1, cmd2; + QString pdfFile = QDir::toNativeSeparators(fName); +- QString tmpFile = QDir::toNativeSeparators(ScPaths::getTempFileDir() + "sc.png"); ++ QString tmpFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + "sc.png"); + int ret = -1; + tmp.setNum(1); + QStringList args; +@@ -190,7 +201,7 @@ bool PdfPlug::import(QString fNameIn, const TransactionSettings& trSettings, int + baseFile = QDir::cleanPath(QDir::toNativeSeparators(fi.absolutePath()+"/")); + if ( showProgress ) + { +- ScribusMainWindow* mw=(m_Doc==0) ? ScCore->primaryMainWindow() : m_Doc->scMW(); ++ ScribusMainWindow* mw = (m_Doc==0) ? ScCore->primaryMainWindow() : m_Doc->scMW(); + progressDialog = new MultiProgressDialog( tr("Importing: %1").arg(fi.fileName()), CommonStrings::tr_Cancel, mw ); + QStringList barNames, barTexts; + barNames << "GI"; +@@ -370,7 +381,7 @@ PdfPlug::~PdfPlug() + delete tmpSele; + } + +-bool PdfPlug::convert(QString fn) ++bool PdfPlug::convert(const QString& fn) + { + bool firstPg = true; + int currentLayer = m_Doc->activeLayer(); +@@ -394,7 +405,11 @@ bool PdfPlug::convert(QString fn) + GooString *userPW = NULL; + if (globalParams) + { ++#if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 62, 0) ++ GooString *fname = new GooString(fn.toUtf8().data()); ++#else + GooString *fname = new GooString(QFile::encodeName(fn).data()); ++#endif + globalParams->setErrQuiet(gTrue); + GBool hasOcg = gFalse; + QList ocgGroups; +@@ -409,12 +424,16 @@ bool PdfPlug::convert(QString fn) + if (progressDialog) + progressDialog->hide(); + qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor)); +- ScribusMainWindow* mw = (m_Doc==0) ? ScCore->primaryMainWindow() : m_Doc->scMW(); ++ ScribusMainWindow* mw = m_Doc->scMW(); + bool ok; + QString text = QInputDialog::getText(mw, tr("Open PDF-File"), tr("Password"), QLineEdit::Normal, "", &ok); + if (ok && !text.isEmpty()) + { ++#if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 62, 0) ++ fname = new GooString(fn.toUtf8().data()); ++#else + fname = new GooString(QFile::encodeName(fn).data()); ++#endif + userPW = new GooString(text.toLocal8Bit().data()); + pdfDoc = new PDFDoc(fname, userPW, userPW, NULL); + qApp->changeOverrideCursor(QCursor(Qt::WaitCursor)); +@@ -507,12 +526,20 @@ bool PdfPlug::convert(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 +550,9 @@ bool PdfPlug::convert(QString fn) + ocgNames.append(ocgName); + } + } ++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 58, 0) + ref.free(); ++#endif + } + else + { +@@ -597,39 +626,71 @@ bool PdfPlug::convert(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]); +@@ -667,6 +728,7 @@ bool PdfPlug::convert(QString fn) + firstPg = false; + else + m_Doc->addPage(ap); ++ QRectF mdBox = getCBox(0, pp); + QRectF crBox = getCBox(contentRect, pp); + if (cropped) + { +@@ -725,7 +787,7 @@ bool PdfPlug::convert(QString fn) + // currentLayer = m_Doc->activeLayer(); + oc->setState(OptionalContentGroup::On); + if (cropped) +- pdfDoc->displayPageSlice(dev, pp, hDPI, vDPI, rotate, useMediaBox, crop, printing, crBox.x(), mediaRect.bottom() - crBox.bottom(), crBox.width(), crBox.height(), NULL, NULL, dev->annotations_callback, dev); ++ pdfDoc->displayPageSlice(dev, pp, hDPI, vDPI, rotate, useMediaBox, crop, printing, crBox.x() - mdBox.x(), mdBox.bottom() - crBox.bottom(), crBox.width(), crBox.height(), NULL, NULL, dev->annotations_callback, dev); + else + pdfDoc->displayPage(dev, pp, hDPI, vDPI, rotate, useMediaBox, crop, printing, NULL, NULL, dev->annotations_callback, dev); + oc->setState(OptionalContentGroup::Off); +@@ -740,13 +802,18 @@ bool PdfPlug::convert(QString fn) + else + { + if (cropped) +- pdfDoc->displayPageSlice(dev, pp, hDPI, vDPI, rotate, useMediaBox, crop, printing, crBox.x(), mediaRect.bottom() - crBox.bottom(), crBox.width(), crBox.height(), NULL, NULL, dev->annotations_callback, dev); ++ pdfDoc->displayPageSlice(dev, pp, hDPI, vDPI, rotate, useMediaBox, crop, printing, crBox.x() - mdBox.x(), mdBox.bottom() - crBox.bottom(), crBox.width(), crBox.height(), NULL, NULL, dev->annotations_callback, dev); + else + 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; +@@ -792,32 +859,51 @@ bool PdfPlug::convert(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; +@@ -838,9 +924,13 @@ bool PdfPlug::convert(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())); +@@ -918,6 +1008,7 @@ QImage PdfPlug::readPreview(int pgNum, int width, int height, int box) + { + if (!m_pdfDoc) + return QImage(); ++ + double h = m_pdfDoc->getPageMediaHeight(pgNum); + double w = m_pdfDoc->getPageMediaWidth(pgNum); + double scale = qMin(height / h, width / w); +@@ -958,6 +1049,8 @@ QImage PdfPlug::readPreview(int pgNum, int width, int height, int box) + if (box > Media_Box) + { + QRectF cRect = getCBox(box, pgNum); ++ QRectF mediaRect = getCBox(0, pgNum); ++ cRect.moveTo(cRect.x() - mediaRect.x(), cRect.y() - mediaRect.y()); + QPainter pp; + pp.begin(&image); + pp.setBrush(Qt::NoBrush); +diff --git a/scribus/plugins/import/pdf/importpdf.h b/scribus/plugins/import/pdf/importpdf.h +index 725a5f7..c8c5efc 100644 +--- a/scribus/plugins/import/pdf/importpdf.h ++++ b/scribus/plugins/import/pdf/importpdf.h +@@ -79,7 +79,7 @@ public: + }; + + private: +- bool convert(QString fn); ++ bool convert(const QString& fn); + QRectF getCBox(int box, int pgNum); + QString UnicodeParsedString(GooString *s1); + +diff --git a/scribus/plugins/import/pdf/importpdfplugin.cpp b/scribus/plugins/import/pdf/importpdfplugin.cpp +index 5777286..ca204d4 100644 +--- a/scribus/plugins/import/pdf/importpdfplugin.cpp ++++ b/scribus/plugins/import/pdf/importpdfplugin.cpp +@@ -87,7 +87,7 @@ const ScActionPlugin::AboutData* ImportPdfPlugin::getAboutData() const + AboutData* about = new AboutData; + about->authors = "Franz Schmid "; + about->shortDescription = tr("Imports PDF Files"); +- about->description = tr("Imports most PDF files into the current document,\nconverting their vector data into Scribus objects."); ++ about->description = tr("Imports most PDF files into the current document, converting their vector data into Scribus objects."); + about->license = "GPL"; + Q_CHECK_PTR(about); + return about; +diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp +index e9cf029..df36b4c 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 + #include + #include + #include +@@ -19,11 +20,49 @@ for which a new license (GPL+exception) is in place. + #include "util_math.h" + #include + ++#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() +@@ -174,15 +229,26 @@ QString AnoOutputDev::getColor(GfxColorSpace *color_space, GfxColor *color, int + else if (color_space->getMode() == csSeparation) + { + GfxCMYK cmyk; +- color_space->getCMYK(color, &cmyk); +- int Cc = qRound(colToDbl(cmyk.c) * 255); +- int Mc = qRound(colToDbl(cmyk.m) * 255); +- int Yc = qRound(colToDbl(cmyk.y) * 255); +- int Kc = qRound(colToDbl(cmyk.k) * 255); ++ QString name = QString(((GfxSeparationColorSpace*)color_space)->getName()->getCString()); ++ int Cc, Mc, Yc, Kc; ++ bool isRegistrationColor = (name == "All"); ++ if (!isRegistrationColor) ++ { ++ color_space->getCMYK(color, &cmyk); ++ Cc = qRound(colToDbl(cmyk.c) * 255); ++ Mc = qRound(colToDbl(cmyk.m) * 255); ++ Yc = qRound(colToDbl(cmyk.y) * 255); ++ Kc = qRound(colToDbl(cmyk.k) * 255); ++ } ++ else ++ { ++ Cc = Mc = Yc = Kc = 255; ++ tmp.setRegistrationColor(true); ++ name = "Registration"; ++ } + tmp.setColor(Cc, Mc, Yc, Kc); + tmp.setSpotColor(true); +- QString nam = QString(((GfxSeparationColorSpace*)color_space)->getName()->getCString()); +- fNam = m_doc->PageColors.tryAddColor(nam, tmp); ++ fNam = m_doc->PageColors.tryAddColor(name, tmp); + *shade = qRound(colToDbl(color->c[0]) * 100); + } + else +@@ -245,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) + { +@@ -272,6 +359,7 @@ LinkAction* SlaOutputDev::SC_getAction(AnnotWidget *ano) + } + } + obj.free(); ++#endif + return linkAction; + } + +@@ -282,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) + { +@@ -302,6 +406,7 @@ LinkAction* SlaOutputDev::SC_getAdditionalAction(const char *key, AnnotWidget *a + } + } + obj.free(); ++#endif + return linkAction; + } + +@@ -509,13 +614,13 @@ bool SlaOutputDev::handleLinkAnnot(Annot* annota, double xCoor, double yCoor, do + ite->AutoName = false; + if (act->getKind() == actionGoTo) + { +- ite->annotation().setZiel(pagNum - 1); ++ ite->annotation().setZiel((pagNum > 0) ? (pagNum - 1) : (m_actPage - 1)); + ite->annotation().setAction(QString("%1 %2").arg(xco).arg(yco)); + ite->annotation().setActionType(2); + } + else if (act->getKind() == actionGoToR) + { +- ite->annotation().setZiel(pagNum - 1); ++ ite->annotation().setZiel((pagNum > 0) ? (pagNum - 1) : (m_actPage - 1)); + ite->annotation().setExtern(fileName); + ite->annotation().setAction(QString("%1 %2").arg(xco).arg(yco)); + ite->annotation().setActionType(9); +@@ -827,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 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()) + { +@@ -862,6 +994,7 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor, + obj2.free(); + } + obj1.free(); ++#endif + } + return retVal; + } +@@ -935,7 +1068,7 @@ void SlaOutputDev::handleActions(PageItem* ite, AnnotWidget *ano) + pagNum = dst->getPageNum(); + xco = dst->getLeft(); + yco = dst->getTop(); +- ite->annotation().setZiel(pagNum - 1); ++ ite->annotation().setZiel((pagNum > 0) ? (pagNum - 1) : (m_actPage - 1)); + ite->annotation().setAction(QString("%1 %2").arg(xco).arg(yco)); + ite->annotation().setActionType(2); + } +@@ -959,7 +1092,7 @@ void SlaOutputDev::handleActions(PageItem* ite, AnnotWidget *ano) + pagNum = dstn->getPageNum(); + xco = dstn->getLeft(); + yco = dstn->getTop(); +- ite->annotation().setZiel(pagNum - 1); ++ ite->annotation().setZiel((pagNum > 0) ? (pagNum - 1) : (m_actPage - 1)); + ite->annotation().setAction(QString("%1 %2").arg(xco).arg(yco)); + ite->annotation().setActionType(2); + } +@@ -982,7 +1115,7 @@ void SlaOutputDev::handleActions(PageItem* ite, AnnotWidget *ano) + pagNum = dst->getPageNum(); + xco = dst->getLeft(); + yco = dst->getTop(); +- ite->annotation().setZiel(pagNum - 1); ++ ite->annotation().setZiel((pagNum > 0) ? (pagNum - 1) : (m_actPage - 1)); + ite->annotation().setExtern(fileName); + ite->annotation().setAction(QString("%1 %2").arg(xco).arg(yco)); + ite->annotation().setActionType(9); +@@ -1001,7 +1134,7 @@ void SlaOutputDev::handleActions(PageItem* ite, AnnotWidget *ano) + pagNum = dstn->getPageNum(); + xco = dstn->getLeft(); + yco = dstn->getTop(); +- ite->annotation().setZiel(pagNum - 1); ++ ite->annotation().setZiel((pagNum > 0) ? (pagNum - 1) : (m_actPage - 1)); + ite->annotation().setExtern(fileName); + ite->annotation().setAction(QString("%1 %2").arg(xco).arg(yco)); + ite->annotation().setActionType(9); +@@ -2499,6 +2632,7 @@ void SlaOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str + mskStr->reset(); + Guchar *mdest = 0; + unsigned char * mbuffer = new unsigned char[maskWidth * maskHeight]; ++ memset(mbuffer, 0, maskWidth * maskHeight); + for (int y = 0; y < maskHeight; y++) + { + mdest = (Guchar *)(mbuffer + y * maskWidth); +@@ -2576,6 +2710,8 @@ void SlaOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str + tempFile->close(); + ite->isInlineImage = true; + ite->isTempFile = true; ++ ite->AspectRatio = false; ++ ite->ScaleType = false; + res.save(fileName, "PNG"); + m_doc->loadPict(fileName, ite); + // ite->setImageScalingMode(false, false); +@@ -2640,6 +2776,7 @@ void SlaOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, i + Guchar *mdest = 0; + int invert_bit = maskInvert ? 1 : 0; + unsigned char * mbuffer = new unsigned char[maskWidth * maskHeight]; ++ memset(mbuffer, 0, maskWidth * maskHeight); + for (int y = 0; y < maskHeight; y++) + { + mdest = (Guchar *)(mbuffer + y * maskWidth); +@@ -2723,6 +2860,8 @@ void SlaOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, i + tempFile->close(); + ite->isInlineImage = true; + ite->isTempFile = true; ++ ite->AspectRatio = false; ++ ite->ScaleType = false; + res.save(fileName, "PNG"); + m_doc->loadPict(fileName, ite); + // ite->setImageScalingMode(false, false); +@@ -2990,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()) + { +@@ -3010,6 +3166,7 @@ void SlaOutputDev::beginMarkedContent(char *name, Object *dictRef) + } + dictType.free(); + dictObj.free(); ++#endif + } + } + m_mcStack.push(mSte); +@@ -3029,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) +@@ -3049,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()) +@@ -3085,6 +3271,7 @@ void SlaOutputDev::beginMarkedContent(char *name, Dict *properties) + } + obj.free(); + } ++#endif + } + } + } +@@ -3137,12 +3324,12 @@ void SlaOutputDev::updateFont(GfxState *state) + Object refObj, strObj; + GooString *fileName; + char *tmpBuf; +- int tmpBufLen; ++ int tmpBufLen = 0; + int *codeToGID; + double *textMat; + double m11, m12, m21, m22, fontSize; + SplashCoord mat[4]; +- int n; ++ int n = 0; + int faceIndex = 0; + SplashCoord matrix[6]; + +@@ -3806,15 +3993,27 @@ QString SlaOutputDev::getColor(GfxColorSpace *color_space, GfxColor *color, int + else if (color_space->getMode() == csSeparation) + { + GfxCMYK cmyk; +- color_space->getCMYK(color, &cmyk); +- int Cc = qRound(colToDbl(cmyk.c) * 255); +- int Mc = qRound(colToDbl(cmyk.m) * 255); +- int Yc = qRound(colToDbl(cmyk.y) * 255); +- int Kc = qRound(colToDbl(cmyk.k) * 255); ++ QString name = QString(((GfxSeparationColorSpace*)color_space)->getName()->getCString()); ++ int Cc, Mc, Yc, Kc; ++ bool isRegistrationColor = (name == "All"); ++ if (!isRegistrationColor) ++ { ++ color_space->getCMYK(color, &cmyk); ++ Cc = qRound(colToDbl(cmyk.c) * 255); ++ Mc = qRound(colToDbl(cmyk.m) * 255); ++ Yc = qRound(colToDbl(cmyk.y) * 255); ++ Kc = qRound(colToDbl(cmyk.k) * 255); ++ } ++ else ++ { ++ Cc = Mc = Yc = Kc = 255; ++ tmp.setRegistrationColor(true); ++ name = "Registration"; ++ } + tmp.setColor(Cc, Mc, Yc, Kc); + tmp.setSpotColor(true); +- QString nam = QString(((GfxSeparationColorSpace*)color_space)->getName()->getCString()); +- fNam = m_doc->PageColors.tryAddColor(nam, tmp); ++ ++ fNam = m_doc->PageColors.tryAddColor(name, tmp); + *shade = qRound(colToDbl(color->c[0]) * 100); + } + else +-- +2.16.2 + + +From d676ca5641346bf1f7cb7cf7dcaa6333467f4809 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Fri, 4 May 2018 23:19:34 +1000 +Subject: Fix hunspell detection + + +diff --git a/cmake/modules/FindHUNSPELL.cmake b/cmake/modules/FindHUNSPELL.cmake +index ecd4776..034c46a 100644 +--- a/cmake/modules/FindHUNSPELL.cmake ++++ b/cmake/modules/FindHUNSPELL.cmake +@@ -9,7 +9,7 @@ + #Based on examples at http://www.vtk.org/Wiki/CMake:How_To_Find_Libraries + + FIND_PATH(HUNSPELL_INCLUDE_DIR hunspell/hunspell.hxx ) +-FIND_LIBRARY(HUNSPELL_LIBRARIES NAMES hunspell-1.3 hunspell-1.2 PATHS /opt/local/lib /usr/local/lib /usr/lib ) ++FIND_LIBRARY(HUNSPELL_LIBRARIES NAMES hunspell-1.6 hunspell-1.3 hunspell-1.2 PATHS /opt/local/lib /usr/local/lib /usr/lib ) + + INCLUDE(FindPackageHandleStandardArgs) + # handle the QUIETLY and REQUIRED arguments and set HUNSPELL_FOUND to TRUE +-- +2.16.2 + diff --git a/app-office/scribus/scribus-1.5.3.recipe b/app-office/scribus/scribus-1.5.2.recipe similarity index 75% rename from app-office/scribus/scribus-1.5.3.recipe rename to app-office/scribus/scribus-1.5.2.recipe index 5a8f51091..b725a8e25 100644 --- a/app-office/scribus/scribus-1.5.3.recipe +++ b/app-office/scribus/scribus-1.5.2.recipe @@ -9,21 +9,21 @@ versatile PDF creation." HOMEPAGE="http://www.scribus.net" COPYRIGHT="2014-2017 Scribus Team" LICENSE="GNU GPL v2" -REVISION="2" +REVISION="1" SOURCE_URI="http://downloads.sourceforge.net/project/scribus/scribus-devel/$portVersion/scribus-$portVersion.tar.xz" -CHECKSUM_SHA256="73a30b4727e19f5d301a936d23a84275cc4f5613a92416cbd843f5167721d74f" +CHECKSUM_SHA256="ec5eec23aeda655d3a761cffb85853dcd2ede3973b9e62a1b3c28bd1093c74f5" PATCHES="scribus-$portVersion.patchset" +ADDITIONAL_FILES="scribus.rdef.in" -ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64" -SECONDARY_ARCHITECTURES="?x86" +ARCHITECTURES="!x86_gcc2 ?x86 x86_64" +SECONDARY_ARCHITECTURES="x86" PROVIDES=" scribus$secondaryArchSuffix = $portVersion app:Scribus " REQUIRES=" - haiku$secondaryArchSuffix - cmd:hunspell$secondaryArchSuffix + haiku$secondaryArchSuffix lib:libcairo$secondaryArchSuffix lib:libcdr_0.1$secondaryArchSuffix lib:libcrypto$secondaryArchSuffix @@ -32,6 +32,7 @@ REQUIRES=" lib:libfontconfig$secondaryArchSuffix lib:libfreehand_0.1$secondaryArchSuffix lib:libharfbuzz_icu$secondaryArchSuffix + lib:libhunspell_1.6$secondaryArchSuffix lib:libhyphen$secondaryArchSuffix lib:libicuuc$secondaryArchSuffix lib:libicudata$secondaryArchSuffix @@ -61,16 +62,8 @@ REQUIRES=" lib:libz$secondaryArchSuffix " -PROVIDES_devel=" - scribus${secondaryArchSuffix}_devel = $portVersion - devel:scribus$secondaryArchSuffix = $portVersion - " -REQUIRES_devel=" - " - BUILD_REQUIRES=" - haiku${secondaryArchSuffix}_devel - hunspell${secondaryArchSuffix}_devel + haiku${secondaryArchSuffix}_devel devel:libboost_system${secondaryArchSuffix} devel:libcairo$secondaryArchSuffix >= 2.11400 devel:libcrypto$secondaryArchSuffix @@ -80,6 +73,7 @@ BUILD_REQUIRES=" devel:libfontconfig$secondaryArchSuffix devel:libfreehand_0.1$secondaryArchSuffix devel:libharfbuzz_icu$secondaryArchSuffix + devel:libhunspell_1.6$secondaryArchSuffix devel:libhyphen$secondaryArchSuffix devel:libjpeg$secondaryArchSuffix devel:liblcms2$secondaryArchSuffix @@ -118,8 +112,9 @@ PATCH() BUILD() { - cmake . -DCMAKE_INSTALL_PREFIX=$prefix \ - -DEXECUTABLE_OUTPUT_PATH=$appsDir \ + cmake . -DCMAKE_INSTALL_PREFIX=$appsDir/Scribus \ + -DEXECUTABLE_OUTPUT_PATH=$appsDir/Scribus \ + -DPLUGINDIR=$appsDir/Scribus/plugins \ -DCMAKE_INSTALL_DATAROOTDIR=$dataDir \ -DSHAREDIR=$dataDir \ -DAPPLICATION_DATA_DIR=$dataDir \ @@ -133,8 +128,23 @@ INSTALL() { make install - mkdir -p $appsDir - mv $appsDir/scribus $appsDir/Scribus - rm -rf $prefix/bin - addAppDeskbarSymlink $appsDir/Scribus Scribus + mv $appsDir/Scribus/scribus $appsDir/Scribus/Scribus + mv $appsDir/Scribus/pluginsgettext $appsDir/Scribus/plugins/gettext + rm -rf $appsDir/Scribus/bin + + local APP_SIGNATURE="application/x-vnd.scribus" + local MAJOR="`echo "$portVersion" | cut -d. -f1`" + local MIDDLE="`echo "$portVersion" | cut -d. -f2`" + local MINOR="`echo "$portVersion" | cut -d. -f3`" + local LONG_INFO="$SUMMARY" + sed \ + -e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \ + -e "s|@MAJOR@|$MAJOR|" \ + -e "s|@MIDDLE@|$MIDDLE|" \ + -e "s|@MINOR@|$MINOR|" \ + -e "s|@LONG_INFO@|$LONG_INFO|" \ + $portDir/additional-files/scribus.rdef.in > $sourceDir/scribus.rdef + + addResourcesToBinaries $sourceDir/scribus.rdef $appsDir/Scribus/Scribus + addAppDeskbarSymlink $appsDir/Scribus/Scribus Scribus }