mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-23 04:23:08 +00:00
graphics/unpaper: Update to 6.1
* Add an additional patch that fixes the unpaper's usage for the libav/ffmpeg API. [1] * Remove the DOCS option as nearly all files are now in Markdown format and the relevant info has been transferred into the unpaper(1) manpage. * Take maintainership Notable changes since 0.3: * 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 redconduct them to a pixel format that is implemented. * Implementation of mathematically accurate interpolation, using cubic algorithm by default. * Options are now documented in the unpaper(1) man page, rather than in the code. https://github.com/Flameeyes/unpaper/blob/unpaper-6.1/NEWS Obtained from: Debian [1]
This commit is contained in:
parent
1f2e8e1d5d
commit
27030bf87d
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=511568
@ -2,31 +2,27 @@
|
||||
# $FreeBSD$
|
||||
|
||||
PORTNAME= unpaper
|
||||
PORTVERSION= 0.3
|
||||
PORTVERSION= 6.1
|
||||
CATEGORIES= graphics
|
||||
MASTER_SITES= https://www.flameeyes.eu/files/
|
||||
|
||||
MAINTAINER= ports@FreeBSD.org
|
||||
MAINTAINER= kai@FreeBSD.org
|
||||
COMMENT= Post-processing tool for scanned sheets of paper
|
||||
|
||||
LICENSE= GPLv2
|
||||
LICENSE_FILE= ${WRKSRC}/LICENSE
|
||||
LICENSE_FILE= ${WRKSRC}/COPYING
|
||||
|
||||
PORTDOCS= *
|
||||
PLIST_FILES= bin/${PORTNAME}
|
||||
BUILD_DEPENDS= xsltproc:textproc/libxslt \
|
||||
bash:shells/bash
|
||||
LIB_DEPENDS= libavcodec.so:multimedia/ffmpeg \
|
||||
libavformat.so:multimedia/ffmpeg \
|
||||
libavutil.so:multimedia/ffmpeg
|
||||
|
||||
OPTIONS_DEFINE= DOCS
|
||||
USES= autoreconf pkgconfig tar:xz
|
||||
|
||||
do-build:
|
||||
@${CC} ${CFLAGS} -o ${WRKSRC}/${PORTNAME} \
|
||||
${WRKSRC}/src/${PORTNAME}.c -lm
|
||||
GNU_CONFIGURE= yes
|
||||
|
||||
do-install:
|
||||
${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
|
||||
|
||||
do-install-DOCS-on:
|
||||
@${MKDIR} ${STAGEDIR}${DOCSDIR}
|
||||
@cd ${WRKSRC}/ && ${INSTALL_DATA} CHANGELOG README ${STAGEDIR}${DOCSDIR}
|
||||
@cd ${WRKSRC}/doc/ && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}
|
||||
PLIST_FILES= bin/${PORTNAME} \
|
||||
man/man1/${PORTNAME}.1.gz
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
@ -1,2 +1,3 @@
|
||||
SHA256 (unpaper-0.3.tar.gz) = 3433664040942bf7638946e2327e5c64119c600fde8ace918f47109fafbde5be
|
||||
SIZE (unpaper-0.3.tar.gz) = 546488
|
||||
TIMESTAMP = 1565468288
|
||||
SHA256 (unpaper-6.1.tar.xz) = 237c84f5da544b3f7709827f9f12c37c346cdf029b1128fb4633f9bafa5cb930
|
||||
SIZE (unpaper-6.1.tar.xz) = 2655724
|
||||
|
30
graphics/unpaper/files/patch-file.c
Normal file
30
graphics/unpaper/files/patch-file.c
Normal file
@ -0,0 +1,30 @@
|
||||
Subject: Fix wrong ffmpeg API usage
|
||||
Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=800312
|
||||
Bug: https://github.com/Flameeyes/unpaper/issues/39
|
||||
Author: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
|
||||
Forwarded: https://github.com/Flameeyes/unpaper/pull/42
|
||||
|
||||
--- file.c.orig 2014-10-26 22:35:38 UTC
|
||||
+++ file.c
|
||||
@@ -93,10 +93,21 @@ void loadImage(const char *filename, AVFrame **image)
|
||||
if (pkt.stream_index != 0)
|
||||
errOutput("unable to open file %s: invalid stream.", filename);
|
||||
|
||||
+ while (!got_frame && pkt.data) {
|
||||
+
|
||||
+ if (pkt.size <= 0) {
|
||||
+ pkt.data = NULL;
|
||||
+ pkt.size = 0;
|
||||
+ }
|
||||
+
|
||||
ret = avcodec_decode_video2(avctx, frame, &got_frame, &pkt);
|
||||
if (ret < 0) {
|
||||
av_strerror(ret, errbuff, sizeof(errbuff));
|
||||
errOutput("unable to open file %s: %s", filename, errbuff);
|
||||
+ }
|
||||
+
|
||||
+ pkt.data += ret;
|
||||
+ pkt.size -= ret;
|
||||
}
|
||||
|
||||
switch(frame->format) {
|
Loading…
Reference in New Issue
Block a user