jbig2dec 0.19 0.19-1
authorLemures Lemniscati <lemures.lemniscati@gmail.com>
Sat, 26 Dec 2020 00:41:45 +0000 (09:41 +0900)
committerLemures Lemniscati <lemures.lemniscati@gmail.com>
Sat, 26 Dec 2020 00:41:45 +0000 (09:41 +0900)
0.12-libpng15.patch [deleted file]
jbig2dec.cygport

diff --git a/0.12-libpng15.patch b/0.12-libpng15.patch
deleted file mode 100644 (file)
index 2e10895..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-Backport of commit 70c7f1967f43a94f9f0d6808d6ab5700a120d2fc
-
---- origsrc/jbig2dec-0.12/jbig2_image_png.c    2014-10-31 08:30:04.000000000 -0500
-+++ src/jbig2dec-0.12/jbig2_image_png.c        2015-11-29 00:47:03.469640500 -0600
-@@ -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;
--    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);
- }
index f6628a2713ab535a806c2a561aa25fd4bcf4dfbb..ccc7b2f0590f65727e473bfa03db8744831969c4 100644 (file)
@@ -1,5 +1,5 @@
 NAME="jbig2dec"
-VERSION=0.12
+VERSION=0.19
 RELEASE=1
 CATEGORY="Graphics"
 SUMMARY="JBIG2 image decoder"
@@ -8,10 +8,41 @@ 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."
-HOMEPAGE="http://ghostscript.com/"
-SRC_URI="http://downloads.ghostscript.com/public/jbig2dec/jbig2dec-${VERSION}.tar.gz"
-PATCH_URI="0.12-libpng15.patch"
+HOMEPAGE="https://jbig2dec.com/"
 
+################################
+## Source from a git repository
+################################
+GIT_REPO="https://github.com/ArtifexSoftware/jbig2dec"
+declare -A GIT_DATEHASH_BY_NAME=(
+  # git log -1 --date=iso-strict --format='%cd/%H'
+  [0.19]=2020-09-10T16:14:14+01:00/1c336b8ab44524dc56ea837e2211ff4207704cdd
+)
+REV_HASH="${GIT_DATEHASH_BY_NAME[${VERSION}]#*/}"
+REV_DATE="${GIT_DATEHASH_BY_NAME[${VERSION}]%/*}"
+REV_DATE_SHORT="${GIT_DATEHASH_BY_NAME[${VERSION}]%T*}"
+GIT_BASENAME="${GIT_REPO##*/}"
+SRC_URI="${GIT_REPO}/archive/${REV_HASH}.tar.gz"   # GitHub
+#SRC_URI="${GIT_REPO}/-/archive/${REV_HASH}/${GIT_BASENAME}-${REV_HASH}.tar.bz2" # GitLab
+SRC_DIR="${GIT_BASENAME}-${REV_HASH}"
+
+################################
+## Compile
+################################
+# cf. autotools.cygclass/src_compile (autotools)
+src_compile() {
+  cd ${S}
+  ./autogen.sh
+  make distclean
+  cygautoreconf
+  cd ${B}
+  cygconf
+  cygmake
+}
+
+################################
+## Packages
+################################
 PKG_NAMES="${NAME} lib${NAME}0 lib${NAME}-devel"
 jbig2dec_CONTENTS="usr/bin/*.exe usr/share/"
 libjbig2dec0_CATEGORY="Libs"
@@ -21,4 +52,28 @@ libjbig2dec_devel_CATEGORY="Libs"
 libjbig2dec_devel_SUMMARY="${SUMMARY} (development)"
 libjbig2dec_devel_CONTENTS="usr/include/ usr/lib/"
 
+DIFF_EXCLUDES="configure.ac"
 KEEP_LA_FILES="none"
+
+################################
+## Test
+################################
+# cf. src_test.cygpart
+src_test() {
+  prep_testdata
+  cd ${B}
+  cygtest
+}
+
+prep_testdata() {
+  cd ${top}
+  [ -f jb2streams.zip ] || wget -nv https://jbig2dec.com/tests/jb2streams.zip
+  [ -f t89-halftone.zip ] || wget -nv https://jbig2dec.com/tests/t89-halftone.zip
+
+  cd ${B}
+  local JB2_TESTDATA_DIR=tests/ubc
+  rm -rf "${JB2_TESTDATA_DIR}"
+  mkdir -p "${JB2_TESTDATA_DIR}"
+  unzip -n ${top}/jb2streams.zip -d "${JB2_TESTDATA_DIR}"
+  unzip -n ${top}/t89-halftone.zip '*.jb2' -d "${JB2_TESTDATA_DIR}"
+}
This page took 0.023871 seconds and 5 git commands to generate.