aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorprspkt <prspkt@protonmail.com>2020-06-29 22:54:32 +0300
committerLeo <thinkabit.ukim@gmail.com>2020-06-29 20:40:45 +0000
commit6907aa6272c7d980015512086c34274a8f906789 (patch)
tree9ae3e078e582355ab2ab3e4af6edc6efdd769de4
parent03b6efff108f4e4fd0c0a8025cdc62dfd8edadb5 (diff)
downloadaports-6907aa6272c7d980015512086c34274a8f906789.tar.gz
aports-6907aa6272c7d980015512086c34274a8f906789.tar.bz2
aports-6907aa6272c7d980015512086c34274a8f906789.tar.xz
community/xpdf: upgrade to 4.02
* Switch to cmake as per upstream. * Linking fails without fPIC, add it to {C,CXX}FLAGS.
-rw-r--r--community/xpdf/APKBUILD50
-rw-r--r--community/xpdf/permissions.patch125
-rw-r--r--community/xpdf/xpdf-3.04-protection.patch84
-rw-r--r--community/xpdf/xpdfrc91
4 files changed, 152 insertions, 198 deletions
diff --git a/community/xpdf/APKBUILD b/community/xpdf/APKBUILD
index b28a2114b7..1161cb6e25 100644
--- a/community/xpdf/APKBUILD
+++ b/community/xpdf/APKBUILD
@@ -1,42 +1,46 @@
# Contributor: Isaac Dunham <ibid.ag@gmail.com>
# Maintainer: Isaac Dunham <ibid.ag@gmail.com>
pkgname=xpdf
-pkgver="3.04"
-pkgrel=4
+pkgver=4.02
+pkgrel=0
pkgdesc="The classic X11 PDF viewer"
url="https://www.xpdfreader.com"
arch="all"
license="GPL-2.0-or-later OR GPL-3.0-or-later"
depends="ghostscript-fonts"
-makedepends="motif-dev freetype-dev libpng-dev"
+makedepends="cmake qt5-qtbase-dev"
subpackages="$pkgname-doc"
-source="https://xpdfreader-dl.s3.amazonaws.com/old/xpdf-$pkgver.tar.gz
- xpdf-3.04-protection.patch
- xpdfrc"
+source="https://xpdfreader-dl.s3.amazonaws.com/xpdf-$pkgver.tar.gz
+ permissions.patch"
build() {
- ./configure \
- --with-x \
- --with-freetype2-includes=/usr/include/freetype2 \
- --build=$CBUILD \
- --host=$CHOST \
- --prefix=/usr \
- --sysconfdir=/etc \
- --mandir=/usr/share/man \
- --infodir=/usr/share/info \
- --localstatedir=/var
- make
+ if [ "$CBUILD" != "$CHOST" ]; then
+ CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
+ fi
+ cmake -B build \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LIBDIR=lib \
+ -DBUILD_SHARED_LIBS=True \
+ -DCMAKE_BUILD_TYPE=None \
+ -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS -fPIC" \
+ -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS -fPIC" \
+ -DSYSTEM_XPDFRC=/etc/xpdfrc \
+ $CMAKE_CROSSOPTS
+ make -C build
}
package() {
- make DESTDIR="$pkgdir" install
- #delete pdf* utils that conflict with poppler-utils.
+ make -C build DESTDIR="$pkgdir" install
+
+ # delete pdf* utils and associated man pages that conflict with
+ # poppler-utils.
rm -f "$pkgdir"/usr/bin/pdf*
rm -f "$pkgdir"/usr/share/man/man1/pdf*
- #install xpdfrc so fonts get picked up
- cp "$srcdir"/xpdfrc "$pkgdir"/etc/xpdfrc
+
+ # install xpdfrc
+ install -Dm644 doc/sample-xpdfrc "$pkgdir"/etc/xpdfrc
}
-sha512sums="3fb3c380fdbd13d937449ae3f7d7a163815cc85296d30be7b9907687884385d6171bb48ee5d5c13368d6bba87740b678f491bdcf61b38d130809e9afa260f6cf xpdf-3.04.tar.gz
-4c6360731ad60ed45e0612b016116a9588f293267ee3e2c1f7cd2f046f045f165334c6e7fceb6b51b3181adb7a74087036a28fcec0e04b23e6374ffc421c1f54 xpdf-3.04-protection.patch
+sha512sums="72c9413fc7241dde5288137ca8a68c837d2a68e95e909dbe2afe8f374b5a7c92af4edf82918963d1c6388c947057fcf5f0ae1e6fbb2b31c3d5eb9a07d3c74ddc xpdf-4.02.tar.gz
+cf56bf9b4ccecc85fd34805454513b921bfe044442dad129178cde6f9ff2fae322bf0d71aaa69b9456aa0f41d639bc3a6aa2c7dcaae177013ac45e92f9fc3125 permissions.patch
7e8404fa5432bad578c29cf3ccd276bb64cd0316b700e40ce606b6b6261c497125e8689c6e545cab2adb04d69b1ed25d1e0d07155add9837e6bb44d5f18d82d3 xpdfrc"
diff --git a/community/xpdf/permissions.patch b/community/xpdf/permissions.patch
new file mode 100644
index 0000000000..52db040674
--- /dev/null
+++ b/community/xpdf/permissions.patch
@@ -0,0 +1,125 @@
+--- a/xpdf/pdfimages.cc
++++ b/xpdf/pdfimages.cc
+@@ -4,6 +4,8 @@
+ //
+ // Copyright 1998-2003 Glyph & Cog, LLC
+ //
++// Modified for Debian by Hamish Moffatt, 22 May 2002.
++//
+ //========================================================================
+
+ #include <aconf.h>
+@@ -127,12 +129,14 @@ int main(int argc, char *argv[]) {
+ }
+
+ // check for copy permission
++#ifdef ENFORCE_PERMISSIONS
+ if (!doc->okToCopy()) {
+ error(errNotAllowed, -1,
+ "Copying of images from this document is not allowed.");
+ exitCode = 3;
+ goto err1;
+ }
++#endif
+
+ // get page range
+ if (firstPage < 1)
+--- a/xpdf/pdftohtml.cc
++++ b/xpdf/pdftohtml.cc
+@@ -138,6 +138,7 @@ int main(int argc, char *argv[]) {
+ goto err1;
+ }
+
++#ifdef ENFORCE_PERMISSIONS
+ // check for copy permission
+ if (!doc->okToCopy()) {
+ error(errNotAllowed, -1,
+@@ -145,6 +146,7 @@ int main(int argc, char *argv[]) {
+ exitCode = 3;
+ goto err1;
+ }
++#endif
+
+ // get page range
+ if (firstPage < 1) {
+--- a/xpdf/pdftops.cc
++++ b/xpdf/pdftops.cc
+@@ -4,6 +4,8 @@
+ //
+ // Copyright 1996-2003 Glyph & Cog, LLC
+ //
++// Modified for Debian by Hamish Moffatt, 22 May 2002.
++//
+ //========================================================================
+
+ #include <aconf.h>
+@@ -318,12 +320,14 @@ int main(int argc, char *argv[]) {
+ goto err1;
+ }
+
++#ifdef ENFORCE_PERMISSIONS
+ // check for print permission
+ if (!doc->okToPrint()) {
+ error(errNotAllowed, -1, "Printing this document is not allowed.");
+ exitCode = 3;
+ goto err1;
+ }
++#endif
+
+ // construct PostScript file name
+ if (argc == 3) {
+--- a/xpdf/pdftotext.cc
++++ b/xpdf/pdftotext.cc
+@@ -4,6 +4,8 @@
+ //
+ // Copyright 1997-2013 Glyph & Cog, LLC
+ //
++// Modified for Debian by Hamish Moffatt, 22 May 2002.
++//
+ //========================================================================
+
+ #include <aconf.h>
+@@ -209,6 +211,7 @@ int main(int argc, char *argv[]) {
+ goto err2;
+ }
+
++#ifdef ENFORCE_PERMISSIONS
+ // check for copy permission
+ if (!doc->okToCopy()) {
+ error(errNotAllowed, -1,
+@@ -216,6 +219,7 @@ int main(int argc, char *argv[]) {
+ exitCode = 3;
+ goto err2;
+ }
++#endif
+
+ // construct text file name
+ if (argc == 3) {
+--- a/xpdf-qt/QtPDFCore.cc
++++ b/xpdf-qt/QtPDFCore.cc
+@@ -446,9 +446,11 @@ QString QtPDFCore::getSelectedTextQStrin
+ QString qs;
+ int i;
+
++#ifdef ENFORCE_PERMISSIONS
+ if (!doc->okToCopy()) {
+ return "";
+ }
++#endif
+ if (!(s = getSelectedText())) {
+ return "";
+ }
+--- a/xpdf-qt/XpdfWidget.cc
++++ b/xpdf-qt/XpdfWidget.cc
+@@ -1440,7 +1440,11 @@ bool XpdfWidget::okToExtractText() const
+ if (!core->getDoc()) {
+ return false;
+ }
++#ifdef ENFORCE_PERMISSIONS
+ return (bool)core->getDoc()->okToCopy();
++#else
++ return true;
++#endif
+ } catch (GMemException e) {
+ return false;
+ }
diff --git a/community/xpdf/xpdf-3.04-protection.patch b/community/xpdf/xpdf-3.04-protection.patch
deleted file mode 100644
index 677db00095..0000000000
--- a/community/xpdf/xpdf-3.04-protection.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-Port Johannes Bauer's protection patch to 3.04.
-This does NOT disable the error messages, since the user should
-be aware of the author's intent.
-
-Also, this does not deal with permission to print.
-
-diff --git a/xpdf/PDFCore.cc b/xpdf/PDFCore.cc
-index 34b6483..e93fe52 100644
---- a/xpdf/PDFCore.cc
-+++ b/xpdf/PDFCore.cc
-@@ -1677,9 +1677,6 @@ GString *PDFCore::extractText(int pg, double xMin, double yMin,
- int x0, y0, x1, y1, t;
- GString *s;
-
-- if (!doc->okToCopy()) {
-- return NULL;
-- }
- if ((page = findPage(pg))) {
- cvtUserToDev(pg, xMin, yMin, &x0, &y0);
- cvtUserToDev(pg, xMax, yMax, &x1, &y1);
-diff --git a/xpdf/XPDFCore.cc b/xpdf/XPDFCore.cc
-index 9a3725f..1562c7a 100644
---- a/xpdf/XPDFCore.cc
-+++ b/xpdf/XPDFCore.cc
-@@ -384,9 +384,8 @@ void XPDFCore::endSelection(int wx, int wy) {
- #ifndef NO_TEXT_SELECT
- if (selectULX != selectLRX &&
- selectULY != selectLRY) {
-- if (doc->okToCopy()) {
- copySelection();
-- } else {
-+ if (!doc->okToCopy()) {
- error(errNotAllowed, -1,
- "Copying of text from this document is not allowed.");
- }
-@@ -408,9 +407,6 @@ void XPDFCore::copySelection() {
- int pg;
- double ulx, uly, lrx, lry;
-
-- if (!doc->okToCopy()) {
-- return;
-- }
- if (getSelection(&pg, &ulx, &uly, &lrx, &lry)) {
- //~ for multithreading: need a mutex here
- if (currentSelection) {
-diff --git a/xpdf/pdfimages.cc b/xpdf/pdfimages.cc
-index dc79443..9aaa811 100644
---- a/xpdf/pdfimages.cc
-+++ b/xpdf/pdfimages.cc
-@@ -122,8 +122,6 @@ int main(int argc, char *argv[]) {
- if (!doc->okToCopy()) {
- error(errNotAllowed, -1,
- "Copying of images from this document is not allowed.");
-- exitCode = 3;
-- goto err1;
- }
-
- // get page range
-diff --git a/xpdf/pdftohtml.cc b/xpdf/pdftohtml.cc
-index f1fe691..824233e 100644
---- a/xpdf/pdftohtml.cc
-+++ b/xpdf/pdftohtml.cc
-@@ -134,8 +134,6 @@ int main(int argc, char *argv[]) {
- if (!doc->okToCopy()) {
- error(errNotAllowed, -1,
- "Copying of text from this document is not allowed.");
-- exitCode = 3;
-- goto err1;
- }
-
- // get page range
-diff --git a/xpdf/pdftotext.cc b/xpdf/pdftotext.cc
-index 758413e..e6779fa 100644
---- a/xpdf/pdftotext.cc
-+++ b/xpdf/pdftotext.cc
-@@ -192,8 +192,6 @@ int main(int argc, char *argv[]) {
- if (!doc->okToCopy()) {
- error(errNotAllowed, -1,
- "Copying of text from this document is not allowed.");
-- exitCode = 3;
-- goto err2;
- }
-
- // construct text file name
diff --git a/community/xpdf/xpdfrc b/community/xpdf/xpdfrc
deleted file mode 100644
index b51b522818..0000000000
--- a/community/xpdf/xpdfrc
+++ /dev/null
@@ -1,91 +0,0 @@
-#========================================================================
-#
-# Sample xpdfrc file
-#
-# The Xpdf tools look for a config file in two places:
-# 1. ~/.xpdfrc
-# 2. in a system-wide directory, typically /usr/local/etc/xpdfrc
-#
-# This sample config file demonstrates some of the more common
-# configuration options. Everything here is commented out. You
-# should edit things (especially the file/directory paths, since
-# they'll likely be different on your system), and uncomment whichever
-# options you want to use. For complete details on config file syntax
-# and available options, please see the xpdfrc(5) man page.
-#
-# Also, the Xpdf language support packages each include a set of
-# options to be added to the xpdfrc file.
-#
-# http://www.foolabs.com/xpdf/
-#
-#========================================================================
-
-#----- display fonts
-
-# These map the Base-14 fonts to the Type 1 fonts that ship with
-# ghostscript. You'll almost certainly want to use something like
-# this, but you'll need to adjust this to point to wherever
-# ghostscript is installed on your system. (But if the fonts are
-# installed in a "standard" location, xpdf will find them
-# automatically.)
-
-fontFile Times-Roman /usr/share/fonts/Type1/n021003l.pfb
-fontFile Times-Italic /usr/share/fonts/Type1/n021023l.pfb
-fontFile Times-Bold /usr/share/fonts/Type1/n021004l.pfb
-fontFile Times-BoldItalic /usr/share/fonts/Type1/n021024l.pfb
-fontFile Helvetica /usr/share/fonts/Type1/n019003l.pfb
-fontFile Helvetica-Oblique /usr/share/fonts/Type1/n019023l.pfb
-fontFile Helvetica-Bold /usr/share/fonts/Type1/n019004l.pfb
-fontFile Helvetica-BoldOblique /usr/share/fonts/Type1/n019024l.pfb
-fontFile Courier /usr/share/fonts/Type1/n022003l.pfb
-fontFile Courier-Oblique /usr/share/fonts/Type1/n022023l.pfb
-fontFile Courier-Bold /usr/share/fonts/Type1/n022004l.pfb
-fontFile Courier-BoldOblique /usr/share/fonts/Type1/n022024l.pfb
-fontFile Symbol /usr/share/fonts/Type1/s050000l.pfb
-fontFile ZapfDingbats /usr/share/fonts/Type1/d050000l.pfb
-
-# If you need to display PDF files that refer to non-embedded fonts,
-# you should add one or more fontDir options to point to the
-# directories containing the font files. Xpdf will only look at .pfa,
-# .pfb, .ttf, and .ttc files in those directories (other files will
-# simply be ignored).
-
-#fontDir /usr/local/fonts/bakoma
-
-#----- PostScript output control
-
-# Set the default PostScript file or command.
-
-#psFile "|lpr -Pmyprinter"
-
-# Set the default PostScript paper size -- this can be letter, legal,
-# A4, or A3. You can also specify a paper size as width and height
-# (in points).
-
-psPaperSize letter
-
-#----- text output control
-
-# Choose a text encoding for copy-and-paste and for pdftotext output.
-# The Latin1, ASCII7, and UTF-8 encodings are built into Xpdf. Other
-# encodings are available in the language support packages.
-
-textEncoding UTF-8
-
-# Choose the end-of-line convention for multi-line copy-and-past and
-# for pdftotext output. The available options are unix, mac, and dos.
-
-#textEOL unix
-
-#----- misc settings
-
-# Enable FreeType, and anti-aliased text.
-
-enableFreeType yes
-antialias yes
-
-# Set the command used to run a web browser when a URL hyperlink is
-# clicked.
-
-#launchCommand viewer-script
-urlCommand "firefox '%s'"