diff options
author | Christopher Hillenbrand | 2023-07-11 21:08:24 -0400 |
---|---|---|
committer | Christopher Hillenbrand | 2023-07-11 21:08:24 -0400 |
commit | eeec3f8b5659cdec30a92b3c5cd935291d0dc2b6 (patch) | |
tree | 8b139891a52990c6eccf2a2ada46b4e8298c0f6f | |
parent | a045f7ec1e571d82f8d93971a4589972e245cd45 (diff) | |
download | aur-eeec3f8b5659cdec30a92b3c5cd935291d0dc2b6.tar.gz |
Add commit ea05019 -- fix build with Leptonica >=1.83
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | CHANGELOG | 4 | ||||
-rw-r--r-- | PKGBUILD | 10 | ||||
-rw-r--r-- | commit-ea0501904.patch | 90 | ||||
-rw-r--r-- | commit-ea6a40a.patch | 28 |
5 files changed, 102 insertions, 36 deletions
@@ -1,7 +1,7 @@ pkgbase = jbig2enc pkgdesc = A JBIG2 image encoder pkgver = 0.29 - pkgrel = 4 + pkgrel = 5 url = https://github.com/agl/jbig2enc changelog = CHANGELOG arch = i686 @@ -21,12 +21,12 @@ pkgbase = jbig2enc source = https://github.com/agl/jbig2enc/archive/refs/tags/0.29.tar.gz source = jbig2enc-pdfpy.patch source = jbig2enc.1 - source = commit-ea6a40a.patch + source = commit-ea0501904.patch source = dpi.patch sha256sums = bfcf0d0448ee36046af6c776c7271cd5a644855723f0a832d1c0db4de3c21280 sha256sums = a5d98fc43b2f3dc73dd1f352a439a6ae73fd085f469420aa29e47d9a4e2f40f6 sha256sums = c940124f102695872fae02b243e0dd99c05ecfb3ecef0a476b3e903a0db69a54 - sha256sums = 99d086e922653cc6fa0b1cccff90f9fd1d279ecd96104e73ea281c253781718a + sha256sums = c2f1c825346f38747f8c85a2020b78922cc964052d78cafd7673ec456acd9dae sha256sums = 5cccc44d3019367351516cc3952692fbe23bc05b7c5726553f98d5b262f78686 pkgname = jbig2enc diff --git a/CHANGELOG b/CHANGELOG index 9b728bf42803..848b479e8d6a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +v0.29-5 +Updated to https://github.com/agl/jbig2enc/commit/ea050190466f5336c69c6a11baa1cb686677fcab +Fix build with Leptonica >=1.83. + v0.29-4: jbig2enc 0.29-4 contains a patch to set the dpi of images without dpi information. See here: @@ -4,7 +4,7 @@ pkgname=jbig2enc pkgver=0.29 -pkgrel=4 +pkgrel=5 pkgdesc="A JBIG2 image encoder" arch=('i686' 'x86_64') url="https://github.com/agl/jbig2enc" @@ -18,22 +18,22 @@ changelog=CHANGELOG source=("https://github.com/agl/jbig2enc/archive/refs/tags/$pkgver.tar.gz" "jbig2enc-pdfpy.patch" "jbig2enc.1" - "commit-ea6a40a.patch" + "commit-ea0501904.patch" "dpi.patch") sha256sums=('bfcf0d0448ee36046af6c776c7271cd5a644855723f0a832d1c0db4de3c21280' 'a5d98fc43b2f3dc73dd1f352a439a6ae73fd085f469420aa29e47d9a4e2f40f6' 'c940124f102695872fae02b243e0dd99c05ecfb3ecef0a476b3e903a0db69a54' - '99d086e922653cc6fa0b1cccff90f9fd1d279ecd96104e73ea281c253781718a' + 'c2f1c825346f38747f8c85a2020b78922cc964052d78cafd7673ec456acd9dae' '5cccc44d3019367351516cc3952692fbe23bc05b7c5726553f98d5b262f78686') prepare() { cd "${srcdir}/${pkgname}-${pkgver}" #sed -i 's@^#!/usr/bin/python$@#!/usr/bin/env python2@' pdf.py - patch --forward --strip=1 --input="${srcdir}/commit-ea6a40a.patch" + patch --forward --strip=1 --input="${srcdir}/commit-ea0501904.patch" patch --forward --strip=1 --input="${srcdir}/jbig2enc-pdfpy.patch" patch --forward --strip=1 --input="${srcdir}/dpi.patch" - cat "${srcdir}/jbig2enc.1" | gzip > "${srcdir}/jbig2enc.1.gz" + gzip -c "${srcdir}/jbig2enc.1" > "${srcdir}/jbig2enc.1.gz" } build() { diff --git a/commit-ea0501904.patch b/commit-ea0501904.patch new file mode 100644 index 000000000000..ef15379f69de --- /dev/null +++ b/commit-ea0501904.patch @@ -0,0 +1,90 @@ +diff --unified --recursive --text jbig2enc-0.29/configure.ac jbig2enc-master/configure.ac +--- jbig2enc-0.29/configure.ac 2017-01-30 12:27:36.000000000 -0500 ++++ jbig2enc-master/configure.ac 2023-07-11 20:49:46.508050549 -0400 +@@ -73,7 +73,7 @@ + fi], + [libtool_patch_use_rpath=$enable_rpath]) + +-AC_CHECK_LIB([lept], [findFileFormatStream], [], [ ++AC_CHECK_LIB([leptonica], [findFileFormatStream], [], [ + echo "Error! Leptonica not detected." + exit -1 + ]) +Only in jbig2enc-master: .git +diff --unified --recursive --text jbig2enc-0.29/src/jbig2.cc jbig2enc-master/src/jbig2.cc +--- jbig2enc-0.29/src/jbig2.cc 2017-01-30 12:27:36.000000000 -0500 ++++ jbig2enc-master/src/jbig2.cc 2023-07-11 20:49:46.514717176 -0400 +@@ -29,6 +29,9 @@ + #endif + + #include <leptonica/allheaders.h> ++#if (LIBLEPT_MAJOR_VERSION == 1 && LIBLEPT_MINOR_VERSION >= 83) || LIBLEPT_MAJOR_VERSION > 1 ++#include "leptonica/pix_internal.h" ++#endif + + #include "jbig2enc.h" + +@@ -418,8 +421,11 @@ + if (pixl->d > 8) { + gray = pixConvertRGBToGrayFast(pixl); + if (!gray) return 1; +- } else { ++ } else if (pixl->d == 4 || pixl->d == 8) { + gray = pixClone(pixl); ++ } else { ++ fprintf(stderr, "Unsupported input image depth: %d\n", pixl->d); ++ return 1; + } + if (up2) { + pixt = pixScaleGray2xLIThresh(gray, bw_threshold); +@@ -432,6 +438,10 @@ + } else { + pixt = pixClone(pixl); + } ++ if (!pixt) { ++ fprintf(stderr, "Failed to convert input image to binary\n"); ++ return 1; ++ } + if (verbose) + pixInfo(pixt, "thresholded image:"); + +diff --unified --recursive --text jbig2enc-0.29/src/jbig2enc.cc jbig2enc-master/src/jbig2enc.cc +--- jbig2enc-0.29/src/jbig2enc.cc 2017-01-30 12:27:36.000000000 -0500 ++++ jbig2enc-master/src/jbig2enc.cc 2023-07-11 20:49:46.514717176 -0400 +@@ -24,6 +24,10 @@ + #include <string.h> + + #include <leptonica/allheaders.h> ++#if (LIBLEPT_MAJOR_VERSION == 1 && LIBLEPT_MINOR_VERSION >= 83) || LIBLEPT_MAJOR_VERSION > 1 ++#include "leptonica/pix_internal.h" ++#include "leptonica/array_internal.h" ++#endif + + #include <math.h> + #if defined(sun) +@@ -206,7 +210,11 @@ + numaSetValue(ctx->classer->naclass, i, new_representant); + } + } ++#if (LIBLEPT_MAJOR_VERSION == 1 && LIBLEPT_MINOR_VERSION >= 83) || LIBLEPT_MAJOR_VERSION > 1 ++ ctx->classer->pixat->pix[new_representant]->refcount += ctx->classer->pixat->pix[second_template]->refcount; ++#else + pixChangeRefcount(ctx->classer->pixat->pix[new_representant],pixGetRefcount(ctx->classer->pixat->pix[second_template])); ++#endif + } + return 0; + } +diff --unified --recursive --text jbig2enc-0.29/src/jbig2sym.cc jbig2enc-master/src/jbig2sym.cc +--- jbig2enc-0.29/src/jbig2sym.cc 2017-01-30 12:27:36.000000000 -0500 ++++ jbig2enc-master/src/jbig2sym.cc 2023-07-11 20:49:46.514717176 -0400 +@@ -29,6 +29,10 @@ + #include <stdio.h> + + #include <leptonica/allheaders.h> ++#if (LIBLEPT_MAJOR_VERSION == 1 && LIBLEPT_MINOR_VERSION >= 83) || LIBLEPT_MAJOR_VERSION > 1 ++#include "leptonica/pix_internal.h" ++#include "leptonica/array_internal.h" ++#endif + + #include <math.h> + diff --git a/commit-ea6a40a.patch b/commit-ea6a40a.patch deleted file mode 100644 index 69260fa7ecda..000000000000 --- a/commit-ea6a40a.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/src/jbig2.cc b/src/jbig2.cc -index 515c1ef..0bddb90 100644 ---- a/src/jbig2.cc -+++ b/src/jbig2.cc -@@ -418,8 +418,11 @@ main(int argc, char **argv) { - if (pixl->d > 8) { - gray = pixConvertRGBToGrayFast(pixl); - if (!gray) return 1; -- } else { -+ } else if (pixl->d == 4 || pixl->d == 8) { - gray = pixClone(pixl); -+ } else { -+ fprintf(stderr, "Unsupported input image depth: %d\n", pixl->d); -+ return 1; - } - if (up2) { - pixt = pixScaleGray2xLIThresh(gray, bw_threshold); -@@ -432,6 +435,10 @@ main(int argc, char **argv) { - } else { - pixt = pixClone(pixl); - } -+ if (!pixt) { -+ fprintf(stderr, "Failed to convert input image to binary\n"); -+ return 1; -+ } - if (verbose) - pixInfo(pixt, "thresholded image:"); - |