diff options
Diffstat (limited to 'community')
-rw-r--r-- | community/tor/PKGBUILD | 4 | ||||
-rw-r--r-- | community/wiznote/PKGBUILD | 8 | ||||
-rw-r--r-- | community/wkhtmltopdf/0001-fix-spurious-exit-with-code-1-due-to-http-error-1xxx.patch | 74 | ||||
-rw-r--r-- | community/wkhtmltopdf/0002-fix-compilation-failures-when-not-building-with-patc.patch | 233 | ||||
-rw-r--r-- | community/wkhtmltopdf/PKGBUILD | 37 |
5 files changed, 339 insertions, 17 deletions
diff --git a/community/tor/PKGBUILD b/community/tor/PKGBUILD index f40ee64a7..128215dbb 100644 --- a/community/tor/PKGBUILD +++ b/community/tor/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 111976 2014-05-27 10:49:58Z lfleischer $ +# $Id: PKGBUILD 113076 2014-06-12 19:38:25Z thestinger $ # Maintainer: Lukas Fleischer <archlinux at cryptocrack dot de> # Contributor: Daniel Micay <danielmicay@gmail.com> # Contributor: simo <simo@archlinux.org> @@ -6,7 +6,7 @@ pkgname=tor pkgver=0.2.4.22 -pkgrel=1 +pkgrel=2 pkgdesc='Anonymizing overlay network.' arch=('i686' 'x86_64') url='http://www.torproject.org/' diff --git a/community/wiznote/PKGBUILD b/community/wiznote/PKGBUILD index 52da7ef04..3d342d526 100644 --- a/community/wiznote/PKGBUILD +++ b/community/wiznote/PKGBUILD @@ -1,9 +1,9 @@ -# $Id: PKGBUILD 111661 2014-05-22 09:28:35Z fyan $ +# $Id: PKGBUILD 113057 2014-06-12 09:59:12Z fyan $ # Maintainer: Felix Yan <felixonmars@gmail.com> # Contributor: Albert.Zhou <albert.zhou@wiz.cn> pkgname=wiznote -pkgver=2.1.7 +pkgver=2.1.8 pkgrel=1 pkgdesc="Opensource cross-platform cloud based note-taking client" arch=('i686' 'x86_64') @@ -17,10 +17,6 @@ source=("git+https://github.com/WizTeam/${_wiznote_project_name}.git#branch=v$pk md5sums=('SKIP') prepare() { - # This case change doesn't make any sense, really... - sed -i "s/Exec=wiznote/Exec=WizNote/" $_wiznote_project_name/build/common/wiznote.desktop - - # And this... rm $_wiznote_project_name/share/skins/default/Thumbs.db rm -rf build; mkdir build diff --git a/community/wkhtmltopdf/0001-fix-spurious-exit-with-code-1-due-to-http-error-1xxx.patch b/community/wkhtmltopdf/0001-fix-spurious-exit-with-code-1-due-to-http-error-1xxx.patch new file mode 100644 index 000000000..0626b7b64 --- /dev/null +++ b/community/wkhtmltopdf/0001-fix-spurious-exit-with-code-1-due-to-http-error-1xxx.patch @@ -0,0 +1,74 @@ +From d6b406d9ec207036af807af2bee2aeb5e33827f0 Mon Sep 17 00:00:00 2001 +From: Ashish Kulkarni <kulkarni.ashish@gmail.com> +Date: Mon, 10 Feb 2014 19:33:21 +0530 +Subject: [PATCH 1/2] fix spurious "exit with code 1 due to http error: 1xxx" + errors + +This fixes #1502 and was introduced in ce6d6cd0f0f86a5b1ff3765aaae357dfdf3be803, +which returned errors above 1000 as a proxy for network errors. However, the +error 5 (i.e. OperationCanceledError) was not handled, which apparently happens +a lot due to parallel loading of resources. We thus ignore this error in the +loader. + +In addition, in case the error is greater than 1000, we find out the correct +network error and display that error instead of HTTP error 1xxx which doesn't +exist. The trick to find out the text values for the enum was taken from: + +https://blog.qt.digia.com/blog/2008/10/09/coding-tip-pretty-printing-enum-values/ +--- + src/lib/multipageloader.cc | 2 +- + src/lib/utilities.cc | 18 +++++++++++++++++- + 2 files changed, 18 insertions(+), 2 deletions(-) + +diff --git a/src/lib/multipageloader.cc b/src/lib/multipageloader.cc +index 0f4e7f7..d74fa0d 100644 +--- a/src/lib/multipageloader.cc ++++ b/src/lib/multipageloader.cc +@@ -335,7 +335,7 @@ void ResourceObject::error(const QString & str) { + void ResourceObject::amfinished(QNetworkReply * reply) { + int networkStatus = reply->error(); + int httpStatus = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); +- if (networkStatus > 0 || (httpStatus > 399 && httpErrorCode == 0)) ++ if ((networkStatus != 0 && networkStatus != 5) || (httpStatus > 399 && httpErrorCode == 0)) + { + QFileInfo fi(reply->url().toString()); + bool mediaFile = settings::LoadPage::mediaFilesExtensions.contains(fi.completeSuffix().toLower()); +diff --git a/src/lib/utilities.cc b/src/lib/utilities.cc +index 639aa32..4238c47 100644 +--- a/src/lib/utilities.cc ++++ b/src/lib/utilities.cc +@@ -27,6 +27,8 @@ + #include "utilities.hh" + #include <QDebug> + #include <QTextStream> ++#include <QMetaEnum> ++#include <QNetworkReply> + + void loadSvg(QSvgRenderer * & ptr, const QString & path, const char * def, int w, int h) { + delete ptr; +@@ -160,7 +162,21 @@ int handleError(bool success, int errorCode) { + if (ce.contains(errorCode)) c = ce[errorCode]; + const char * m = ""; + if (cm.contains(errorCode)) m = cm[errorCode]; +- fprintf(stderr, "Exit with code %d due to http error: %d %s\n", c, errorCode, m); ++ if (errorCode < 1000) { ++ fprintf(stderr, "Exit with code %d due to http error: %d %s\n", c, errorCode, m); ++ } else { ++ QNetworkReply::NetworkError error = (QNetworkReply::NetworkError)(errorCode - 1000); ++ QString errorValue; ++ QMetaObject meta = QNetworkReply::staticMetaObject; ++ for (int i=0; i < meta.enumeratorCount(); ++i) { ++ QMetaEnum m = meta.enumerator(i); ++ if (m.name() == QLatin1String("NetworkError")) { ++ errorValue = QLatin1String(m.valueToKey(error)); ++ break; ++ } ++ } ++ fprintf(stderr, "Exit with code %d due to network error: %s\n", c, errorValue.toLocal8Bit().data()); ++ } + return c; + } else if (!success) { + fprintf(stderr, "Exit with code %d, due to unknown error.\n", EXIT_FAILURE); +-- +2.0.0 + diff --git a/community/wkhtmltopdf/0002-fix-compilation-failures-when-not-building-with-patc.patch b/community/wkhtmltopdf/0002-fix-compilation-failures-when-not-building-with-patc.patch new file mode 100644 index 000000000..e71155ff3 --- /dev/null +++ b/community/wkhtmltopdf/0002-fix-compilation-failures-when-not-building-with-patc.patch @@ -0,0 +1,233 @@ +From ef708c2adb31062d73506917f03fd5e942594d33 Mon Sep 17 00:00:00 2001 +From: Ashish Kulkarni <kulkarni.ashish@gmail.com> +Date: Sat, 15 Mar 2014 11:42:11 +0530 +Subject: [PATCH 2/2] fix compilation failures when not building with patched + QT/WebKit + +Apparently, no one uses the plain vanilla build as no one reported +any issue for a long time. This will get it to compile and work at +least for a sample page. + +Conflicts: + src/lib/pdfconverter.cc +--- + src/lib/pdfconverter.cc | 33 +++++++++++++++++++++++++++------ + src/lib/pdfconverter_p.hh | 14 +++++++++----- + 2 files changed, 36 insertions(+), 11 deletions(-) + +diff --git a/src/lib/pdfconverter.cc b/src/lib/pdfconverter.cc +index b227c87..f883a00 100644 +--- a/src/lib/pdfconverter.cc ++++ b/src/lib/pdfconverter.cc +@@ -78,9 +78,9 @@ bool DLL_LOCAL looksLikeHtmlAndNotAUrl(QString str) { + + PdfConverterPrivate::PdfConverterPrivate(PdfGlobal & s, PdfConverter & o) : + settings(s), pageLoader(s.load), +- out(o), printer(0), painter(0), webPrinter(0) ++ out(o), printer(0), painter(0) + #ifdef __EXTENSIVE_WKHTMLTOPDF_QT_HACK__ +- , measuringHFLoader(s.load), hfLoader(s.load), tocLoader1(s.load), tocLoader2(s.load) ++ , webPrinter(0), measuringHFLoader(s.load), hfLoader(s.load), tocLoader1(s.load), tocLoader2(s.load) + , tocLoader(&tocLoader1), tocLoaderOld(&tocLoader2) + , outline(0), currentHeader(0), currentFooter(0) + #endif +@@ -151,13 +151,15 @@ void PdfConverterPrivate::beginConvert() { + fail(); + return; + } +-#endif ++#else + bool headerHeightsCalcNeeded = false; ++#endif + + for (QList<PageObject>::iterator i=objects.begin(); i != objects.end(); ++i) { + PageObject & o=*i; + settings::PdfObject & s = o.settings; + ++#ifdef __EXTENSIVE_WKHTMLTOPDF_QT_HACK__ + if (!s.header.htmlUrl.isEmpty() ) { + if (looksLikeHtmlAndNotAUrl(s.header.htmlUrl)) { + emit out.error("--header-html should be a URL and not a string containing HTML code."); +@@ -195,6 +197,7 @@ void PdfConverterPrivate::beginConvert() { + o.footerReserveHeight = settings.margin.bottom.first + s.footer.spacing; + } + } ++#endif + + if (!s.isTableOfContent) { + o.loaderObject = pageLoader.addResource(s.page, s.load, &o.data); +@@ -207,6 +210,7 @@ void PdfConverterPrivate::beginConvert() { + emit out.phaseChanged(); + loadProgress(0); + ++#ifdef __EXTENSIVE_WKHTMLTOPDF_QT_HACK__ + if (headerHeightsCalcNeeded) { + // preload header/footer to check their heights + measuringHFLoader.load(); +@@ -225,8 +229,12 @@ void PdfConverterPrivate::beginConvert() { + + pageLoader.load(); + } ++#else ++ pageLoader.load(); ++#endif + } + ++#ifdef __EXTENSIVE_WKHTMLTOPDF_QT_HACK__ + // calculates header/footer height + // returns millimeters + qreal PdfConverterPrivate::calculateHeaderHeight(PageObject & object, QWebPage & header) { +@@ -252,6 +260,8 @@ qreal PdfConverterPrivate::calculateHeaderHeight(PageObject & object, QWebPage & + return (height / PdfConverter::millimeterToPointMultiplier); + } + ++#endif ++ + QPrinter * PdfConverterPrivate::createPrinter(const QString & tempFile) { + QPrinter * printer = new QPrinter(settings.resolution); + if (settings.dpi != -1) printer->setResolution(settings.dpi); +@@ -275,6 +285,7 @@ QPrinter * PdfConverterPrivate::createPrinter(const QString & tempFile) { + return printer; + } + ++#ifdef __EXTENSIVE_WKHTMLTOPDF_QT_HACK__ + void PdfConverterPrivate::preprocessPage(PageObject & obj) { + currentObject++; + if (obj.settings.isTableOfContent) { +@@ -309,7 +320,7 @@ void PdfConverterPrivate::preprocessPage(PageObject & obj) { + outline->addEmptyWebPage(); + painter->restore(); + } +- ++#endif + + /*! + * Prepares printing out the document to the pdf file +@@ -353,9 +364,15 @@ void PdfConverterPrivate::pagesLoaded(bool ok) { + } + + //Setup margins and papersize ++#ifdef __EXTENSIVE_WKHTMLTOPDF_QT_HACK__ + printer->setPageMargins(settings.margin.left.first, objects[0].headerReserveHeight, + settings.margin.right.first, objects[0].footerReserveHeight, + settings.margin.left.second); ++#else ++ printer->setPageMargins(settings.margin.left.first, settings.margin.top.first, ++ settings.margin.right.first, settings.margin.bottom.first, ++ settings.margin.left.second); ++#endif + + if ((settings.size.height.first != -1) && (settings.size.width.first != -1)) { + printer->setPaperSize(QSizeF(settings.size.width.first,settings.size.height.first), settings.size.height.second); +@@ -656,7 +673,6 @@ void PdfConverterPrivate::endPage(PageObject & object, bool hasHeaderFooter, int + } + + } +-#endif + + void PdfConverterPrivate::handleTocPage(PageObject & obj) { + painter->save(); +@@ -670,6 +686,7 @@ void PdfConverterPrivate::handleTocPage(PageObject & obj) { + tocChanged = outline->replaceWebPage(obj.number, obj.settings.toc.captionText, wp, obj.page->mainFrame(), obj.settings, obj.localLinks, obj.anchors) || tocChanged; + painter->restore(); + } ++#endif + + + void PdfConverterPrivate::tocLoaded(bool ok) { +@@ -731,6 +748,7 @@ void PdfConverterPrivate::measuringHeadersLoaded(bool ok) { + return; + } + ++#ifdef __EXTENSIVE_WKHTMLTOPDF_QT_HACK__ + for (int d=0; d < objects.size(); ++d) { + PageObject & obj = objects[d]; + if (obj.measuringHeader) { +@@ -743,6 +761,7 @@ void PdfConverterPrivate::measuringHeadersLoaded(bool ok) { + obj.footerReserveHeight = calculateHeaderHeight(obj, *obj.measuringFooter) + obj.settings.header.spacing; + } + } ++#endif + + pageLoader.load(); + } +@@ -758,6 +777,7 @@ void PdfConverterPrivate::headersLoaded(bool ok) { + printDocument(); + } + ++#ifdef __EXTENSIVE_WKHTMLTOPDF_QT_HACK__ + + void PdfConverterPrivate::spoolPage(int page) { + progressString = QString("Page ") + QString::number(actualPage) + QString(" of ") + QString::number(actualPages); +@@ -904,7 +924,8 @@ void PdfConverterPrivate::endPrintObject(PageObject & obj) { + } + + } +- ++ ++#endif + + void PdfConverterPrivate::printDocument() { + #ifndef __EXTENSIVE_WKHTMLTOPDF_QT_HACK__ +diff --git a/src/lib/pdfconverter_p.hh b/src/lib/pdfconverter_p.hh +index 2cfa441..3679673 100644 +--- a/src/lib/pdfconverter_p.hh ++++ b/src/lib/pdfconverter_p.hh +@@ -94,8 +94,11 @@ public: + } + + PageObject(const settings::PdfObject & set, const QString * d=NULL): +- settings(set), loaderObject(0), page(0), headerReserveHeight(0), footerReserveHeight(0), +- measuringHeader(0), measuringFooter(0) { ++ settings(set), loaderObject(0), page(0) ++#ifdef __EXTENSIVE_WKHTMLTOPDF_QT_HACK__ ++ , headerReserveHeight(0), footerReserveHeight(0), measuringHeader(0), measuringFooter(0) ++#endif ++ { + if (d) data=*d; + }; + +@@ -134,6 +137,7 @@ private: + bool tocChanged; + int actualPage; + int pageNumber; ++#ifdef __EXTENSIVE_WKHTMLTOPDF_QT_HACK__ + QWebPrinter * webPrinter; + int objectPage; + +@@ -144,7 +148,6 @@ private: + QHash<int, QVector<QWebElement> > pageFormElements; + bool pageHasHeaderFooter; + +-#ifdef __EXTENSIVE_WKHTMLTOPDF_QT_HACK__ + // loader for measuringHeader and measuringFooter + MultiPageLoader measuringHFLoader; + +@@ -163,14 +166,14 @@ private: + void fillParms(QHash<QString, QString> & parms, int page, const PageObject & object); + QString hfreplace(const QString & q, const QHash<QString, QString> & parms); + QWebPage * loadHeaderFooter(QString url, const QHash<QString, QString> & parms, const settings::PdfObject & ps); +- ++ qreal calculateHeaderHeight(PageObject & object, QWebPage & header); + + #endif + QWebPage * currentHeader; + QWebPage * currentFooter; +- qreal calculateHeaderHeight(PageObject & object, QWebPage & header); + QPrinter * createPrinter(const QString & tempFile); + ++#ifdef __EXTENSIVE_WKHTMLTOPDF_QT_HACK__ + void handleTocPage(PageObject & obj); + void preprocessPage(PageObject & obj); + void spoolPage(int page); +@@ -179,6 +182,7 @@ private: + void handleFooter(QWebPage * frame, int page); + void beginPrintObject(PageObject & obj); + void endPrintObject(PageObject & obj); ++#endif + + void loadTocs(); + void loadHeaders(); +-- +2.0.0 + diff --git a/community/wkhtmltopdf/PKGBUILD b/community/wkhtmltopdf/PKGBUILD index 14c05a4e8..f0b3dbe03 100644 --- a/community/wkhtmltopdf/PKGBUILD +++ b/community/wkhtmltopdf/PKGBUILD @@ -1,22 +1,36 @@ -# $Id: PKGBUILD 61101 2011-12-21 20:52:58Z andrea $ +# $Id: PKGBUILD 113062 2014-06-12 12:41:47Z foutrelis $ # Maintainer: Evangelos Foutras <evangelos@foutrelis.com> pkgname=wkhtmltopdf -pkgver=0.9.9 -pkgrel=2 -pkgdesc="Simple shell utility to convert html to pdf using the webkit rendering engine, and qt" +pkgver=0.12.0 +pkgrel=1 +pkgdesc="Command line tools to render HTML into PDF and various image formats" arch=('i686' 'x86_64') -url="http://code.google.com/p/wkhtmltopdf/" +url="http://wkhtmltopdf.org/" license=('GPL3') depends=('qtwebkit') optdepends=('xorg-server: wkhtmltopdf needs X or Xvfb to operate') -source=(http://wkhtmltopdf.googlecode.com/files/$pkgname-$pkgver.tar.bz2) -sha1sums=('41f598c0103326e7c13101391447b0284b4ba3cb') +source=($pkgname-$pkgver.tar.gz::https://github.com/wkhtmltopdf/wkhtmltopdf/archive/$pkgver.tar.gz + 0001-fix-spurious-exit-with-code-1-due-to-http-error-1xxx.patch + 0002-fix-compilation-failures-when-not-building-with-patc.patch) +sha256sums=('ad3449acc772bd687b3853e087033b7223e6298f4a59d21d09c08c9d006f693f' + 'bc9ffc8a99a32f66882e406f25962a0753129c161530879ad23ee5bd189a2a66' + 'ece5abbee4c9f37ab4b5df856dd708562dbf4e14374b9c60b41109f00c82c44b') + +prepare() { + cd "$srcdir/$pkgname-$pkgver" + + # https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1502 + patch -Np1 -i "$srcdir/0001-fix-spurious-exit-with-code-1-due-to-http-error-1xxx.patch" + + # Fix build with system Qt + patch -Np1 -i "$srcdir/0002-fix-compilation-failures-when-not-building-with-patc.patch" +} build() { cd "$srcdir/$pkgname-$pkgver" - qmake wkhtmltopdf.pro + qmake-qt4 wkhtmltopdf.pro make } @@ -26,5 +40,10 @@ package() { # Generate and install man page install -d "$pkgdir/usr/share/man/man1" - ./wkhtmltopdf --manpage >"$pkgdir/usr/share/man/man1/wkhtmltopdf.1" + LD_LIBRARY_PATH=bin ./bin/wkhtmltopdf --manpage \ + >"$pkgdir/usr/share/man/man1/wkhtmltopdf.1" + LD_LIBRARY_PATH=bin ./bin/wkhtmltoimage --manpage \ + >"$pkgdir/usr/share/man/man1/wkhtmltoimage.1" } + +# vim:set ts=2 sw=2 et: |