Index: head/graphics/jbig2dec/Makefile =================================================================== --- head/graphics/jbig2dec/Makefile (revision 402943) +++ head/graphics/jbig2dec/Makefile (revision 402944) @@ -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 +LICENSE_FILE= ${WRKSRC}/COPYING -USES= tar:xz libtool -GNU_CONFIGURE= yes -USE_LDCONFIG= yes -INSTALL_TARGET= install-strip - 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 -PNG_LIB_DEPENDS= libpng.so:${PORTSDIR}/graphics/png +SHEBANG_FILES= test_jbig2dec.py +python_CMD= ${PYTHON_CMD} + +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 - -.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-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: -.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 + @${RM} ${WRKSRC}/getopt* ${WRKSRC}/sha1.h + @${REINPLACE_CMD} -E 's|SHA1_Final\( *([^,]+), *([^\)]+)\)|SHA1_Final(\2, \1)|' ${WRKSRC}/jbig2dec.c ${WRKSRC}/sha1.c -test check regression-test: - ${MAKE} -C ${WRKSRC} check-TESTS +post-patch-PNG-on: + @${REINPLACE_CMD} 's|png_check_sig|png_sig_cmp|g' ${WRKSRC}/configure -post-build: test +post-patch-TESTS-off: + @${REINPLACE_CMD} -e '/^TESTS = / s| test_jbig2dec.py||' ${WRKSRC}/Makefile.in .include Index: head/graphics/jbig2dec/distinfo =================================================================== --- head/graphics/jbig2dec/distinfo (revision 402943) +++ head/graphics/jbig2dec/distinfo (revision 402944) @@ -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 Index: head/graphics/jbig2dec/files/simpler-test-patch =================================================================== --- head/graphics/jbig2dec/files/simpler-test-patch (revision 402943) +++ head/graphics/jbig2dec/files/simpler-test-patch (nonexistent) @@ -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 Property changes on: head/graphics/jbig2dec/files/simpler-test-patch ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/graphics/jbig2dec/files/patch-tests =================================================================== --- head/graphics/jbig2dec/files/patch-tests (revision 402943) +++ head/graphics/jbig2dec/files/patch-tests (nonexistent) @@ -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): Property changes on: head/graphics/jbig2dec/files/patch-tests ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/graphics/jbig2dec/files/patch-libpng15 =================================================================== --- head/graphics/jbig2dec/files/patch-libpng15 (revision 402943) +++ head/graphics/jbig2dec/files/patch-libpng15 (nonexistent) @@ -1,20 +0,0 @@ ---- jbig2_image_png.c -+++ jbig2_image_png.c -@@ -33,7 +33,7 @@ - { - png_size_t check; - -- check = fwrite(data, 1, length, (png_FILE_p)png_ptr->io_ptr); -+ check = fwrite(data, 1, length, (png_FILE_p)png_get_io_ptr(png_ptr)); - if (check != length) { - png_error(png_ptr, "Write Error"); - } -@@ -43,7 +43,7 @@ - jbig2_png_flush(png_structp png_ptr) - { - png_FILE_p io_ptr; -- io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr)); -+ io_ptr = (png_FILE_p)png_get_io_ptr(png_ptr); - if (io_ptr != NULL) - fflush(io_ptr); - } Property changes on: head/graphics/jbig2dec/files/patch-libpng15 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/graphics/jbig2dec/files/patch-native-sha =================================================================== --- head/graphics/jbig2dec/files/patch-native-sha (revision 402943) +++ head/graphics/jbig2dec/files/patch-native-sha (nonexistent) @@ -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 -+#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 -+#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) - { Property changes on: head/graphics/jbig2dec/files/patch-native-sha ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/graphics/jbig2dec/files/patch-Makefile.am =================================================================== --- head/graphics/jbig2dec/files/patch-Makefile.am (nonexistent) +++ head/graphics/jbig2dec/files/patch-Makefile.am (revision 402944) @@ -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 Property changes on: head/graphics/jbig2dec/files/patch-Makefile.am ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/graphics/jbig2dec/files/patch-configure.ac =================================================================== --- head/graphics/jbig2dec/files/patch-configure.ac (nonexistent) +++ head/graphics/jbig2dec/files/patch-configure.ac (revision 402944) @@ -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 Property changes on: head/graphics/jbig2dec/files/patch-configure.ac ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/graphics/jbig2dec/files/patch-jbig2_image_png.c =================================================================== --- head/graphics/jbig2dec/files/patch-jbig2_image_png.c (nonexistent) +++ head/graphics/jbig2dec/files/patch-jbig2_image_png.c (revision 402944) @@ -0,0 +1,28 @@ +--- jbig2_image_png.c.orig 2014-10-31 13:30:04 UTC ++++ jbig2_image_png.c +@@ -26,7 +26,6 @@ + #include + #include + #include +-#include + #define CVT_PTR(ptr) (ptr) + + #include "jbig2.h" +@@ -40,7 +39,7 @@ jbig2_png_write_data(png_structp png_ptr + { + png_size_t check; + +- check = fwrite(data, 1, length, (png_FILE_p)png_ptr->io_ptr); ++ check = fwrite(data, 1, length, (png_FILE_p)png_get_io_ptr(png_ptr)); + if (check != length) { + png_error(png_ptr, "Write Error"); + } +@@ -50,7 +49,7 @@ static void + jbig2_png_flush(png_structp png_ptr) + { + png_FILE_p io_ptr; +- io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr)); ++ io_ptr = (png_FILE_p)png_get_io_ptr(png_ptr); + if (io_ptr != NULL) + fflush(io_ptr); + } Property changes on: head/graphics/jbig2dec/files/patch-jbig2_image_png.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/graphics/jbig2dec/files/patch-jbig2dec.c =================================================================== --- head/graphics/jbig2dec/files/patch-jbig2dec.c (nonexistent) +++ head/graphics/jbig2dec/files/patch-jbig2dec.c (revision 402944) @@ -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 ++#ifndef SHA1_DIGEST_SIZE ++# define SHA1_DIGEST_SIZE 20 ++#endif + + #include "jbig2.h" + #include "jbig2_priv.h" Property changes on: head/graphics/jbig2dec/files/patch-jbig2dec.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/graphics/jbig2dec/files/patch-sha1.c =================================================================== --- head/graphics/jbig2dec/files/patch-sha1.c (nonexistent) +++ head/graphics/jbig2dec/files/patch-sha1.c (revision 402944) @@ -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 + + #include "os_types.h" ++ ++#include ++#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; Property changes on: head/graphics/jbig2dec/files/patch-sha1.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/graphics/jbig2dec/files/patch-test_jbig2dec.py =================================================================== --- head/graphics/jbig2dec/files/patch-test_jbig2dec.py (nonexistent) +++ head/graphics/jbig2dec/files/patch-test_jbig2dec.py (revision 402944) @@ -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' Property changes on: head/graphics/jbig2dec/files/patch-test_jbig2dec.py ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/graphics/jbig2dec/pkg-descr =================================================================== --- head/graphics/jbig2dec/pkg-descr (revision 402943) +++ head/graphics/jbig2dec/pkg-descr (revision 402944) @@ -1,7 +1,8 @@ jbig2dec is a decoder implementation of the JBIG2 image compression format. JBIG2 is designed for lossy or lossless encoding of 'bilevel' (1-bit monochrome) 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