fix pdftosrc so that texlive builds with the new poppler

This commit is contained in:
Jindrich Novy 2010-08-20 14:16:10 +02:00
parent fc288eaafe
commit fef1f5f1ed
2 changed files with 72 additions and 50 deletions

View File

@ -1,6 +1,6 @@
diff -up texlive-2007/configure.in.poppler texlive-2007/configure.in diff -up texlive-2007/configure.in.poppler texlive-2007/configure.in
--- texlive-2007/configure.in.poppler 2007-01-09 02:17:11.000000000 +0100 --- texlive-2007/configure.in.poppler 2007-01-09 02:17:11.000000000 +0100
+++ texlive-2007/configure.in 2009-10-15 14:57:43.000000000 +0200 +++ texlive-2007/configure.in 2010-08-20 13:37:22.466142036 +0200
@@ -157,9 +157,9 @@ export needs_zlib @@ -157,9 +157,9 @@ export needs_zlib
# we need libxpdf for pdf[ex]tex, xetex # we need libxpdf for pdf[ex]tex, xetex
@ -25,7 +25,7 @@ diff -up texlive-2007/configure.in.poppler texlive-2007/configure.in
sinclude(libs/freetype/freetype.ac) sinclude(libs/freetype/freetype.ac)
diff -up texlive-2007/configure.poppler texlive-2007/configure diff -up texlive-2007/configure.poppler texlive-2007/configure
--- texlive-2007/configure.poppler 2007-01-09 15:16:26.000000000 +0100 --- texlive-2007/configure.poppler 2007-01-09 15:16:26.000000000 +0100
+++ texlive-2007/configure 2009-10-15 14:57:43.000000000 +0200 +++ texlive-2007/configure 2010-08-20 13:37:22.468141670 +0200
@@ -3442,9 +3442,9 @@ export needs_zlib @@ -3442,9 +3442,9 @@ export needs_zlib
# we need libxpdf for pdf[ex]tex, xetex # we need libxpdf for pdf[ex]tex, xetex
@ -41,7 +41,7 @@ diff -up texlive-2007/configure.poppler texlive-2007/configure
diff -up texlive-2007/texk/web2c/pdftexdir/pdftexextra.in.poppler texlive-2007/texk/web2c/pdftexdir/pdftexextra.in diff -up texlive-2007/texk/web2c/pdftexdir/pdftexextra.in.poppler texlive-2007/texk/web2c/pdftexdir/pdftexextra.in
--- texlive-2007/texk/web2c/pdftexdir/pdftexextra.in.poppler 2006-12-27 00:37:34.000000000 +0100 --- texlive-2007/texk/web2c/pdftexdir/pdftexextra.in.poppler 2006-12-27 00:37:34.000000000 +0100
+++ texlive-2007/texk/web2c/pdftexdir/pdftexextra.in 2009-10-15 14:57:43.000000000 +0200 +++ texlive-2007/texk/web2c/pdftexdir/pdftexextra.in 2010-08-20 13:37:22.469149555 +0200
@@ -26,7 +26,7 @@ $Id: pdftexextra.in,v 1.4 2004/08/26 18: @@ -26,7 +26,7 @@ $Id: pdftexextra.in,v 1.4 2004/08/26 18:
(generated from ../lib/texmfmp.c). (generated from ../lib/texmfmp.c).
*/ */
@ -53,7 +53,7 @@ diff -up texlive-2007/texk/web2c/pdftexdir/pdftexextra.in.poppler texlive-2007/t
#define PROGRAM_HELP PDFTEXHELP #define PROGRAM_HELP PDFTEXHELP
diff -up texlive-2007/texk/web2c/pdftexdir/pdftex.mk.poppler texlive-2007/texk/web2c/pdftexdir/pdftex.mk diff -up texlive-2007/texk/web2c/pdftexdir/pdftex.mk.poppler texlive-2007/texk/web2c/pdftexdir/pdftex.mk
--- texlive-2007/texk/web2c/pdftexdir/pdftex.mk.poppler 2006-12-27 00:37:34.000000000 +0100 --- texlive-2007/texk/web2c/pdftexdir/pdftex.mk.poppler 2006-12-27 00:37:34.000000000 +0100
+++ texlive-2007/texk/web2c/pdftexdir/pdftex.mk 2009-10-15 14:57:43.000000000 +0200 +++ texlive-2007/texk/web2c/pdftexdir/pdftex.mk 2010-08-20 13:37:22.470141585 +0200
@@ -2,6 +2,9 @@ @@ -2,6 +2,9 @@
# This fragment contains the parts of the makefile that are most likely to # This fragment contains the parts of the makefile that are most likely to
# differ between releases of pdfeTeX. # differ between releases of pdfeTeX.
@ -84,7 +84,7 @@ diff -up texlive-2007/texk/web2c/pdftexdir/pdftex.mk.poppler texlive-2007/texk/w
check: pdftosrc-check check: pdftosrc-check
diff -up texlive-2007/texk/web2c/pdftexdir/pdftoepdf.cc.poppler texlive-2007/texk/web2c/pdftexdir/pdftoepdf.cc diff -up texlive-2007/texk/web2c/pdftexdir/pdftoepdf.cc.poppler texlive-2007/texk/web2c/pdftexdir/pdftoepdf.cc
--- texlive-2007/texk/web2c/pdftexdir/pdftoepdf.cc.poppler 2006-12-27 00:37:34.000000000 +0100 --- texlive-2007/texk/web2c/pdftexdir/pdftoepdf.cc.poppler 2006-12-27 00:37:34.000000000 +0100
+++ texlive-2007/texk/web2c/pdftexdir/pdftoepdf.cc 2009-10-15 14:57:52.000000000 +0200 +++ texlive-2007/texk/web2c/pdftexdir/pdftoepdf.cc 2010-08-20 13:37:22.471141577 +0200
@@ -26,25 +26,24 @@ $Id: pdftoepdf.cc,v 1.9 2006/09/01 18:06 @@ -26,25 +26,24 @@ $Id: pdftoepdf.cc,v 1.9 2006/09/01 18:06
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -175,13 +175,35 @@ diff -up texlive-2007/texk/web2c/pdftexdir/pdftoepdf.cc.poppler texlive-2007/tex
pdftex_fail("PDF inclusion: invalid destination <%s>", page_name); pdftex_fail("PDF inclusion: invalid destination <%s>", page_name);
diff -up texlive-2007/texk/web2c/pdftexdir/pdftosrc.cc.poppler texlive-2007/texk/web2c/pdftexdir/pdftosrc.cc diff -up texlive-2007/texk/web2c/pdftexdir/pdftosrc.cc.poppler texlive-2007/texk/web2c/pdftexdir/pdftosrc.cc
--- texlive-2007/texk/web2c/pdftexdir/pdftosrc.cc.poppler 2006-12-27 00:37:34.000000000 +0100 --- texlive-2007/texk/web2c/pdftexdir/pdftosrc.cc.poppler 2006-12-27 00:37:34.000000000 +0100
+++ texlive-2007/texk/web2c/pdftexdir/pdftosrc.cc 2009-10-15 14:57:43.000000000 +0200 +++ texlive-2007/texk/web2c/pdftexdir/pdftosrc.cc 2010-08-20 13:36:25.000000000 +0200
@@ -25,22 +25,23 @@ $Id: //depot/Build/source.development/Te @@ -1,5 +1,5 @@
/*
-Copyright (c) 1996-2006 Han The Thanh, <thanh@pdftex.org>
+Copyright (c) 1996-2007 Han The Thanh, <thanh@pdftex.org>
This file is part of pdfTeX.
@@ -13,11 +13,9 @@ but WITHOUT ANY WARRANTY; without even t
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-$Id: //depot/Build/source.development/TeX/texk/web2c/pdftexdir/pdftosrc.cc#10 $
+You should have received a copy of the GNU General Public License along
+with pdfTeX; if not, write to the Free Software Foundation, Inc., 51
+Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <stdlib.h>
@@ -25,22 +23,26 @@ $Id: //depot/Build/source.development/Te
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
-#include <aconf.h> -#include <aconf.h>
#include <assert.h> -#include <assert.h>
-#include <GString.h> -#include <GString.h>
-#include <gmem.h> -#include <gmem.h>
-#include <gfile.h> -#include <gfile.h>
@ -197,52 +219,49 @@ diff -up texlive-2007/texk/web2c/pdftexdir/pdftosrc.cc.poppler texlive-2007/texk
-#include "GlobalParams.h" -#include "GlobalParams.h"
-#include "Error.h" -#include "Error.h"
+ +
+#include <poppler/cpp/poppler-version.h>
+#define GString GooString
+#define xpdfVersion POPPLER_VERSION
+#include <dirent.h> +#include <dirent.h>
+#include <poppler/goo/GooString.h> +#include <poppler/goo/GooString.h>
+#include <poppler/goo/gmem.h> +#include <poppler/goo/gmem.h>
+#include <poppler/goo/gfile.h> +#include <poppler/goo/gfile.h>
+#include <poppler/Object.h> +
+#include <poppler/Stream.h> +#include "poppler/Object.h"
+#include <poppler/Array.h> +#include "poppler/Stream.h"
+#include <poppler/Dict.h> +#include "poppler/Array.h"
+#include <poppler/XRef.h> +#include "poppler/Dict.h"
+#include <poppler/Catalog.h> +#include "poppler/XRef.h"
+#include <poppler/Page.h> +#include "poppler/Catalog.h"
+#include <poppler/GfxFont.h> +#include "poppler/Page.h"
+#include <poppler/PDFDoc.h> +#include "poppler/GfxFont.h"
+#include <poppler/GlobalParams.h> +#include "poppler/PDFDoc.h"
+#include <poppler/Error.h> +#include "poppler/GlobalParams.h"
+#include "poppler/Error.h"
static XRef *xref = 0; static XRef *xref = 0;
@@ -48,7 +49,7 @@ int main(int argc, char *argv[]) @@ -140,6 +142,9 @@ int main(int argc, char *argv[])
{ (long unsigned) e->offset, e->gen,
char *p, buf[1024]; (e->type == xrefEntryFree ? "f" : "n"));
PDFDoc *doc; else { // e->offset is the object number of the object stream
- GString *fileName; +#ifdef POPPLER_VERSION
+ GooString *fileName; + fprintf(stderr, "warning: this version of pdftosrc doesn't support object stream (use pdftosrc from TeX Live if you need it)\n");
Stream *s; +#else
Object srcStream, srcName, catalogDict; // e->gen is the local index inside that object stream
FILE *outfile; //int objStrOffset = xref->getEntry(e->offset)->offset;
@@ -56,13 +57,13 @@ int main(int argc, char *argv[]) Object tmpObj;
int objnum = 0, objgen = 0; @@ -156,6 +161,7 @@ int main(int argc, char *argv[])
bool extract_xref_table = false; localOffsets[e->gen]));
int c; // (long unsigned) (objStrOffset + objStr->getStart() + localOffsets[e->gen]));
- fprintf(stderr, "pdftosrc version %s\n", xpdfVersion); tmpObj.free();
+ fprintf(stderr, "pdftosrc\n"); +#endif
if (argc < 2) {
fprintf(stderr,
"Usage: pdftosrc <PDF-file> [<stream-object-number>]\n");
exit(1);
} }
- fileName = new GString(argv[1]); }
+ fileName = new GooString(argv[1]); } else {
globalParams = new GlobalParams();
doc = new PDFDoc(fileName);
if (!doc->isOk()) {
diff -up texlive-2007/texk/web2c/pdftexdir/utils.c.poppler texlive-2007/texk/web2c/pdftexdir/utils.c diff -up texlive-2007/texk/web2c/pdftexdir/utils.c.poppler texlive-2007/texk/web2c/pdftexdir/utils.c
--- texlive-2007/texk/web2c/pdftexdir/utils.c.poppler 2007-01-01 18:20:03.000000000 +0100 --- texlive-2007/texk/web2c/pdftexdir/utils.c.poppler 2007-01-01 18:20:03.000000000 +0100
+++ texlive-2007/texk/web2c/pdftexdir/utils.c 2009-10-15 14:57:43.000000000 +0200 +++ texlive-2007/texk/web2c/pdftexdir/utils.c 2010-08-20 13:37:22.472141499 +0200
@@ -37,7 +37,7 @@ $Id: //depot/Build/source.development/Te @@ -37,7 +37,7 @@ $Id: //depot/Build/source.development/Te
#include "zlib.h" #include "zlib.h"
#include "ptexlib.h" #include "ptexlib.h"
@ -266,7 +285,7 @@ diff -up texlive-2007/texk/web2c/pdftexdir/utils.c.poppler texlive-2007/texk/web
diff -up texlive-2007/texk/web2c/xetexdir/pdfimage.cpp.poppler texlive-2007/texk/web2c/xetexdir/pdfimage.cpp diff -up texlive-2007/texk/web2c/xetexdir/pdfimage.cpp.poppler texlive-2007/texk/web2c/xetexdir/pdfimage.cpp
--- texlive-2007/texk/web2c/xetexdir/pdfimage.cpp.poppler 2006-12-09 11:29:12.000000000 +0100 --- texlive-2007/texk/web2c/xetexdir/pdfimage.cpp.poppler 2006-12-09 11:29:12.000000000 +0100
+++ texlive-2007/texk/web2c/xetexdir/pdfimage.cpp 2009-10-15 14:57:43.000000000 +0200 +++ texlive-2007/texk/web2c/xetexdir/pdfimage.cpp 2010-08-20 13:37:22.474140994 +0200
@@ -11,10 +11,24 @@ @@ -11,10 +11,24 @@
#include "pdfimage.h" #include "pdfimage.h"
@ -307,7 +326,7 @@ diff -up texlive-2007/texk/web2c/xetexdir/pdfimage.cpp.poppler texlive-2007/texk
if (!doc) { if (!doc) {
diff -up texlive-2007/texk/web2c/xetexdir/XeTeX_ext.c.poppler texlive-2007/texk/web2c/xetexdir/XeTeX_ext.c diff -up texlive-2007/texk/web2c/xetexdir/XeTeX_ext.c.poppler texlive-2007/texk/web2c/xetexdir/XeTeX_ext.c
--- texlive-2007/texk/web2c/xetexdir/XeTeX_ext.c.poppler 2007-01-15 14:04:36.000000000 +0100 --- texlive-2007/texk/web2c/xetexdir/XeTeX_ext.c.poppler 2007-01-15 14:04:36.000000000 +0100
+++ texlive-2007/texk/web2c/xetexdir/XeTeX_ext.c 2009-10-15 14:57:43.000000000 +0200 +++ texlive-2007/texk/web2c/xetexdir/XeTeX_ext.c 2010-08-20 13:37:22.475141056 +0200
@@ -33,7 +33,7 @@ authorization from SIL International. @@ -33,7 +33,7 @@ authorization from SIL International.
*/ */
@ -345,8 +364,8 @@ diff -up texlive-2007/texk/web2c/xetexdir/XeTeX_ext.c.poppler texlive-2007/texk/
); );
} }
diff -up texlive-2007/texk/web2c/xetexdir/xetex.mk.poppler texlive-2007/texk/web2c/xetexdir/xetex.mk diff -up texlive-2007/texk/web2c/xetexdir/xetex.mk.poppler texlive-2007/texk/web2c/xetexdir/xetex.mk
--- texlive-2007/texk/web2c/xetexdir/xetex.mk.poppler 2009-10-15 14:57:41.000000000 +0200 --- texlive-2007/texk/web2c/xetexdir/xetex.mk.poppler 2010-08-20 13:37:22.405141336 +0200
+++ texlive-2007/texk/web2c/xetexdir/xetex.mk 2009-10-15 14:57:43.000000000 +0200 +++ texlive-2007/texk/web2c/xetexdir/xetex.mk 2010-08-20 13:37:22.476140978 +0200
@@ -4,6 +4,10 @@ @@ -4,6 +4,10 @@
Makefile: $(srcdir)/xetexdir/xetex.mk Makefile: $(srcdir)/xetexdir/xetex.mk

View File

@ -21,7 +21,7 @@
Name: texlive Name: texlive
Version: %{texlive_ver} Version: %{texlive_ver}
Release: 55%{?dist} Release: 56%{?dist}
Summary: Binaries for the TeX formatting system Summary: Binaries for the TeX formatting system
Group: Applications/Publishing Group: Applications/Publishing
@ -1262,6 +1262,9 @@ fi
%{_mandir}/man1/texutil.1* %{_mandir}/man1/texutil.1*
%changelog %changelog
* Fri Aug 20 2010 Jindrich Novy <jnovy@redhat.com> 2007-56
- fix pdftosrc so that texlive builds with the new poppler
* Thu Aug 19 2010 Rex Dieter <rdieter@fedoraproject.org> - 2007-55 * Thu Aug 19 2010 Rex Dieter <rdieter@fedoraproject.org> - 2007-55
- rebuild (poppler) - rebuild (poppler)