MFH: r514602 r515847

converters/pdf2djvu: fix build on GCC architectures

When compiling with GCC, as used on GCC architectures, it errors with:
sys-uuid.cc:96:12: error: 'strlen' was not declared in this scope

assert(strlen(s) == 36U);
       ^~~~~~

sys-uuid.cc:96:12: note: 'strlen' is defined in header '<cstring>'; did you forget to '#include <cstring>'?

converters/pdf2djvu: Update to 0.9.13

Remove now obsolete patches that were merged by upstream:

* Build fixes for graphics/poppler >= 0.76.0
* Improvement of build-time logging

While I'm here:
* Add path to LICENSE_FILE
* Fix no-op occurence of DOCS_DESC

Changelog:

https://github.com/jwilk/pdf2djvu/blob/0.9.13/doc/changelog

PR:		239366
Submitted by:	Samy Mahmoudi <samy.mahmoudi@gmail.com> (maintainer)

Approved by:	ports-secteam (miwi)
This commit is contained in:
Kai Knoblich 2019-10-30 00:04:04 +00:00
parent a2ae692739
commit 5c659183bf
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/branches/2019Q4/; revision=516041
7 changed files with 17 additions and 168 deletions

View file

@ -1,8 +1,7 @@
# $FreeBSD$
PORTNAME= pdf2djvu
PORTVERSION= 0.9.12
PORTREVISION= 12
PORTVERSION= 0.9.13
CATEGORIES= converters
MASTER_SITES= https://github.com/jwilk/${PORTNAME}/releases/download/${PORTVERSION}/
@ -10,6 +9,7 @@ MAINTAINER= samy.mahmoudi@gmail.com
COMMENT= Creates DjVu files from PDF files
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/doc/COPYING
BUILD_DEPENDS= ${LOCALBASE}/include/pstreams/pstream.h:devel/pstreams
LIB_DEPENDS= libdjvulibre.so:graphics/djvulibre \
@ -26,7 +26,7 @@ OPTIONS_DEFAULT=COLOR_QUANTIZATION MULTITHREADING XMP
OPTIONS_SUB= yes
COLOR_QUANTIZATION_DESC=Color quantization via GraphicsMagick++
DOCS= Generate the man page
DOCS_DESC= Generate the man page
NLS_DESC= Native Language Support via gettext utilities
MULTITHREADING_DESC= Multithreading support via OpenMP
XMP_DESC= XMP metadata support via Exiv2

View file

@ -1,3 +1,3 @@
TIMESTAMP = 1552404105
SHA256 (pdf2djvu-0.9.12.tar.xz) = 03fa9d9aa1b8086b562e2461ed74e5f9f008f16bfc1459ba62fa3738b37d8e83
SIZE (pdf2djvu-0.9.12.tar.xz) = 295088
TIMESTAMP = 1571734947
SHA256 (pdf2djvu-0.9.13.tar.xz) = e0ab16d83129625c86df7c121eddf286458f63cb81ae791e5a76df10a3ab4c63
SIZE (pdf2djvu-0.9.13.tar.xz) = 296420

View file

@ -1,35 +0,0 @@
From aa3fdae51c19ad2865f92882ec9007feeb7e477a Mon Sep 17 00:00:00 2001
From: Jakub Wilk <jwilk@jwilk.net>
Date: Mon, 1 Apr 2019 08:23:51 +0200
Subject: [PATCH] Put Ref in pdf namespace.
---
pdf-backend.hh | 1 +
pdf2djvu.cc | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/pdf-backend.hh b/pdf-backend.hh
index 43899c0..d7872c3 100644
--- pdf-backend.hh
+++ pdf-backend.hh
@@ -82,6 +82,7 @@ namespace pdf
typedef ::Catalog Catalog;
typedef ::GooString String;
typedef ::Goffset Offset;
+ typedef ::Ref Ref;
/* type definitions — annotations
* ==============================
diff --git a/pdf2djvu.cc b/pdf2djvu.cc
index 669eba5..d9e1532 100644
--- pdf2djvu.cc
+++ pdf2djvu.cc
@@ -86,7 +86,7 @@ static int get_page_for_goto_link(pdf::link::GoTo *goto_link, pdf::Catalog *cata
int page;
if (dest->isPageRef())
{
- Ref pageref = dest->getPageRef();
+ pdf::Ref pageref = dest->getPageRef();
page = catalog->findPage(pageref.num, pageref.gen);
}
else

View file

@ -1,69 +0,0 @@
From 8b0348b3d5f33494d7e637411633fbea511a78d7 Mon Sep 17 00:00:00 2001
From: Jakub Wilk <jwilk@jwilk.net>
Date: Mon, 1 Apr 2019 08:49:02 +0200
Subject: [PATCH] Use Catalog::findPage(Ref) as alternative to
Catalog::findPage(int, int).
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes:
pdf2djvu.cc: In function int get_page_for_goto_link(pdf::link::GoTo*, pdf::Catalog*):
pdf2djvu.cc:90:56: error: no matching function for call to Catalog::findPage(int&, int&)
---
pdf-backend.cc | 15 +++++++++++++++
pdf-backend.hh | 2 ++
pdf2djvu.cc | 2 +-
3 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/pdf-backend.cc b/pdf-backend.cc
index f1d7662..a1b9b63 100644
--- pdf-backend.cc
+++ pdf-backend.cc
@@ -631,4 +631,19 @@ const char * pdf::get_c_string(const pdf::String *str)
}
#endif
+template <typename C> static auto find_page_impl(C *catalog, pdf::Ref pgref) -> decltype(catalog->findPage(0, 0))
+{
+ return catalog->findPage(pgref.num, pgref.gen);
+}
+
+template <typename C> static auto find_page_impl(C *catalog, pdf::Ref pgref) -> decltype(catalog->findPage(pgref))
+{
+ return catalog->findPage(pgref);
+}
+
+int pdf::find_page(pdf::Catalog *catalog, pdf::Ref pgref)
+{
+ return find_page_impl<pdf::Catalog>(catalog, pgref);
+}
+
// vim:ts=2 sts=2 sw=2 et
diff --git a/pdf-backend.hh b/pdf-backend.hh
index d7872c3..d88c956 100644
--- pdf-backend.hh
+++ pdf-backend.hh
@@ -436,6 +436,8 @@ namespace pdf
const char * get_c_string(const pdf::String *str);
+ int find_page(pdf::Catalog *catalog, pdf::Ref pgref);
+
}
#endif
diff --git a/pdf2djvu.cc b/pdf2djvu.cc
index d9e1532..21f2d50 100644
--- pdf2djvu.cc
+++ pdf2djvu.cc
@@ -87,7 +87,7 @@ static int get_page_for_goto_link(pdf::link::GoTo *goto_link, pdf::Catalog *cata
if (dest->isPageRef())
{
pdf::Ref pageref = dest->getPageRef();
- page = catalog->findPage(pageref.num, pageref.gen);
+ page = pdf::find_page(catalog, pageref);
}
else
page = dest->getPageNum();

View file

@ -1,38 +0,0 @@
From 8325358a9769e8aa33693fc5ea2ac771dd82716f Mon Sep 17 00:00:00 2001
From: Jakub Wilk <jwilk@jwilk.net>
Date: Tue, 23 Apr 2019 08:23:46 +0200
Subject: [PATCH] pdf-backend: simplify find_page() implementation.
---
pdf-backend.cc | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/pdf-backend.cc b/pdf-backend.cc
index f6f5267..a94383e 100644
--- pdf-backend.cc
+++ pdf-backend.cc
@@ -631,19 +631,13 @@ const char * pdf::get_c_string(const pdf::String *str)
}
#endif
-template <typename C> static auto find_page_impl(C *catalog, pdf::Ref pgref) -> decltype(catalog->findPage(0, 0))
-{
- return catalog->findPage(pgref.num, pgref.gen);
-}
-
-template <typename C> static auto find_page_impl(C *catalog, pdf::Ref pgref) -> decltype(catalog->findPage(pgref))
-{
- return catalog->findPage(pgref);
-}
-
int pdf::find_page(pdf::Catalog *catalog, pdf::Ref pgref)
{
- return find_page_impl<pdf::Catalog>(catalog, pgref);
+#if POPPLER_VERSION >= 7600
+ return catalog->findPage(pgref);
+#else
+ return catalog->findPage(pgref.num, pgref.gen);
+#endif
}
// vim:ts=2 sts=2 sw=2 et

View file

@ -0,0 +1,11 @@
--- sys-uuid.cc.orig 2019-06-23 11:41:41 UTC
+++ sys-uuid.cc
@@ -17,6 +17,8 @@
#include "autoconf.hh"
#include "system.hh"
+#include <cstring>
+
#if WIN32
#include <cassert>

View file

@ -1,20 +0,0 @@
--- tools/install-manpages.orig 2019-03-05 23:29:08 UTC
+++ tools/install-manpages
@@ -28,14 +28,14 @@ do
basename=$(basename "$manpage")
suffix=${basename#*.}
locale=${suffix%.*}
- [ "$locale" = "$suffix" ] && locale=
+ [ "$locale" = "$suffix" ] && locale= || locale=$locale/
section=${suffix#*.}
basename=${basename%%.*}
(
PS4='$ '
set -x
- $INSTALL -d "$mandir/$locale/man$section"
- $INSTALL -m 644 "$manpage" "$mandir/$locale/man$section/$basename.$section"
+ $INSTALL -d "$mandir/${locale}man$section"
+ $INSTALL -m 644 "$manpage" "$mandir/${locale}man$section/$basename.$section"
)
done