aboutsummaryrefslogtreecommitdiff
path: root/graphics/jbig2dec
diff options
context:
space:
mode:
authorSunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>2015-12-04 12:32:58 +0000
committerSunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>2015-12-04 12:32:58 +0000
commit76bfabb776bfcc808f1662c164fca080e3fe5f80 (patch)
treeb0923e119d4aef104dd29d7ce5f76c0f2037da75 /graphics/jbig2dec
parentbc2a4109b10e87c97f0dee9ab4b115cb4bb8d0d3 (diff)
downloadports-76bfabb776bfcc808f1662c164fca080e3fe5f80.tar.gz
ports-76bfabb776bfcc808f1662c164fca080e3fe5f80.zip
Notes
Diffstat (limited to 'graphics/jbig2dec')
-rw-r--r--graphics/jbig2dec/Makefile67
-rw-r--r--graphics/jbig2dec/distinfo8
-rw-r--r--graphics/jbig2dec/files/patch-Makefile.am27
-rw-r--r--graphics/jbig2dec/files/patch-configure.ac11
-rw-r--r--graphics/jbig2dec/files/patch-jbig2_image_png.c (renamed from graphics/jbig2dec/files/patch-libpng15)14
-rw-r--r--graphics/jbig2dec/files/patch-jbig2dec.c14
-rw-r--r--graphics/jbig2dec/files/patch-native-sha52
-rw-r--r--graphics/jbig2dec/files/patch-sha1.c24
-rw-r--r--graphics/jbig2dec/files/patch-test_jbig2dec.py10
-rw-r--r--graphics/jbig2dec/files/patch-tests8
-rw-r--r--graphics/jbig2dec/files/simpler-test-patch12
-rw-r--r--graphics/jbig2dec/pkg-descr3
12 files changed, 129 insertions, 121 deletions
diff --git a/graphics/jbig2dec/Makefile b/graphics/jbig2dec/Makefile
index 838da261d846..2c939e64d824 100644
--- a/graphics/jbig2dec/Makefile
+++ b/graphics/jbig2dec/Makefile
@@ -1,61 +1,46 @@
# $FreeBSD$
PORTNAME= jbig2dec
-PORTVERSION= 0.11
-PORTREVISION= 4
+PORTVERSION= 0.12
CATEGORIES= graphics devel
-MASTER_SITES= SF
+MASTER_SITES= http://downloads.ghostscript.com/public/${PORTNAME}/ \
+ LOCAL/sunpoet:tests
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
-EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
-MAINTAINER= ports@FreeBSD.org
+MAINTAINER= sunpoet@FreeBSD.org
COMMENT= Decoder implementation of the JBIG2 image compression format
LICENSE= GPLv3
-
-USES= tar:xz libtool
-GNU_CONFIGURE= yes
-USE_LDCONFIG= yes
-INSTALL_TARGET= install-strip
+LICENSE_FILE= ${WRKSRC}/COPYING
OPTIONS_DEFINE= PNG TESTS
-OPTIONS_DEFAULT= PNG
-
+OPTIONS_DEFAULT=PNG
TESTS_DESC= Download and use test-images for post-build testing
-EXTRACT_AFTER_ARGS+= --exclude sha1.h --exclude 'getopt*'
+CONFIGURE_ENV= ac_cv_func_getopt_long=yes
+GNU_CONFIGURE= yes
+INSTALL_TARGET= install-strip
+USE_LDCONFIG= yes
+USES= autoreconf libtool
+
+SHEBANG_FILES= test_jbig2dec.py
+python_CMD= ${PYTHON_CMD}
-PNG_LIB_DEPENDS= libpng.so:${PORTSDIR}/graphics/png
+PNG_CONFIGURE_OFF= --without-libpng
PNG_CONFIGURE_ON= --with-libpng=${LOCALBASE}
+PNG_LIB_DEPENDS= libpng.so:${PORTSDIR}/graphics/png
+TESTS_DISTFILES= jb2streams${EXTRACT_SUFX}:tests
+TESTS_TEST_TARGET= check-TESTS
+TESTS_USES= python:build shebangfix
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MTESTS}
-MASTER_SITES+= http://jbig2dec.sourceforge.net/ubc/:tests
-DISTFILES+= jb2streams.zip:tests
-USES+= python:build
-KNOWN_BAD_JB2S= 042_11 042_13 042_14 042_24 042_25 amb_1 amb_2
+post-patch:
+ @${RM} ${WRKSRC}/getopt* ${WRKSRC}/sha1.h
+ @${REINPLACE_CMD} -E 's|SHA1_Final\( *([^,]+), *([^\)]+)\)|SHA1_Final(\2, \1)|' ${WRKSRC}/jbig2dec.c ${WRKSRC}/sha1.c
-post-extract:
- @${MKDIR} ${WRKDIR}/ubc
- @${TAR} -C ${WRKDIR}/ubc/ -xpf ${DISTDIR}/jb2streams.zip \
- ${KNOWN_BAD_JB2S:S/$/.jb2/:S/^/--exclude /}
-.else
-EXTRA_PATCHES= ${FILESDIR}/simpler-test-patch
-.endif
+post-patch-PNG-on:
+ @${REINPLACE_CMD} 's|png_check_sig|png_sig_cmp|g' ${WRKSRC}/configure
-post-patch:
-.if ${PORT_OPTIONS:MPNG}
- @${REINPLACE_CMD} 's/png_check_sig/png_sig_cmp/g' ${WRKSRC}/configure
-.endif
- @${REINPLACE_CMD} -E 's|SHA1_Final\( *([^,]+), *([^\)]+)\)|SHA1_Final(\2, \1)|' \
- ${WRKSRC}/jbig2dec.c ${WRKSRC}/sha1.c
- @${REINPLACE_CMD} -e '1 s|${SETENV} python|${PYTHON_CMD}|' \
- ${WRKSRC}/test_jbig2dec.py
-
-test check regression-test:
- ${MAKE} -C ${WRKSRC} check-TESTS
-
-post-build: test
+post-patch-TESTS-off:
+ @${REINPLACE_CMD} -e '/^TESTS = / s| test_jbig2dec.py||' ${WRKSRC}/Makefile.in
.include <bsd.port.mk>
diff --git a/graphics/jbig2dec/distinfo b/graphics/jbig2dec/distinfo
index 326b88119d1b..78dc644c454e 100644
--- a/graphics/jbig2dec/distinfo
+++ b/graphics/jbig2dec/distinfo
@@ -1,4 +1,4 @@
-SHA256 (jbig2dec-0.11.tar.xz) = 016bf8148c850736c19e5e0336c43912d98d68f90c9171912c4f67f5c060adf5
-SIZE (jbig2dec-0.11.tar.xz) = 258908
-SHA256 (jb2streams.zip) = 3d1e5c79054b59d061cabdb1d7ba2d1b3f84700f5c517ba4306f7047660016f7
-SIZE (jb2streams.zip) = 1285838
+SHA256 (jbig2dec-0.12.tar.gz) = bcc5f2cc75ee46e9a2c3c68d4a1b740280c772062579a5d0ceda24bee2e5ebf0
+SIZE (jbig2dec-0.12.tar.gz) = 330935
+SHA256 (jb2streams.tar.gz) = 1b070a15468d186010047b5525b2eb99cdcda655576600d2d8a0d008b80a5ba2
+SIZE (jb2streams.tar.gz) = 1000034
diff --git a/graphics/jbig2dec/files/patch-Makefile.am b/graphics/jbig2dec/files/patch-Makefile.am
new file mode 100644
index 000000000000..1cf3b2974978
--- /dev/null
+++ b/graphics/jbig2dec/files/patch-Makefile.am
@@ -0,0 +1,27 @@
+--- Makefile.am.orig 2014-10-31 21:30:04.000000000 +0800
++++ Makefile.am 2015-12-04 15:46:33.248995991 +0800
+@@ -26,10 +26,10 @@
+ bin_PROGRAMS = jbig2dec
+ noinst_PROGRAMS = test_sha1 test_huffman test_arith
+
+-jbig2dec_SOURCES = jbig2dec.c sha1.c sha1.h \
+- jbig2.h jbig2_image.h getopt.h \
++jbig2dec_SOURCES = jbig2dec.c \
++ jbig2.h jbig2_image.h \
+ os_types.h config_types.h config_win32.h
+-jbig2dec_LDADD = libjbig2dec.la @LIBOBJS@ $(PNG_LIBS)
++jbig2dec_LDADD = libjbig2dec.la @LIBOBJS@ $(PNG_LIBS) -lmd
+
+ dist_man_MANS = jbig2dec.1
+
+@@ -39,8 +39,9 @@
+
+ TESTS = test_sha1 test_jbig2dec.py test_huffman test_arith
+
+-test_sha1_SOURCES = sha1.c sha1.h
++test_sha1_SOURCES = sha1.c
+ test_sha1_CFLAGS = -DTEST
++test_sha1_LDADD = -lmd
+
+ test_arith_SOURCES = jbig2_arith.c
+ test_arith_CFLAGS = -DTEST
diff --git a/graphics/jbig2dec/files/patch-configure.ac b/graphics/jbig2dec/files/patch-configure.ac
new file mode 100644
index 000000000000..a85b4a34f04e
--- /dev/null
+++ b/graphics/jbig2dec/files/patch-configure.ac
@@ -0,0 +1,11 @@
+--- configure.ac.orig 2014-10-31 21:30:04.000000000 +0800
++++ configure.ac 2015-12-04 15:15:55.027124992 +0800
+@@ -140,8 +140,6 @@
+ AC_DEFINE(HAVE_GETOPT_LONG,,
+ [Define if the local libc includes getopt_long()]
+ ),[
+- AC_LIBOBJ([getopt])
+- AC_LIBOBJ([getopt1])
+ ])
+
+ # generate output
diff --git a/graphics/jbig2dec/files/patch-libpng15 b/graphics/jbig2dec/files/patch-jbig2_image_png.c
index 2297c52d6f66..bab346ca99b8 100644
--- a/graphics/jbig2dec/files/patch-libpng15
+++ b/graphics/jbig2dec/files/patch-jbig2_image_png.c
@@ -1,6 +1,14 @@
---- jbig2_image_png.c
+--- jbig2_image_png.c.orig 2014-10-31 13:30:04 UTC
+++ jbig2_image_png.c
-@@ -33,7 +33,7 @@
+@@ -26,7 +26,6 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <png.h>
+-#include <pngstruct.h>
+ #define CVT_PTR(ptr) (ptr)
+
+ #include "jbig2.h"
+@@ -40,7 +39,7 @@ jbig2_png_write_data(png_structp png_ptr
{
png_size_t check;
@@ -9,7 +17,7 @@
if (check != length) {
png_error(png_ptr, "Write Error");
}
-@@ -43,7 +43,7 @@
+@@ -50,7 +49,7 @@ static void
jbig2_png_flush(png_structp png_ptr)
{
png_FILE_p io_ptr;
diff --git a/graphics/jbig2dec/files/patch-jbig2dec.c b/graphics/jbig2dec/files/patch-jbig2dec.c
new file mode 100644
index 000000000000..244401f8d784
--- /dev/null
+++ b/graphics/jbig2dec/files/patch-jbig2dec.c
@@ -0,0 +1,14 @@
+--- jbig2dec.c.orig 2014-10-31 13:30:04 UTC
++++ jbig2dec.c
+@@ -41,7 +41,10 @@
+ #endif
+
+ #include "os_types.h"
+-#include "sha1.h"
++#include <sha.h>
++#ifndef SHA1_DIGEST_SIZE
++# define SHA1_DIGEST_SIZE 20
++#endif
+
+ #include "jbig2.h"
+ #include "jbig2_priv.h"
diff --git a/graphics/jbig2dec/files/patch-native-sha b/graphics/jbig2dec/files/patch-native-sha
deleted file mode 100644
index 883868c06f32..000000000000
--- a/graphics/jbig2dec/files/patch-native-sha
+++ /dev/null
@@ -1,52 +0,0 @@
---- Makefile.in 2010-02-02 14:13:56.000000000 -0500
-+++ Makefile.in 2010-08-03 13:47:07.000000000 -0400
-@@ -214,8 +214,8 @@
- PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
-
--am_jbig2dec_OBJECTS = jbig2dec.$(OBJEXT) sha1.$(OBJEXT)
-+am_jbig2dec_OBJECTS = jbig2dec.$(OBJEXT)
- jbig2dec_OBJECTS = $(am_jbig2dec_OBJECTS)
- jbig2dec_DEPENDENCIES = libjbig2dec.la @LIBOBJS@
--jbig2dec_LDFLAGS =
-+jbig2dec_LDFLAGS = -lmd
- am_test_arith_OBJECTS = test_arith-jbig2_arith.$(OBJEXT)
- test_arith_OBJECTS = $(am_test_arith_OBJECTS)
-@@ -228,5 +228,5 @@
- am_test_sha1_OBJECTS = test_sha1-sha1.$(OBJEXT)
- test_sha1_OBJECTS = $(am_test_sha1_OBJECTS)
--test_sha1_LDADD = $(LDADD)
-+test_sha1_LDADD = -lmd
- test_sha1_DEPENDENCIES =
- test_sha1_LDFLAGS =
---- jbig2dec.c 2010-02-02 14:02:55.000000000 -0500
-+++ jbig2dec.c 2010-08-03 13:36:41.000000000 -0400
-@@ -37,5 +37,8 @@
-
- #include "os_types.h"
--#include "sha1.h"
-+#include <sha.h>
-+#ifndef SHA1_DIGEST_SIZE
-+# define SHA1_DIGEST_SIZE 20
-+#endif
-
- #include "jbig2.h"
---- sha1.c 2009-07-16 00:44:49.000000000 -0400
-+++ sha1.c 2010-08-03 13:45:09.000000000 -0400
-@@ -87,4 +87,11 @@
-
- #include "os_types.h"
-+
-+#include <sha.h>
-+#ifndef SHA1_DIGEST_SIZE
-+# define SHA1_DIGEST_SIZE 20
-+#endif
-+
-+#if 0
- #include "sha1.h"
-
-@@ -261,5 +268,4 @@
- /*************************************************************/
-
--#if 0
- int main(int argc, char** argv)
- {
diff --git a/graphics/jbig2dec/files/patch-sha1.c b/graphics/jbig2dec/files/patch-sha1.c
new file mode 100644
index 000000000000..7e831800d3f7
--- /dev/null
+++ b/graphics/jbig2dec/files/patch-sha1.c
@@ -0,0 +1,24 @@
+--- sha1.c.orig 2014-10-31 13:30:04 UTC
++++ sha1.c
+@@ -86,6 +86,13 @@ A million repetitions of "a"
+ #include <string.h>
+
+ #include "os_types.h"
++
++#include <sha.h>
++#ifndef SHA1_DIGEST_SIZE
++# define SHA1_DIGEST_SIZE 20
++#endif
++
++#if 0
+ #include "sha1.h"
+
+ void SHA1_Transform(uint32_t state[5], const uint8_t buffer[64]);
+@@ -260,7 +267,6 @@ void SHA1_Final(SHA1_CTX* context, uint8
+
+ /*************************************************************/
+
+-#if 0
+ int main(int argc, char** argv)
+ {
+ int i, j;
diff --git a/graphics/jbig2dec/files/patch-test_jbig2dec.py b/graphics/jbig2dec/files/patch-test_jbig2dec.py
new file mode 100644
index 000000000000..c629a5fc3719
--- /dev/null
+++ b/graphics/jbig2dec/files/patch-test_jbig2dec.py
@@ -0,0 +1,10 @@
+--- test_jbig2dec.py.orig 2015-12-01 15:52:01 UTC
++++ test_jbig2dec.py
+@@ -52,6 +52,7 @@ class SelfTestSuite:
+ (len(self.fails),len(self.tests)))
+ else:
+ self.stream.write('PASSED all %d tests\n' % len(self.tests))
++ return 1
+
+ class KnownFileHash(SelfTest):
+ 'self test to check for correct decode of known test files'
diff --git a/graphics/jbig2dec/files/patch-tests b/graphics/jbig2dec/files/patch-tests
deleted file mode 100644
index 17d3e19cf343..000000000000
--- a/graphics/jbig2dec/files/patch-tests
+++ /dev/null
@@ -1,8 +0,0 @@
---- test_jbig2dec.py 2009-07-16 00:44:49.000000000 -0400
-+++ test_jbig2dec.py 2010-08-03 14:59:23.000000000 -0400
-@@ -53,4 +53,5 @@
- else:
- self.stream.write('PASSED all %d tests\n' % len(self.tests))
-+ return 1
-
- class KnownFileHash(SelfTest):
diff --git a/graphics/jbig2dec/files/simpler-test-patch b/graphics/jbig2dec/files/simpler-test-patch
deleted file mode 100644
index aaf8328ca22f..000000000000
--- a/graphics/jbig2dec/files/simpler-test-patch
+++ /dev/null
@@ -1,12 +0,0 @@
-The test_jbig2dec.py requires Python and thus not be
-suitable for some installations.
-
---- Makefile.in 2010-02-02 14:13:56.000000000 -0500
-+++ Makefile.in 2010-08-03 13:47:07.000000000 -0400
-@@ -182,5 +182,5 @@
- MAINTAINERCLEANFILES = config_types.h.in
-
--TESTS = test_sha1 test_jbig2dec.py test_huffman test_arith
-+TESTS = test_sha1 test_huffman test_arith
-
- test_sha1_SOURCES = sha1.c sha1.h
diff --git a/graphics/jbig2dec/pkg-descr b/graphics/jbig2dec/pkg-descr
index c1f0a65a4869..6a7fb4d3eb37 100644
--- a/graphics/jbig2dec/pkg-descr
+++ b/graphics/jbig2dec/pkg-descr
@@ -4,4 +4,5 @@ images at moderately high resolution, and in particular scanned paper documents.
In this domain it is very efficient, offering compression ratios on the order of
100:1.
-WWW: http://jbig2dec.sourceforge.net/
+WWW: http://www.ghostscript.com/jbig2dec.html
+WWW: http://git.ghostscript.com/?p=jbig2dec.git