From 184c74081d555895d55ce13da37dd91421f315c6 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 29 Nov 2007 22:07:51 +0000 Subject: [PATCH] ship xpdf headers (for texlive) --- poppler-ObjStream.patch | 138 ++++++++++++++++++++++++++++++++++++++++ poppler-qt3-check.patch | 13 ++++ poppler.spec | 18 ++++-- 3 files changed, 164 insertions(+), 5 deletions(-) create mode 100644 poppler-ObjStream.patch create mode 100644 poppler-qt3-check.patch diff --git a/poppler-ObjStream.patch b/poppler-ObjStream.patch new file mode 100644 index 0000000..51d5570 --- /dev/null +++ b/poppler-ObjStream.patch @@ -0,0 +1,138 @@ +diff -up poppler-0.6.2/poppler-0.6.2/poppler/XRef.h.objstream poppler-0.6.2/poppler-0.6.2/poppler/XRef.h +--- poppler-0.6.2/poppler-0.6.2/poppler/XRef.h.objstream 2007-11-05 00:11:05.000000000 +0100 ++++ poppler-0.6.2/poppler-0.6.2/poppler/XRef.h 2007-11-28 12:23:02.000000000 +0100 +@@ -19,7 +19,36 @@ + class Dict; + class Stream; + class Parser; +-class ObjectStream; ++ ++class ObjectStream { ++public: ++ ++ // Create an object stream, using object number , ++ // generation 0. ++ ObjectStream(XRef *xref, int objStrNumA); ++ ++ ~ObjectStream(); ++ ++ // Return the object number of this object stream. ++ int getObjStrNum() { return objStrNum; } ++ ++ // Get the th object from this stream, which should be ++ // object number , generation 0. ++ Object *getObject(int objIdx, int objNum, Object *obj); ++ ++ int *getOffsets() { return offsets; } ++ Guint getFirstOffset() { return firstOffset; } ++ ++private: ++ ++ int objStrNum; // object number of the object stream ++ int nObjects; // number of objects in the stream ++ Object *objs; // the objects (length = nObjects) ++ int *objNums; // the object numbers (length = nObjects) ++ int *offsets; // the object offsets (length = nObjects) ++ Guint firstOffset; ++}; ++ + + //------------------------------------------------------------------------ + // XRef +@@ -106,6 +135,7 @@ public: + int getSize() { return size; } + XRefEntry *getEntry(int i) { return &entries[i]; } + Object *getTrailerDict() { return &trailerDict; } ++ ObjectStream *getObjStr() { return objStr; } + + // Write access + void setModifiedObject(Object* o, Ref r); +diff -up poppler-0.6.2/poppler-0.6.2/poppler/XRef.cc.objstream poppler-0.6.2/poppler-0.6.2/poppler/XRef.cc +--- poppler-0.6.2/poppler-0.6.2/poppler/XRef.cc.objstream 2007-11-05 00:11:05.000000000 +0100 ++++ poppler-0.6.2/poppler-0.6.2/poppler/XRef.cc 2007-11-28 12:23:02.000000000 +0100 +@@ -50,34 +50,9 @@ + // ObjectStream + //------------------------------------------------------------------------ + +-class ObjectStream { +-public: +- +- // Create an object stream, using object number , +- // generation 0. +- ObjectStream(XRef *xref, int objStrNumA); +- +- ~ObjectStream(); +- +- // Return the object number of this object stream. +- int getObjStrNum() { return objStrNum; } +- +- // Get the th object from this stream, which should be +- // object number , generation 0. +- Object *getObject(int objIdx, int objNum, Object *obj); +- +-private: +- +- int objStrNum; // object number of the object stream +- int nObjects; // number of objects in the stream +- Object *objs; // the objects (length = nObjects) +- int *objNums; // the object numbers (length = nObjects) +-}; +- + ObjectStream::ObjectStream(XRef *xref, int objStrNumA) { + Stream *str; + Parser *parser; +- int *offsets; + Object objStr, obj1, obj2; + int first, i; + +@@ -85,6 +60,7 @@ ObjectStream::ObjectStream(XRef *xref, i + nObjects = 0; + objs = NULL; + objNums = NULL; ++ offsets = NULL; + + if (!xref->fetch(objStrNum, 0, &objStr)->isStream()) { + goto err1; +@@ -105,6 +81,7 @@ ObjectStream::ObjectStream(XRef *xref, i + goto err1; + } + first = obj1.getInt(); ++ firstOffset = objStr.getStream()->getBaseStream()->getStart() + first; + obj1.free(); + if (first < 0) { + goto err1; +@@ -131,7 +108,7 @@ ObjectStream::ObjectStream(XRef *xref, i + obj1.free(); + obj2.free(); + delete parser; +- gfree(offsets); ++// gfree(offsets); + goto err1; + } + objNums[i] = obj1.getInt(); +@@ -141,7 +118,7 @@ ObjectStream::ObjectStream(XRef *xref, i + if (objNums[i] < 0 || offsets[i] < 0 || + (i > 0 && offsets[i] < offsets[i-1])) { + delete parser; +- gfree(offsets); ++// gfree(offsets); + goto err1; + } + } +@@ -170,7 +147,7 @@ ObjectStream::ObjectStream(XRef *xref, i + delete parser; + } + +- gfree(offsets); ++// gfree(offsets); + + err1: + objStr.free(); +@@ -187,6 +164,7 @@ ObjectStream::~ObjectStream() { + delete[] objs; + } + gfree(objNums); ++ gfree(offsets); + } + + Object *ObjectStream::getObject(int objIdx, int objNum, Object *obj) { diff --git a/poppler-qt3-check.patch b/poppler-qt3-check.patch new file mode 100644 index 0000000..257a74f --- /dev/null +++ b/poppler-qt3-check.patch @@ -0,0 +1,13 @@ +--- poppler-0.6.2/poppler-0.6.2/configure.orig 2007-11-29 12:09:57.000000000 +0100 ++++ poppler-0.6.2/poppler-0.6.2/configure 2007-11-29 12:20:49.000000000 +0100 +@@ -25816,8 +25816,8 @@ + + if test x$enable_poppler_qt = xyes; then + +-qt_incdirs="$QTINC /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/lib/qt3/include /usr/lib/qt/include /usr/share/qt3/include" +-qt_libdirs="$QTLIB /usr/local/qt/lib /usr/lib/qt /usr/lib /usr/X11R6/lib/X11/qt /usr/X11R6/lib/qt /usr/lib/qt3/lib /usr/lib/qt/lib /usr/share/qt3/lib" ++qt_incdirs="$QTINC /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/lib/qt3/include /usr/lib/qt/include /usr/share/qt3/include /usr/lib/qt-3.3/include" ++qt_libdirs="$QTLIB /usr/local/qt/lib /usr/lib/qt /usr/lib /usr/X11R6/lib/X11/qt /usr/X11R6/lib/qt /usr/lib/qt3/lib /usr/lib/qt/lib /usr/share/qt3/lib /usr/lib/qt-3.3/lib" + if test -n "$QTDIR" ; then + qt_incdirs="$QTDIR/include $qt_incdirs" + qt_libdirs="$QTDIR/lib $qt_libdirs" diff --git a/poppler.spec b/poppler.spec index 209954f..2537e08 100644 --- a/poppler.spec +++ b/poppler.spec @@ -3,7 +3,7 @@ Summary: PDF rendering library Name: poppler Version: 0.6.2 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 and Redistributable, no modification permitted # the code is GPLv2 # the charmap data in /usr/share/poppler is redistributable @@ -12,6 +12,8 @@ URL: http://poppler.freedesktop.org/ Source0: http://poppler.freedesktop.org/poppler-%{version}.tar.gz Source1: http://poppler.freedesktop.org/poppler-data-%{dataversion}.tar.gz # https://bugs.freedesktop.org/show_bug.cgi?id=12016 +Patch0: poppler-ObjStream.patch +Patch1: poppler-qt3-check.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: gtk2-devel @@ -91,6 +93,8 @@ converting PDF files to a number of other formats. %prep %setup -c -q -a1 +%patch0 -p1 -b .objstream +%patch1 -p1 -b .qt3-check %build ( cd %{name}-%{version} @@ -98,7 +102,8 @@ converting PDF files to a number of other formats. --disable-static \ --enable-cairo-output \ --enable-poppler-qt \ - --enable-poppler-qt4 + --enable-poppler-qt4 \ + --enable-xpdf-headers ) make %{?_smp_mflags} -C %{name}-%{version} @@ -138,8 +143,7 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/pkgconfig/poppler-splash.pc %{_libdir}/libpoppler-glib.so %{_libdir}/libpoppler.so -%dir %{_includedir}/poppler/ -%{_includedir}/poppler/glib/ +%{_includedir}/poppler/ %{_datadir}/gtk-doc/html/poppler %files qt @@ -168,7 +172,11 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/* %changelog -* Thu Nov 22 2007 Matthias Clasen@redhat.com> - 0.6.2-1 +* Thu Nov 28 2007 Matthias Clasen - 0.6.2-2 +- package xpdf headers in poppler-devel (Jindrich Novy) +- Fix qt3 detection (Denis Leroy) + +* Thu Nov 22 2007 Matthias Clasen - 0.6.2-1 - Update to 0.6.2 * Thu Oct 11 2007 Rex Dieter - 0.6-2