pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Update to 6.1. Changes:
Module Name: pkgsrc-wip
Committed By: Sergey Svishchev <shattered%NetBSD.org@localhost>
Pushed By: shattered
Date: Thu Feb 4 21:38:15 2016 +0300
Changeset: 2b9fd517f64990d2fea2d56738a71232861e720a
Modified Files:
unpaper/Makefile
unpaper/PLIST
unpaper/distinfo
Added Files:
unpaper/patches/patch-file.c
unpaper/patches/patch-unpaper.c
Log Message:
Update to 6.1. Changes:
- The --input-sequence and --output-sequence parameters have been
removed for ease of porting; man page describes the new input
and output file matching.
- Tests are executed with the new parallel harness for speed.
- Implement mathematically accurate interpolation, using cubic
algorithm by default.
- Use libav for both input and output of files, rather than custom
code. This adds support for many different input file formats
outside of PPM/PBM/PGM, as long as libav can reconduct them to a
pixel format that is implemented. Currently that includes most
versions of PNM, PNG and some variants of TIFF.
- PGM and PPM files with less-than-maximum pixel depth are now fully
supported. Previously they would have produced mostly white pages.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=2b9fd517f64990d2fea2d56738a71232861e720a
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
unpaper/Makefile | 23 +++-------
unpaper/PLIST | 33 +++++++++++++-
unpaper/distinfo | 11 +++--
unpaper/patches/patch-file.c | 96 +++++++++++++++++++++++++++++++++++++++++
unpaper/patches/patch-unpaper.c | 13 ++++++
5 files changed, 155 insertions(+), 21 deletions(-)
diffs:
diff --git a/unpaper/Makefile b/unpaper/Makefile
index f428dae..9d73866 100644
--- a/unpaper/Makefile
+++ b/unpaper/Makefile
@@ -1,29 +1,20 @@
# $NetBSD: Makefile,v 1.3 2012/11/12 16:26:52 othyro Exp $
#
-DISTNAME= unpaper-0.3
+DISTNAME= unpaper-6.1
CATEGORIES= textproc
-MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=unpaper.berlios/}
+MASTER_SITES= https://www.flameeyes.eu/files/
+EXTRACT_SUFX= .tar.xz
MAINTAINER= kamelderouiche%yahoo.com@localhost
-HOMEPAGE= http://unpaper.berlios.de/
+HOMEPAGE= https://www.flameeyes.eu/projects/unpaper
COMMENT= Post-processing scanned and photocopied book pages
LICENSE= gnu-gpl-v2
-USE_TOOLS+= bash
-
-SUBST_CLASSES+= paths
-SUBST_STAGE.paths= pre-configure
-SUBST_SED.paths+= -e 's,/usr/local/bin,${DESTDIR}${PREFIX}/bin,g'
-SUBST_FILES.paths+= make.sh
-SUBST_MESSAGE.paths= Fixing header search paths.
+GNU_CONFIGURE= yes
+USE_TOOLS+= pkg-config
INSTALLATION_DIRS= bin
-do-build:
- cd ${WRKSRC}/src; ${CC} ${CFLAGS} -DUNIX -o unpaper unpaper.c -lm
-
-do-install:
- ${INSTALL_PROGRAM} ${WRKSRC}/src/unpaper ${DESTDIR}${PREFIX}/bin
-
+.include "../../multimedia/ffmpeg2/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/unpaper/PLIST b/unpaper/PLIST
index 1151963..5936193 100644
--- a/unpaper/PLIST
+++ b/unpaper/PLIST
@@ -1,2 +1,33 @@
-@comment $NetBSD: PLIST,v 1.1.1.1 2012/08/25 18:27:06 jihbed Exp $
+@comment $NetBSD$
bin/unpaper
+man/man1/unpaper.1
+share/doc/unpaper/AUTHORS
+share/doc/unpaper/COPYING
+share/doc/unpaper/NEWS
+share/doc/unpaper/README.md
+share/doc/unpaper/basic-concepts.md
+share/doc/unpaper/file-formats.md
+share/doc/unpaper/image-processing.md
+share/doc/unpaper/img/blackfilter-detail.png
+share/doc/unpaper/img/blackfilter.png
+share/doc/unpaper/img/blurfilter-detail.png
+share/doc/unpaper/img/blurfilter.png
+share/doc/unpaper/img/border-align.png
+share/doc/unpaper/img/border-scan.png
+share/doc/unpaper/img/deskew-detail1.png
+share/doc/unpaper/img/deskew-detail2.png
+share/doc/unpaper/img/deskew.png
+share/doc/unpaper/img/documentation.odg
+share/doc/unpaper/img/input-pages.png
+share/doc/unpaper/img/layout-templates.png
+share/doc/unpaper/img/mask-center.png
+share/doc/unpaper/img/mask-scan-detail1.png
+share/doc/unpaper/img/mask-scan-detail2.png
+share/doc/unpaper/img/mask-scan.png
+share/doc/unpaper/img/multiple-input-files.png
+share/doc/unpaper/img/multiple-output-files.png
+share/doc/unpaper/img/noisefilter.png
+share/doc/unpaper/img/output-pages.png
+share/doc/unpaper/img/processing-order.png
+share/doc/unpaper/img/sheetspages.png
+share/doc/unpaper/img/standard-deviation.png
diff --git a/unpaper/distinfo b/unpaper/distinfo
index 1811b5e..1bf7771 100644
--- a/unpaper/distinfo
+++ b/unpaper/distinfo
@@ -1,5 +1,8 @@
-$NetBSD: distinfo,v 1.1.1.1 2012/08/25 18:27:06 jihbed Exp $
+$NetBSD$
-SHA1 (unpaper-0.3.tar.gz) = 120eee7c635eeb8ea75431c2dfba89bd8c132493
-RMD160 (unpaper-0.3.tar.gz) = f67a41ae4f80ba74fd7193674340d518d4bbc89f
-Size (unpaper-0.3.tar.gz) = 546488 bytes
+SHA1 (unpaper-6.1.tar.xz) = 52768ff1451c0e0b56a2be8bf4baa505a9eacb7d
+RMD160 (unpaper-6.1.tar.xz) = 3337c18090c13e388eade98b1010b44893901c82
+SHA512 (unpaper-6.1.tar.xz) = afef705985d3c265672c9e42130acc34befc080c361f3169e299b5110c662d0b9845a9d0ca4fc3aad468f49967ded36fb60ffed296373569dd7337c3cb81e79c
+Size (unpaper-6.1.tar.xz) = 2655724 bytes
+SHA1 (patch-file.c) = 6560d8173e776600b0db9c976f1fa565d2d5ccec
+SHA1 (patch-unpaper.c) = 90f1b85de7c8aa22d4daed1be2a57dffde19cc5b
diff --git a/unpaper/patches/patch-file.c b/unpaper/patches/patch-file.c
new file mode 100644
index 0000000..bfb3a31
--- /dev/null
+++ b/unpaper/patches/patch-file.c
@@ -0,0 +1,96 @@
+$NetBSD$
+
+This ensures that we close the context and streams that are created from
+libav; this might still not be complete, but there seems to be different
+APIs between libav and ffmpeg so I'm changing one piece at a time.
+
+Works towards closing Issue #26.
+
+--- file.c
++++ file.c
+@@ -105,7 +105,7 @@ void loadImage(const char *filename, AVFrame **image) {
+ case AV_PIX_FMT_RGB24:
+ case AV_PIX_FMT_MONOBLACK:
+ case AV_PIX_FMT_MONOWHITE:
+- *image = frame;
++ *image = av_frame_clone(frame);
+ break;
+
+ case AV_PIX_FMT_PAL8:
+@@ -123,6 +123,10 @@ void loadImage(const char *filename, AVFrame **image) {
+ default:
+ errOutput("unable to open file %s: unsupported pixel format", filename);
+ }
++
++ avcodec_close(avctx);
++ av_free(avctx);
++ avformat_close_input(&s);
+ }
+
+
+@@ -134,13 +138,14 @@ void loadImage(const char *filename, AVFrame **image) {
+ * @param type filetype of the image to save
+ * @return true on success, false on failure
+ */
+-void saveImage(char *filename, AVFrame *image, int outputPixFmt) {
++void saveImage(char *filename, AVFrame *input, int outputPixFmt) {
+ AVOutputFormat *fmt = NULL;
+ enum AVCodecID output_codec = -1;
+ AVCodec *codec;
+ AVFormatContext *out_ctx;
+ AVCodecContext *codec_ctx;
+ AVStream *video_st;
++ AVFrame *output = input;
+ int ret;
+ char errbuff[1024];
+
+@@ -174,13 +179,11 @@ void saveImage(char *filename, AVFrame *image, int outputPixFmt) {
+ break;
+ }
+
+- if ( image->format != outputPixFmt ) {
+- AVFrame *output;
+- initImage(&output, image->width, image->height,
++ if ( input->format != outputPixFmt ) {
++ initImage(&output, input->width, input->height,
+ outputPixFmt, -1);
+- copyImageArea(0, 0, image->width, image->height,
+- image, 0, 0, output);
+- image = output;
++ copyImageArea(0, 0, input->width, input->height,
++ input, 0, 0, output);
+ }
+
+ codec = avcodec_find_encoder(output_codec);
+@@ -194,9 +197,9 @@ void saveImage(char *filename, AVFrame *image, int outputPixFmt) {
+ }
+
+ codec_ctx = video_st->codec;
+- codec_ctx->width = image->width;
+- codec_ctx->height = image->height;
+- codec_ctx->pix_fmt = image->format;
++ codec_ctx->width = output->width;
++ codec_ctx->height = output->height;
++ codec_ctx->pix_fmt = output->format;
+ video_st->time_base.den = codec_ctx->time_base.den = 1;
+ video_st->time_base.num = codec_ctx->time_base.num = 1;
+
+@@ -221,7 +224,7 @@ void saveImage(char *filename, AVFrame *image, int outputPixFmt) {
+ av_init_packet(&pkt);
+
+ /* encode the image */
+- ret = avcodec_encode_video2(video_st->codec, &pkt, image, &got_packet);
++ ret = avcodec_encode_video2(video_st->codec, &pkt, output, &got_packet);
+
+ if (ret < 0) {
+ av_strerror(ret, errbuff, sizeof(errbuff));
+@@ -237,6 +240,9 @@ void saveImage(char *filename, AVFrame *image, int outputPixFmt) {
+
+ avio_close(out_ctx->pb);
+ av_free(out_ctx);
++
++ if ( output != input )
++ av_frame_free(&output);
+ }
+
+ /**
diff --git a/unpaper/patches/patch-unpaper.c b/unpaper/patches/patch-unpaper.c
new file mode 100644
index 0000000..32dc41f
--- /dev/null
+++ b/unpaper/patches/patch-unpaper.c
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- unpaper.c.orig 2014-10-26 21:43:51.000000000 +0000
++++ unpaper.c
+@@ -367,7 +367,7 @@ int main(int argc, char* argv[]) {
+ { NULL, no_argument, NULL, 0 }
+ };
+
+- c = getopt_long_only(argc, argv, "hVl:S:x::n::M:s:z:p:m:W:B:w:b:Tt:qv",
++ c = getopt_long(argc, argv, "hVl:S:x::n::M:s:z:p:m:W:B:w:b:Tt:qv",
+ long_options, &option_index);
+ if (c == -1)
+ break;
Home |
Main Index |
Thread Index |
Old Index