diff options
author | Stefan Schweizer <genstef@gentoo.org> | 2006-05-23 13:25:35 +0000 |
---|---|---|
committer | Stefan Schweizer <genstef@gentoo.org> | 2006-05-23 13:25:35 +0000 |
commit | 47c6db9c79e4e0b8d5cf5f02748d496f9f0c9bda (patch) | |
tree | a22675534f1ebaadb171e957a110befcf3213469 | |
parent | Punt 1.12.0_pre stuff (diff) | |
download | gentoo-2-47c6db9c79e4e0b8d5cf5f02748d496f9f0c9bda.tar.gz gentoo-2-47c6db9c79e4e0b8d5cf5f02748d496f9f0c9bda.tar.bz2 gentoo-2-47c6db9c79e4e0b8d5cf5f02748d496f9f0c9bda.zip |
Fix qt4 build and only install libpoppler-cairo.la with USE=cairo
(Portage version: 2.1_rc1-r2)
3 files changed, 226 insertions, 3 deletions
diff --git a/app-text/poppler-bindings/ChangeLog b/app-text/poppler-bindings/ChangeLog index 1c7f2dfb7621..ec313587ce09 100644 --- a/app-text/poppler-bindings/ChangeLog +++ b/app-text/poppler-bindings/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for app-text/poppler-bindings # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-text/poppler-bindings/ChangeLog,v 1.28 2006/05/23 00:12:25 dang Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-text/poppler-bindings/ChangeLog,v 1.29 2006/05/23 13:25:35 genstef Exp $ + + 23 May 2006; Stefan Schweizer <genstef@gentoo.org> + +files/poppler-0.5.2-qt4-annotation-helper.patch, + poppler-bindings-0.5.2.ebuild: + Fix qt4 build and only install libpoppler-cairo.la with USE=cairo *poppler-bindings-0.5.2 (23 May 2006) diff --git a/app-text/poppler-bindings/files/poppler-0.5.2-qt4-annotation-helper.patch b/app-text/poppler-bindings/files/poppler-0.5.2-qt4-annotation-helper.patch new file mode 100644 index 000000000000..21823f1aad72 --- /dev/null +++ b/app-text/poppler-bindings/files/poppler-0.5.2-qt4-annotation-helper.patch @@ -0,0 +1,217 @@ +diff -Nur poppler-0.5.2/qt4/src.orig/poppler-annotation-helper.h poppler-0.5.2/qt4/src/poppler-annotation-helper.h +--- poppler-0.5.2/qt4/src.orig/poppler-annotation-helper.h 1970-01-01 01:00:00.000000000 +0100 ++++ poppler-0.5.2/qt4/src/poppler-annotation-helper.h 2006-05-23 14:56:20.000000000 +0200 +@@ -0,0 +1,213 @@ ++/* poppler-annotation-helper.h: qt interface to poppler ++ * Copyright (C) 2006, Albert Astals Cid <aacid@kde.org> ++ * Adapting code from ++ * Copyright (C) 2004 by Enrico Ros <eros.kde@email.it> ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2, or (at your option) ++ * any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * 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 this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ */ ++ ++#include <QtCore/QDebug> ++ ++namespace Poppler { ++ ++class XPDFReader ++{ ++ public: ++ // find named symbol and parse it ++ static void lookupName( Dict *, const char *, QString & dest ); ++ static void lookupString( Dict *, const char *, QString & dest ); ++ static void lookupBool( Dict *, const char *, bool & dest ); ++ static void lookupInt( Dict *, const char *, int & dest ); ++ static void lookupNum( Dict *, const char *, double & dest ); ++ static int lookupNumArray( Dict *, const char *, double * dest, int len ); ++ static void lookupColor( Dict *, const char *, QColor & color ); ++ static void lookupIntRef( Dict *, const char *, int & dest ); ++ static void lookupDate( Dict *, const char *, QDateTime & dest ); ++ // transform from user coords to normalized ones using the matrix M ++ static inline void transform( double * M, double x, double y, QPointF &res ); ++}; ++ ++void XPDFReader::lookupName( Dict * dict, const char * type, QString & dest ) ++{ ++ Object nameObj; ++ dict->lookup( type, &nameObj ); ++ if ( nameObj.isNull() ) ++ return; ++ if ( nameObj.isName() ) ++ dest = nameObj.getName(); ++ else ++ qDebug() << type << " is not Name." << endl; ++ nameObj.free(); ++} ++ ++void XPDFReader::lookupString( Dict * dict, const char * type, QString & dest ) ++{ ++ Object stringObj; ++ dict->lookup( type, &stringObj ); ++ if ( stringObj.isNull() ) ++ return; ++ if ( stringObj.isString() ) ++ dest = stringObj.getString()->getCString(); ++ else ++ qDebug() << type << " is not String." << endl; ++ stringObj.free(); ++} ++ ++void XPDFReader::lookupBool( Dict * dict, const char * type, bool & dest ) ++{ ++ Object boolObj; ++ dict->lookup( type, &boolObj ); ++ if ( boolObj.isNull() ) ++ return; ++ if ( boolObj.isBool() ) ++ dest = boolObj.getBool() == gTrue; ++ else ++ qDebug() << type << " is not Bool." << endl; ++ boolObj.free(); ++} ++ ++void XPDFReader::lookupInt( Dict * dict, const char * type, int & dest ) ++{ ++ Object intObj; ++ dict->lookup( type, &intObj ); ++ if ( intObj.isNull() ) ++ return; ++ if ( intObj.isInt() ) ++ dest = intObj.getInt(); ++ else ++ qDebug() << type << " is not Int." << endl; ++ intObj.free(); ++} ++ ++void XPDFReader::lookupNum( Dict * dict, const char * type, double & dest ) ++{ ++ Object numObj; ++ dict->lookup( type, &numObj ); ++ if ( numObj.isNull() ) ++ return; ++ if ( numObj.isNum() ) ++ dest = numObj.getNum(); ++ else ++ qDebug() << type << " is not Num." << endl; ++ numObj.free(); ++} ++ ++int XPDFReader::lookupNumArray( Dict * dict, const char * type, double * dest, int len ) ++{ ++ Object arrObj; ++ dict->lookup( type, &arrObj ); ++ if ( arrObj.isNull() ) ++ return 0; ++ Object numObj; ++ if ( arrObj.isArray() ) ++ { ++ len = qMin( len, arrObj.arrayGetLength() ); ++ for ( int i = 0; i < len; i++ ) ++ { ++ dest[i] = arrObj.arrayGet( i, &numObj )->getNum(); ++ numObj.free(); ++ } ++ } ++ else ++ { ++ len = 0; ++ qDebug() << type << "is not Array." << endl; ++ } ++ arrObj.free(); ++ return len; ++} ++ ++void XPDFReader::lookupColor( Dict * dict, const char * type, QColor & dest ) ++{ ++ double c[3]; ++ if ( XPDFReader::lookupNumArray( dict, type, c, 3 ) == 3 ) ++ dest = QColor( (int)(c[0]*255.0), (int)(c[1]*255.0), (int)(c[2]*255.0)); ++} ++ ++void XPDFReader::lookupIntRef( Dict * dict, const char * type, int & dest ) ++{ ++ Object refObj; ++ dict->lookupNF( type, &refObj ); ++ if ( refObj.isNull() ) ++ return; ++ if ( refObj.isRef() ) ++ dest = refObj.getRefNum(); ++ else ++ qDebug() << type << " is not Ref." << endl; ++ refObj.free(); ++} ++ ++void XPDFReader::lookupDate( Dict * dict, const char * type, QDateTime & dest ) ++{ ++ Object dateObj; ++ dict->lookup( type, &dateObj ); ++ if ( dateObj.isNull() ) ++ return; ++ if ( dateObj.isString() ) ++ { ++ const char * s = dateObj.getString()->getCString(); ++ if ( s[0] == 'D' && s[1] == ':' ) ++ s += 2; ++ int year, mon, day, hour, min, sec; ++ if ( sscanf( s, "%4d%2d%2d%2d%2d%2d", &year, &mon, &day, &hour, &min, &sec ) == 6 ) ++ { ++ QDate d( year, mon, day ); ++ QTime t( hour, min, sec ); ++ if ( d.isValid() && t.isValid() ) ++ dest = QDateTime(d, t); ++ } ++ else ++ qDebug() << "Wrong Date format '" << s << "' for '" << type << "'." << endl; ++ } ++ else ++ qDebug() << type << " is not Date" << endl; ++ dateObj.free(); ++} ++ ++void XPDFReader::transform( double * M, double x, double y, QPointF &res ) ++{ ++ res.setX( M[0] * x + M[2] * y + M[4] ); ++ res.setY( M[1] * x + M[3] * y + M[5] ); ++} ++ ++/** @short Helper classes for CROSSDEPS resolving and DS conversion. */ ++struct ResolveRevision ++{ ++ int prevAnnotationID; // ID of the annotation to be reparended ++ int nextAnnotationID; // (only needed for speeding up resolving) ++ Annotation * nextAnnotation; // annotation that will act as parent ++ Annotation::RevScope nextScope; // scope of revision (Reply) ++ Annotation::RevType nextType; // type of revision (None) ++}; ++ ++struct ResolveWindow ++{ ++ int popupWindowID; // ID of the (maybe shared) window ++ Annotation * annotation; // annotation having the popup window ++}; ++ ++struct PostProcessText // this handles a special pdf case conversion ++{ ++ Annotation * textAnnotation; // a popup text annotation (not FreeText) ++ bool opened; // pdf property to convert to window flags ++}; ++ ++struct PopupWindow ++{ ++ Annotation * dummyAnnotation; // window properties (in pdf as Annotation) ++ bool shown; // converted to Annotation::Hidden flag ++}; ++ ++} diff --git a/app-text/poppler-bindings/poppler-bindings-0.5.2.ebuild b/app-text/poppler-bindings/poppler-bindings-0.5.2.ebuild index 241909fbea67..ecd23038ae53 100644 --- a/app-text/poppler-bindings/poppler-bindings-0.5.2.ebuild +++ b/app-text/poppler-bindings/poppler-bindings-0.5.2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-text/poppler-bindings/poppler-bindings-0.5.2.ebuild,v 1.1 2006/05/23 00:12:25 dang Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-text/poppler-bindings/poppler-bindings-0.5.2.ebuild,v 1.2 2006/05/23 13:25:35 genstef Exp $ inherit autotools eutils multilib @@ -31,6 +31,7 @@ S="${WORKDIR}/${MY_P}" src_unpack(){ unpack ${A} + epatch ${FILESDIR}/${MY_P}-qt4-annotation-helper.patch cd ${S} epatch ${FILESDIR}/${MY_P}-bindings.patch @@ -61,7 +62,7 @@ src_compile() { } src_install() { - dolib.a poppler/libpoppler-cairo.la + use cairo && dolib.a poppler/libpoppler-cairo.la make DESTDIR=${D} install || die "make install failed" } |