diff options
-rw-r--r-- | office/diffpdf/README | 8 | ||||
-rw-r--r-- | office/diffpdf/diffpdf-2.1.3-qt5.patch | 173 | ||||
-rw-r--r-- | office/diffpdf/diffpdf.SlackBuild | 38 | ||||
-rw-r--r-- | office/diffpdf/diffpdf.desktop | 2 |
4 files changed, 197 insertions, 24 deletions
diff --git a/office/diffpdf/README b/office/diffpdf/README index de00a8e90b1ca..586322033f8d4 100644 --- a/office/diffpdf/README +++ b/office/diffpdf/README @@ -1,5 +1,5 @@ -DiffPDF can compare two PDF files. It offers three comparison modes: Words, -Characters, and Appearance. +DiffPDF can compare two PDF files. It offers three comparison modes: +Words, Characters, and Appearance. -Please note that this is the opensource edition that is not developed anymore -since 2013 in favour of the commercial DiffPDF solution. +Please note that this is the opensource edition that is not developed +anymore since 2013 in favour of the commercial DiffPDF solution. diff --git a/office/diffpdf/diffpdf-2.1.3-qt5.patch b/office/diffpdf/diffpdf-2.1.3-qt5.patch new file mode 100644 index 0000000000000..a7821388aa87f --- /dev/null +++ b/office/diffpdf/diffpdf-2.1.3-qt5.patch @@ -0,0 +1,173 @@ +Description: Build with Qt5 + Enough changes to make things build with Qt5 +Author: Sune Vuorela <sune@debian.org> + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: <vendor|upstream|other>, <url of original patch> +Bug: <url in upstream bugtracker> +Bug-Debian: https://bugs.debian.org/<bugnumber> +Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber> +Forwarded: <no|not-needed|url proving that it has been forwarded> +Reviewed-By: <name and email of someone who approved the patch> +Last-Update: 2017-11-25 + +--- diffpdf-2.1.3.orig/aboutform.cpp ++++ diffpdf-2.1.3/aboutform.cpp +@@ -11,7 +11,6 @@ + */ + + #include "aboutform.hpp" +-#include <poppler-version.h> + #include <QApplication> + #include <QHBoxLayout> + #include <QSettings> +@@ -52,7 +51,7 @@ AboutForm::AboutForm(QWidget *parent) : + "</ul>" + "I also provide training and consultancy in C++, Go, Python 2, " + "Python 3, C++/Qt, and PyQt4.").arg(qApp->applicationName()) +- .arg(Version).arg(qVersion()).arg(POPPLER_VERSION)); ++ .arg(Version).arg(qVersion()).arg("Qt 5")); + QTextBrowser *contributorsBrowser = new QTextBrowser; + contributorsBrowser->setReadOnly(true); + contributorsBrowser->setHtml(tr("<table>" +--- diffpdf-2.1.3.orig/diffpdf.pro ++++ diffpdf-2.1.3/diffpdf.pro +@@ -31,35 +31,39 @@ TRANSLATIONS += diffpdf_fr.ts + TRANSLATIONS += diffpdf_de.ts + TRANSLATIONS += diffpdf_es.ts + CODECFORTR = UTF-8 +-LIBS += -lpoppler-qt4 ++LIBS += -lpoppler-qt5 ++ QMAKE_CFLAGS += $$(CPPFLAGS) $$(CFLAGS) ++ QMAKE_CXXFLAGS += $$(CPPFLAGS) $$(CXXFLAGS) ++ QMAKE_LFLAGS += $$(LDFLAGS) ++QT += widgets printsupport + win32 { + CONFIG += release + } + exists($(HOME)/opt/poppler024/) { + message(Using locally built Poppler library) + INCLUDEPATH += $(HOME)/opt/poppler024/include/poppler/cpp +- INCLUDEPATH += $(HOME)/opt/poppler024/include/poppler/qt4 ++ INCLUDEPATH += $(HOME)/opt/poppler024/include/poppler/qt5 + LIBS += -Wl,-rpath -Wl,$(HOME)/opt/poppler024/lib -L$(HOME)/opt/poppler024/lib + } else { + exists(/poppler_lib) { + message(Using locally built Poppler library on Windows) + INCLUDEPATH += /c/poppler_lib/include/poppler/cpp +- INCLUDEPATH += /c/poppler_lib/include/poppler/qt4 ++ INCLUDEPATH += /c/poppler_lib/include/poppler/qt5 + LIBS += -Wl,-rpath -Wl,/c/poppler_lib/bin -Wl,-L/c/poppler_lib/bin + } else { +- exists(/usr/include/poppler/qt4) { ++ exists(/usr/include/poppler/qt5) { + INCLUDEPATH += /usr/include/poppler/cpp +- INCLUDEPATH += /usr/include/poppler/qt4 ++ INCLUDEPATH += /usr/include/poppler/qt5 + } else { + INCLUDEPATH += /usr/local/include/poppler/cpp +- INCLUDEPATH += /usr/local/include/poppler/qt4 ++ INCLUDEPATH += /usr/local/include/poppler/qt5 + } + } + } + #exists($(HOME)/opt/podofo09/) { + # message(Using locally built PoDoFo library) + # INCLUDEPATH += $(HOME)/opt/podofo09/include/poppler/cpp +-# INCLUDEPATH += $(HOME)/opt/podofo09/include/poppler/qt4 ++# INCLUDEPATH += $(HOME)/opt/podofo09/include/poppler/qt5 + # LIBS += -Wl,-rpath -Wl,$(HOME)/opt/podofo09/lib64 -Wl,-L$(HOME)/opt/podofo09/lib64 + #} else { + # exists(/usr/include/podofo) { +--- diffpdf-2.1.3.orig/generic.hpp ++++ diffpdf-2.1.3/generic.hpp +@@ -12,7 +12,7 @@ + for more details. + */ + +-#include <poppler-qt4.h> ++#include <poppler-qt5.h> + #include <QMetaType> + #include <QPair> + #include <QPixmap> +--- diffpdf-2.1.3.orig/helpform.cpp ++++ diffpdf-2.1.3/helpform.cpp +@@ -11,7 +11,6 @@ + */ + + #include "helpform.hpp" +-#include <poppler-version.h> + #include <QApplication> + #include <QFile> + #include <QKeySequence> +--- diffpdf-2.1.3.orig/label.cpp ++++ diffpdf-2.1.3/label.cpp +@@ -15,6 +15,7 @@ + #include <QDragEnterEvent> + #include <QDragEnterEvent> + #include <QMouseEvent> ++#include <QMimeData> + + Label::Label(QWidget *parent) : QLabel(parent) + { +--- diffpdf-2.1.3.orig/lineedit.cpp ++++ diffpdf-2.1.3/lineedit.cpp +@@ -14,6 +14,7 @@ + #include "lineedit.hpp" + #include <QDragEnterEvent> + #include <QDragEnterEvent> ++#include <QMimeData> + + + LineEdit::LineEdit(QWidget *parent) : QLineEdit(parent) +--- diffpdf-2.1.3.orig/main.cpp ++++ diffpdf-2.1.3/main.cpp +@@ -31,7 +31,6 @@ int main(int argc, char *argv[]) + app.setOrganizationDomain("qtrac.eu"); + app.setApplicationName("DiffPDF"); + app.setWindowIcon(QIcon(":/icon.png")); +- QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8")); + + QTextStream out(stdout); + QStringList args = app.arguments().mid(1); +--- diffpdf-2.1.3.orig/mainwindow.hpp ++++ diffpdf-2.1.3/mainwindow.hpp +@@ -19,7 +19,7 @@ + #else + #include <tr1/memory> + #endif +-#include <poppler-qt4.h> ++#include <poppler-qt5.h> + #include <QBrush> + #include <QList> + #include <QMainWindow> +--- diffpdf-2.1.3.orig/optionsform.cpp ++++ diffpdf-2.1.3/optionsform.cpp +@@ -76,9 +76,9 @@ void OptionsForm::createWidgets() + << qMakePair(tr("Diagonal \\"), Qt::FDiagPattern) + << qMakePair(tr("Diagonal Cross"), Qt::DiagCrossPattern)) + brushStyleComboBox->addItem(brushSwatch(pair.second, color), +- pair.first, pair.second); ++ pair.first, QVariant::fromValue(pair.second)); + brushStyleComboBox->setCurrentIndex(brushStyleComboBox->findData( +- brush.style())); ++ QVariant::fromValue(brush.style()))); + + penStyleComboBox = new QComboBox; + typedef QPair<QString, Qt::PenStyle> PenPair; +@@ -90,9 +90,9 @@ void OptionsForm::createWidgets() + << qMakePair(tr("Dash-Dotted"), Qt::DashDotLine) + << qMakePair(tr("Dash-Dot-Dotted"), Qt::DashDotDotLine)) + penStyleComboBox->addItem(penStyleSwatch(pair.second, color), +- pair.first, pair.second); ++ pair.first, QVariant::fromValue(pair.second)); + penStyleComboBox->setCurrentIndex(penStyleComboBox->findData( +- pen.style())); ++ QVariant::fromValue(pen.style()))); + + alphaSpinBox = new QSpinBox; + alphaSpinBox->setRange(1, 100); diff --git a/office/diffpdf/diffpdf.SlackBuild b/office/diffpdf/diffpdf.SlackBuild index 33fbcf5c451fd..7b7e3ffdabf8b 100644 --- a/office/diffpdf/diffpdf.SlackBuild +++ b/office/diffpdf/diffpdf.SlackBuild @@ -28,11 +28,16 @@ # # 1 - Initial release. +# 20220217 bkw: Modified by SlackBuilds.org, BUILD=2: +# - fix build on 15.0 (by way of patching for qt5). +# - install icon with correct name (not "icon.png"). +# - fix .desktop file (absolute path to icon). + cd $(dirname $0) ; CWD=$(pwd) PRGNAM=diffpdf VERSION=${VERSION:-2.1.3} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} DOCS="README CHANGES" @@ -45,9 +50,6 @@ if [ -z "$ARCH" ]; then esac fi -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -82,31 +84,29 @@ cd $PRGNAM-$VERSION chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ - -o -perm 511 \) -exec chmod 755 {} \; -o \ + -o -perm 511 \) -exec chmod 755 {} \+ -o \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ - -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+ + +# 20220217 bkw: this is a qt4 app, but we can't build it against our qt4, +# because it also needs poppler to be built with qt4 support (ours has +# qt5). so patch it for qt5, with a patch from gentoo: +# https://github.com/calculatelinux/gentoo/raw/master/app-text/diffpdf/files/diffpdf-2.1.3-qt5.patch +patch -p1 < $CWD/diffpdf-2.1.3-qt5.patch -CFLAGS="$SLKCFLAGS" \ -CXXFLAGS="$SLKCFLAGS" \ -lrelease diffpdf.pro -qmake +lrelease-qt5 diffpdf.pro +qmake-qt5 make make install PREFIX=/usr DESTDIR=$PKG # Manual installation hereon mkdir -p $PKG/usr/bin $PKG/usr/man/man1 $PKG/usr/share/applications $PKG/usr/share/pixmaps -install -m0755 diffpdf $PKG/usr/bin -install -m0644 diffpdf.1 $PKG/usr/man/man1 -install -m0644 images/icon.png $PKG/usr/share/pixmaps +install -m0755 -s $PRGNAM $PKG/usr/bin +gzip -9c < $PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz +install -m0644 images/icon.png $PKG/usr/share/pixmaps/$PRGNAM.png install -m0644 $CWD/diffpdf.desktop $PKG/usr/share/applications -find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ - | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true - -find $PKG/usr/man -type f -exec gzip -9 {} \; -for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done - mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild diff --git a/office/diffpdf/diffpdf.desktop b/office/diffpdf/diffpdf.desktop index 03af7179bdfcd..5fe9e389ecb52 100644 --- a/office/diffpdf/diffpdf.desktop +++ b/office/diffpdf/diffpdf.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Name=diffpdf Comment=diffpdf - compare PDF files -Icon=diffpdf +Icon=/usr/share/pixmaps/diffpdf.png Exec=diffpdf Type=Application Terminal=false |