aboutsummaryrefslogtreecommitdiff
path: root/converters
diff options
context:
space:
mode:
authorGuido Falsi <madpilot@FreeBSD.org>2013-11-06 18:04:20 +0000
committerGuido Falsi <madpilot@FreeBSD.org>2013-11-06 18:04:20 +0000
commit7d08ba8731aa81b40c3b5abdb8c13af2fcc7955d (patch)
tree4539c7b60507c8b751343f8b949cf49bb5aea116 /converters
parentc11f1a0a1c8e19f7314fc17a8b94d440905cd644 (diff)
downloadports-7d08ba8731aa81b40c3b5abdb8c13af2fcc7955d.tar.gz
ports-7d08ba8731aa81b40c3b5abdb8c13af2fcc7955d.zip
Notes
Diffstat (limited to 'converters')
-rw-r--r--converters/pdf2djvu/Makefile30
-rw-r--r--converters/pdf2djvu/distinfo4
-rw-r--r--converters/pdf2djvu/files/patch-configure24
-rw-r--r--converters/pdf2djvu/files/patch-pdf-backend.cc20
-rw-r--r--converters/pdf2djvu/files/patch-pdf-backend.hh14
-rw-r--r--converters/pdf2djvu/files/patch-pdf2djvu.cc112
-rw-r--r--converters/pdf2djvu/files/patch-tools-xml2c34
7 files changed, 162 insertions, 76 deletions
diff --git a/converters/pdf2djvu/Makefile b/converters/pdf2djvu/Makefile
index 3c8fe78ac966..8b88d5dd3760 100644
--- a/converters/pdf2djvu/Makefile
+++ b/converters/pdf2djvu/Makefile
@@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= pdf2djvu
-PORTVERSION= 0.5.11
-PORTREVISION= 11
+PORTVERSION= 0.7.17
CATEGORIES= converters
MASTER_SITES= ${MASTER_SITE_GOOGLE_CODE}
DISTNAME= ${PORTNAME}_${PORTVERSION}${EXTRACT_SUFFIX}
@@ -11,30 +10,29 @@ DISTNAME= ${PORTNAME}_${PORTVERSION}${EXTRACT_SUFFIX}
MAINTAINER= darcsis@gmail.com
COMMENT= Pdf2djvu creates DjVu files from PDF files
-DEPRECATED= Broken for more than 6 month
-EXPIRATION_DATE= 2013-11-18
+LICENSE= GPLv2
BUILD_DEPENDS= ${LOCALBASE}/include/pstreams/pstream.h:${PORTSDIR}/devel/pstreams
-LIB_DEPENDS= poppler:${PORTSDIR}/graphics/poppler
-LIB_DEPENDS+= djvulibre:${PORTSDIR}/graphics/djvulibre
+LIB_DEPENDS= libpoppler.so:${PORTSDIR}/graphics/poppler \
+ libdjvulibre.so:${PORTSDIR}/graphics/djvulibre
GNU_CONFIGURE= yes
CONFIGURE_ENV= LIBS=-pthread
CPPFLAGS+= -I${LOCALBASE}/include
-USES= pkgconfig
-USE_GMAKE= yes
+USES= compiler:c++11-lang gmake pkgconfig
-BROKEN= does not build
+PLIST_FILES= bin/pdf2djvu man/man1/pdf2djvu.1.gz
-PLIST_FILES= bin/pdf2djvu
-MAN1= pdf2djvu.1
-MANCOMPRESSED= no
+WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
-WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
+.include <bsd.port.options.mk>
+
+.if ${OSVERSION} < 900014
+FAVORITE_COMPILER= gcc
+.endif
-NO_STAGE= yes
do-install:
- ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin
- ${INSTALL_MAN} ${WRKSRC}/doc/${PORTNAME}.1 ${MANPREFIX}/man/man1
+ ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
+ ${INSTALL_MAN} ${WRKSRC}/doc/${PORTNAME}.1 ${STAGEDIR}${MANPREFIX}/man/man1
.include <bsd.port.mk>
diff --git a/converters/pdf2djvu/distinfo b/converters/pdf2djvu/distinfo
index 8821be555c02..798a820080b2 100644
--- a/converters/pdf2djvu/distinfo
+++ b/converters/pdf2djvu/distinfo
@@ -1,2 +1,2 @@
-SHA256 (pdf2djvu_0.5.11.tar.gz) = 6e57f5be61e2274db2aaa78e2a18dff8ddc0fb5e107287bf87fc1270513f66ab
-SIZE (pdf2djvu_0.5.11.tar.gz) = 223827
+SHA256 (pdf2djvu_0.7.17.tar.gz) = fe6d6e2d6df53195f082890d3cb5e50080784510691e708a5e4614b49662f4da
+SIZE (pdf2djvu_0.7.17.tar.gz) = 320923
diff --git a/converters/pdf2djvu/files/patch-configure b/converters/pdf2djvu/files/patch-configure
deleted file mode 100644
index 44d5a4fdf098..000000000000
--- a/converters/pdf2djvu/files/patch-configure
+++ /dev/null
@@ -1,24 +0,0 @@
---- configure.orig 2009-07-31 17:17:53.000000000 +0200
-+++ configure 2009-08-19 20:28:26.000000000 +0200
-@@ -2993,9 +2993,9 @@
- printf 'P1 3 3 0 0 0 0 0 0 0 0 0 0' > conftest.458086.pbm
- "$djvulibre_bin_path/cjb2" conftest.458086.pbm conftest.458086.p1.djvu
- "$djvulibre_bin_path/cjb2" conftest.458086.pbm conftest.458086.p2.djvu
--printf 'AT&TFORM\0\0\0\x35DJVMDIRM\0\0\0\x29\x01\0\x02\xff\xff\xc6\xbf\x8a' > conftest.458086.djvu
--printf '\x1f\xeb\x4b\xff\x40\x8e\x37\x86\x3f\x6c\xbe\x78\x02\x3c\x93\x9b' >> conftest.458086.djvu
--printf '\x17\x57\x16\x67\x1d\x7a\xeb\x57\xf8\xf3\x7e\x64\x32\x42\x88\xd2\x4f' >> conftest.458086.djvu
-+printf 'AT&TFORM\0\0\0\065DJVMDIRM\0\0\0\051\001\0\002\377\377\306\277\212' > conftest.458086.djvu
-+printf '\037\353\113\377\100\216\067\206\077\154\276\170\002\074\223\233' >> conftest.458086.djvu
-+printf '\027\127\026\147\035\172\353\127\370\363\176\144\062\102\210\322\117' >> conftest.458086.djvu
- printf '(bookmarks ("" ""))' > conftest.458086.outline
- "$djvulibre_bin_path/djvused" -s -e 'set-outline conftest.458086.outline' conftest.458086.djvu
- if ! "$djvulibre_bin_path/djvused" -e print-outline conftest.458086.djvu | grep '(bookmarks' > /dev/null
-@@ -3170,7 +3170,7 @@
- fi
-
-
--
-+pkg_failed=untried; echo "disabled"
- if test $pkg_failed = yes; then
-
- if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
diff --git a/converters/pdf2djvu/files/patch-pdf-backend.cc b/converters/pdf2djvu/files/patch-pdf-backend.cc
deleted file mode 100644
index 9a3ffee1abc2..000000000000
--- a/converters/pdf2djvu/files/patch-pdf-backend.cc
+++ /dev/null
@@ -1,20 +0,0 @@
---- pdf-backend.cc.orig 2010-10-31 16:26:02.000000000 +0100
-+++ pdf-backend.cc 2010-10-31 16:27:10.000000000 +0100
-@@ -99,7 +99,7 @@
- return html_color(rgb);
- }
-
--static void cmyk_to_rgb(double cmyk[], double rgb[])
-+static void cmyk_to_rgb(const double cmyk[], double rgb[])
- {
- static pdf::gfx::DeviceCmykColorSpace cmyk_space;
- pdf::gfx::Color cmyk_cc;
-@@ -124,7 +124,7 @@
- border_colors.push_back("");
- return true;
- }
-- double *values = color->getValues();
-+ const double *values = color->getValues();
- switch (color->getSpace())
- {
- case pdf::ant::Color::colorTransparent:
diff --git a/converters/pdf2djvu/files/patch-pdf-backend.hh b/converters/pdf2djvu/files/patch-pdf-backend.hh
deleted file mode 100644
index 67d3669597f1..000000000000
--- a/converters/pdf2djvu/files/patch-pdf-backend.hh
+++ /dev/null
@@ -1,14 +0,0 @@
---- pdf-backend.hh.orig 2011-10-23 16:16:08.000000000 +0000
-+++ pdf-backend.hh 2011-10-23 16:17:13.000000000 +0000
-@@ -77,7 +77,11 @@
-
- namespace link
- {
-+#if POPPLER_VERSION < 1700
- typedef ::Link Link;
-+#else
-+ typedef ::AnnotLink Link;
-+#endif
- typedef ::LinkAction Action;
- typedef ::LinkDest Destination;
- typedef ::LinkGoTo GoTo;
diff --git a/converters/pdf2djvu/files/patch-pdf2djvu.cc b/converters/pdf2djvu/files/patch-pdf2djvu.cc
new file mode 100644
index 000000000000..db0ef2d00612
--- /dev/null
+++ b/converters/pdf2djvu/files/patch-pdf2djvu.cc
@@ -0,0 +1,112 @@
+--- pdf2djvu.cc.orig 2013-05-30 22:22:26.000000000 +0200
++++ pdf2djvu.cc 2013-10-19 16:11:38.078951359 +0200
+@@ -212,7 +212,7 @@
+
+ Command &operator <<(Command &command, const Component &component)
+ {
+- command << *component.file;
++ command << std::string(*component.file);
+ return command;
+ }
+
+@@ -980,7 +980,7 @@
+ {
+ debug(3) << _("creating document outline with `djvused`") << std::endl;
+ DjVuCommand djvused("djvused");
+- djvused << "-s" << "-f" << outlines_sed_file << this->index_file;
++ djvused << "-s" << "-f" << std::string(outlines_sed_file) << std::string(this->index_file);
+ djvused(); // djvused -s -f <outlines-sed-file> <index-djvu-file>
+ }
+
+@@ -991,7 +991,7 @@
+ {
+ debug(3) << _("setting metadata with `djvused`") << std::endl;
+ DjVuCommand djvused("djvused");
+- djvused << "-s" << "-f" << metadata_sed_file << this->index_file;
++ djvused << "-s" << "-f" << std::string(metadata_sed_file) << std::string(this->index_file);
+ djvused(); // djvused -s -f <metadata-sed-file> <index-djvu-file>
+ }
+ else
+@@ -1025,7 +1025,7 @@
+ dummy_components.push_back(this->components[i]);
+ this->do_create(dummy_components);
+ DjVuCommand djvused("djvused");
+- djvused << "-s" << "-f" << dummy_sed_file << this->index_file;
++ djvused << "-s" << "-f" << std::string(dummy_sed_file) << std::string(this->index_file);
+ djvused(); // djvused -s -f <dummy-sed-file> <output-djvu-file>
+ dummy_components.pop_back();
+ }
+@@ -1033,7 +1033,7 @@
+ dummy_components.push_back(this->components[size - 1]);
+ this->do_create(dummy_components);
+ DjVuCommand djvused("djvused");
+- djvused << "-s" << "-f" << metadata_sed_file << this->index_file;
++ djvused << "-s" << "-f" << std::string(metadata_sed_file) << std::string(this->index_file);
+ djvused(); // djvused -s -f <metadata-sed-file> <output-djvu-file>
+ /* Finally, recreate the index. */
+ this->do_create(this->components, true /* include shared annotations */);
+@@ -1089,8 +1089,8 @@
+ {
+ this->converter
+ << "-b"
+- << *this->index_file
+- << this->output_file;
++ << std::string(*this->index_file)
++ << std::string(this->output_file);
+ this->converter(); // djvmcvt -b <output-djvu-file> <index-djvu-file>
+ this->index_file.reset(NULL);
+ }
+@@ -1122,7 +1122,7 @@
+ }
+ bzz_file.close();
+ DjVuCommand bzz("bzz");
+- bzz << "-e" << bzz_file << "-";
++ bzz << "-e" << std::string(bzz_file) << "-";
+ bzz(index_file);
+ }
+ size = this->index_file.size();
+@@ -1498,7 +1498,7 @@
+ csepdjvu << "-q" << config.bg_slices;
+ if (config.text == config.TEXT_LINES)
+ csepdjvu << "-t";
+- csepdjvu << sep_file << component;
++ csepdjvu << std::string(sep_file) << component;
+ csepdjvu();
+ }
+ const bool should_have_fgbz = has_background || has_foreground || nonwhite_background_color;
+@@ -1528,7 +1528,7 @@
+ TemporaryFile pbm_file;
+ debug(3) << _("encoding monochrome image with `cjb2`") << std::endl;
+ DjVuCommand cjb2("cjb2");
+- cjb2 << "-losslevel" << config.loss_level << pbm_file << sjbz_file;
++ cjb2 << "-losslevel" << config.loss_level << std::string(pbm_file) << std::string(sjbz_file);
+ pbm_file << "P4 " << width << " " << height << std::endl;
+ pdf::Pixmap bmp(outm->has_skipped_elements() ? out1.get() : outm.get());
+ pbm_file << bmp;
+@@ -1543,7 +1543,7 @@
+ TemporaryFile ppm_file;
+ debug(3) << _("creating new background image with `c44`") << std::endl;
+ DjVuCommand c44("c44");
+- c44 << "-slice" << "97" << ppm_file << c44_file;
++ c44 << "-slice" << "97" << std::string(ppm_file) << std::string(c44_file);
+ int bg_width = (width + 11) / 12;
+ int bg_height = (height + 11) / 12;
+ ppm_file << "P6 " << bg_width << " " << bg_height << " 255" << std::endl;
+@@ -1560,7 +1560,7 @@
+ { /* Replace previous (dummy) BG44 chunk with the newly created one: */
+ debug(3) << _("recovering image chunks with `djvuextract`") << std::endl;
+ DjVuCommand djvuextract("djvuextract");
+- djvuextract << c44_file << std::string("BG44=") + std::string(bg44_file);
++ djvuextract << std::string(c44_file) << std::string("BG44=") + std::string(bg44_file);
+ djvuextract(config.verbose < 3);
+ }
+ }
+@@ -1601,7 +1601,7 @@
+ { /* Add per-page non-raster data into the DjVu file: */
+ debug(3) << _("adding non-raster data with `djvused`") << std::endl;
+ DjVuCommand djvused("djvused");
+- djvused << component << "-s" << "-f" << sed_file;
++ djvused << component << "-s" << "-f" << std::string(sed_file);
+ djvused();
+ }
+ {
diff --git a/converters/pdf2djvu/files/patch-tools-xml2c b/converters/pdf2djvu/files/patch-tools-xml2c
new file mode 100644
index 000000000000..78ee244117cd
--- /dev/null
+++ b/converters/pdf2djvu/files/patch-tools-xml2c
@@ -0,0 +1,34 @@
+--- tools/xml2c.orig 2013-05-30 22:22:26.000000000 +0200
++++ tools/xml2c 2013-10-19 15:09:40.124205826 +0200
+@@ -1,16 +1,24 @@
+ #!/bin/sh
+
+-# Copyright © 2009 Jakub Wilk
++# Copyright © 2009, 2013 Jakub Wilk
+ #
+ # This package 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; version 2 dated June, 1991.
+
+-exec sed \
+- -e '/<!--# *\(.*\) *#-->/ { s//\1/; b; }' \
+- -e '/<!--.*-->/ { s///g; b; }' \
+- -e 's/\\\\/\\\\/g' \
+- -e 's/"/\\"/g' \
+- -e 's/^/"/; s/$/\\n"/'
++exec sed -e '
++/<!--# *\(.*\) *#-->/ {
++ s//\1/
++ b
++}
++/<!--.*-->/ {
++ s///g
++ b
++}
++s/\\\\/\\\\/g
++s/"/\\"/g
++s/^/"/
++s/$/\\n"/
++'
+
+ # vim:ts=2 sw=2 et