summaryrefslogtreecommitdiff
path: root/testing/poppler
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-01-31 23:14:57 +0000
committerroot <root@rshg054.dnsready.net>2012-01-31 23:14:57 +0000
commitc34f78dd37c2a2015d43de5d89748a2f8147ba1b (patch)
tree2e3912930db02e8f8cbfa8a58eae203b886fa2d9 /testing/poppler
parent902eddd7e029eda6fc1c668b31e696c6ca3edbc7 (diff)
Tue Jan 31 23:14:56 UTC 2012
Diffstat (limited to 'testing/poppler')
-rw-r--r--testing/poppler/PKGBUILD83
-rw-r--r--testing/poppler/git-fixes.patch110
2 files changed, 193 insertions, 0 deletions
diff --git a/testing/poppler/PKGBUILD b/testing/poppler/PKGBUILD
new file mode 100644
index 000000000..ed3c56fbe
--- /dev/null
+++ b/testing/poppler/PKGBUILD
@@ -0,0 +1,83 @@
+# $Id: PKGBUILD 148261 2012-01-30 18:49:31Z ibiru $
+# Maintainer: Jan de Groot <jgc@archlinux.org>
+
+pkgbase=poppler
+pkgname=('poppler' 'poppler-glib' 'poppler-qt')
+pkgver=0.18.3
+pkgrel=2
+arch=(i686 x86_64)
+license=('GPL')
+makedepends=('libjpeg' 'gcc-libs' 'cairo' 'fontconfig' 'openjpeg' 'gtk2' 'qt' 'pkgconfig' 'lcms' 'gobject-introspection')
+options=('!libtool' '!emptydirs')
+url="http://poppler.freedesktop.org/"
+_testtag=0d2bfd4af4c76a3bac27ccaff793d9129df7b57a
+source=(http://poppler.freedesktop.org/${pkgbase}-${pkgver}.tar.gz
+ http://cgit.freedesktop.org/poppler/test/snapshot/test-${_testtag}.tar.bz2
+ git-fixes.patch)
+md5sums=('d70d2d63d8acd29c97185f7e5f09c9b4'
+ '9dc64c254a31e570507bdd4ad4ba629a'
+ 'af56b7b1b24a08f7498a0c7f5e862b93')
+
+build() {
+ cd "${srcdir}/${pkgbase}-${pkgver}"
+ sed -i -e '/AC_PATH_XTRA/d' configure.ac
+ #patch -Np1 -i "${srcdir}/git-fixes.patch"
+
+ autoreconf -fi
+
+ ./configure --prefix=/usr --sysconfdir=/etc \
+ --localstatedir=/var --disable-static \
+ --enable-cairo-output \
+ --enable-xpdf-headers \
+ --enable-libjpeg --enable-zlib \
+ --enable-poppler-qt4 \
+ --enable-poppler-glib
+ make
+}
+
+check() {
+ cd "${srcdir}"
+ ln -sf test-${_testtag} test
+ cd ${pkgbase}-${pkgver}
+ LANG=en_US.UTF8 make check
+}
+
+package_poppler() {
+ pkgdesc="PDF rendering library based on xpdf 3.0"
+ depends=('libjpeg' 'gcc-libs' 'cairo' 'fontconfig' 'openjpeg' 'lcms' 'poppler-data')
+ conflicts=("poppler-qt3<${pkgver}")
+
+ cd "${srcdir}/${pkgbase}-${pkgver}"
+ sed -e 's/^glib_subdir =.*/glib_subdir =/' \
+ -e 's/^qt4_subdir =.*/qt4_subdir =/' -i Makefile
+ make DESTDIR="${pkgdir}" install
+
+ rm -f "${pkgdir}"/usr/lib/pkgconfig/poppler-{glib,qt4}.pc
+}
+
+package_poppler-glib() {
+ pkgdesc="Poppler glib bindings"
+ depends=("poppler=${pkgver}" 'glib2')
+
+ cd "${srcdir}/${pkgbase}-${pkgver}/poppler"
+ make DESTDIR="${pkgdir}" install-libLTLIBRARIES
+ cd "${srcdir}/${pkgbase}-${pkgver}/glib"
+ make DESTDIR="${pkgdir}" install
+ install -m755 -d "${pkgdir}/usr/lib/pkgconfig"
+ install -m644 ../poppler-glib.pc "${pkgdir}/usr/lib/pkgconfig/"
+ rm -f "${pkgdir}"/usr/lib/libpoppler.*
+ rm -f "${pkgdir}/usr/bin/poppler-glib-demo"
+}
+
+package_poppler-qt() {
+ pkgdesc="Poppler Qt bindings"
+ depends=("poppler=${pkgver}" 'qt')
+
+ cd "${srcdir}/${pkgbase}-${pkgver}/poppler"
+ make DESTDIR="${pkgdir}" install-libLTLIBRARIES
+ cd "${srcdir}/${pkgbase}-${pkgver}/qt4"
+ make DESTDIR="${pkgdir}" install
+ install -m755 -d "${pkgdir}/usr/lib/pkgconfig"
+ install -m644 ../poppler-qt4.pc "${pkgdir}/usr/lib/pkgconfig/"
+ rm -f "${pkgdir}"/usr/lib/libpoppler.*
+}
diff --git a/testing/poppler/git-fixes.patch b/testing/poppler/git-fixes.patch
new file mode 100644
index 000000000..24a66b84f
--- /dev/null
+++ b/testing/poppler/git-fixes.patch
@@ -0,0 +1,110 @@
+From 74f4299e8f9e2d204979479f6579dd784db678a4 Mon Sep 17 00:00:00 2001
+From: Albert Astals Cid <aacid@kde.org>
+Date: Sun, 04 Dec 2011 16:29:45 +0000
+Subject: Do not fail if we are trying to save a file with Encrypt but that we have not modified at all
+
+Fixes KDE bug #288045
+(cherry picked from commit 63c942a45227ef28fb94ef4765171d9812fffafa)
+---
+diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
+index 01d2759..2758206 100644
+--- a/poppler/PDFDoc.cc
++++ b/poppler/PDFDoc.cc
+@@ -707,35 +707,44 @@ int PDFDoc::saveAs(GooString *name, PDFWriteMode mode) {
+
+ int PDFDoc::saveAs(OutStream *outStr, PDFWriteMode mode) {
+
+- // we don't support files with Encrypt at the moment
++ // find if we have updated objects
++ GBool updated = gFalse;
++ for(int i=0; i<xref->getNumObjects(); i++) {
++ if (xref->getEntry(i)->updated) {
++ updated = gTrue;
++ break;
++ }
++ }
++
++ // we don't support rewriting files with Encrypt at the moment
+ Object obj;
+ xref->getTrailerDict()->getDict()->lookupNF("Encrypt", &obj);
+ if (!obj.isNull())
+ {
+ obj.free();
+- return errEncrypted;
++ if (!updated && mode == writeStandard) {
++ // simply copy the original file
++ saveWithoutChangesAs (outStr);
++ } else {
++ return errEncrypted;
++ }
+ }
+- obj.free();
++ else
++ {
++ obj.free();
+
+- if (mode == writeForceRewrite) {
+- saveCompleteRewrite(outStr);
+- } else if (mode == writeForceIncremental) {
+- saveIncrementalUpdate(outStr);
+- } else { // let poppler decide
+- // find if we have updated objects
+- GBool updated = gFalse;
+- for(int i=0; i<xref->getNumObjects(); i++) {
+- if (xref->getEntry(i)->updated) {
+- updated = gTrue;
+- break;
++ if (mode == writeForceRewrite) {
++ saveCompleteRewrite(outStr);
++ } else if (mode == writeForceIncremental) {
++ saveIncrementalUpdate(outStr);
++ } else { // let poppler decide
++ if(updated) {
++ saveIncrementalUpdate(outStr);
++ } else {
++ // simply copy the original file
++ saveWithoutChangesAs (outStr);
+ }
+ }
+- if(updated) {
+- saveIncrementalUpdate(outStr);
+- } else {
+- // simply copy the original file
+- saveWithoutChangesAs (outStr);
+- }
+ }
+
+ return errNone;
+--
+cgit v0.9.0.2-2-gbebe
+From 03544e2f602319f0b381f5f357e14cc2cc77d2c1 Mon Sep 17 00:00:00 2001
+From: Albert Astals Cid <aacid@kde.org>
+Date: Tue, 06 Dec 2011 22:21:15 +0000
+Subject: include strings.h as we use memcpy
+
+Fixes bug 43558
+(cherry picked from commit 388d72ac27ae98fe3a1ebd21760f2b0fa0249a9b)
+---
+diff --git a/goo/PNGWriter.cc b/goo/PNGWriter.cc
+index f88c3a7..1fb8cab 100644
+--- a/goo/PNGWriter.cc
++++ b/goo/PNGWriter.cc
+@@ -6,7 +6,7 @@
+ //
+ // Copyright (C) 2009 Warren Toomey <wkt@tuhs.org>
+ // Copyright (C) 2009 Shen Liang <shenzhuxi@gmail.com>
+-// Copyright (C) 2009 Albert Astals Cid <aacid@kde.org>
++// Copyright (C) 2009, 2011 Albert Astals Cid <aacid@kde.org>
+ // Copyright (C) 2009 Stefan Thomas <thomas@eload24.com>
+ // Copyright (C) 2010, 2011 Adrian Johnson <ajohnson@redneon.com>
+ // Copyright (C) 2011 Thomas Klausner <wiz@danbala.tuwien.ac.at>
+@@ -19,6 +19,7 @@
+
+ #include <zlib.h>
+ #include <stdlib.h>
++#include <string.h>
+
+ #include "poppler/Error.h"
+ #include "goo/gmem.h"
+--
+cgit v0.9.0.2-2-gbebe