libraries/jbig2enc: Patch for the newer leptonica.

Just recycled the termux-packages patches available on github

Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Didier Spaier 2023-01-08 09:49:08 +01:00 committed by Willy Sudiarto Raharjo
parent 93de8c0762
commit 36b2483448
No known key found for this signature in database
GPG key ID: 3F617144D7238786
3 changed files with 66 additions and 1 deletions

View file

@ -0,0 +1,20 @@
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
AC_INIT([jbig2enc], [0.28], [agl@imperialviolet.org], [jbig2enc-0.28],
[https://github.com/agl/jbig2enc])
AC_CONFIG_MACRO_DIR([m4])
-AM_INIT_AUTOMAKE([-Wall -Werror foreign no-dependencies])
+AM_INIT_AUTOMAKE([-Wall foreign no-dependencies])
# this should fix automake 1.12 build and compatible with automake 1.11
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
@@ -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
])

View file

@ -0,0 +1,42 @@
--- a/src/jbig2.cc
+++ b/src/jbig2.cc
@@ -29,6 +29,8 @@
#endif
#include <leptonica/allheaders.h>
+#include <leptonica/array_internal.h>
+#include <leptonica/pix_internal.h>
#include "jbig2enc.h"
--- a/src/jbig2enc.cc
+++ b/src/jbig2enc.cc
@@ -24,6 +24,8 @@
#include <string.h>
#include <leptonica/allheaders.h>
+#include <leptonica/array_internal.h>
+#include <leptonica/pix_internal.h>
#include <math.h>
#if defined(sun)
@@ -206,7 +208,7 @@
numaSetValue(ctx->classer->naclass, i, new_representant);
}
}
- pixChangeRefcount(ctx->classer->pixat->pix[new_representant],pixGetRefcount(ctx->classer->pixat->pix[second_template]));
+ ctx->classer->pixat->pix[new_representant]->refcount += ctx->classer->pixat->pix[second_template]->refcount;
}
return 0;
}
--- a/src/jbig2sym.cc
+++ b/src/jbig2sym.cc
@@ -29,6 +29,8 @@
#include <stdio.h>
#include <leptonica/allheaders.h>
+#include <leptonica/array_internal.h>
+#include <leptonica/pix_internal.h>
#include <math.h>

View file

@ -13,7 +13,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=jbig2enc
VERSION=${VERSION:-0.29}
BUILD=${BUILD:-3}
BUILD=${BUILD:-4}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@ -65,6 +65,9 @@ chown -R root:root .
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
patch -p1 < $CWD/jbig2enc-2019.09.08-leptonica-1.83.0.patch
patch -p1 < $CWD/configure.ac.patch
autoreconf -if
CFLAGS="$SLKCFLAGS" \