summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author M.Dinslage2023-03-17 21:32:18 +0100
committer Willy Sudiarto Raharjo2023-03-25 04:01:46 +0100
commit78d514145fec116453b12c358fe9eca00623a390 (patch)
treee1704b3aa64e48ef34393633e1416391c4ad162b
parentb583f65d218f10bb40133a3aa9724356c97fa271 (diff)
downloadslackbuilds-78d514145fec116453b12c358fe9eca00623a390.tar.gz
multimedia/ccextractor: Patched for leptonica-1.83.1.
Signed-off-by: bedlam <dave@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--multimedia/ccextractor/ccextractor.SlackBuild9
-rw-r--r--multimedia/ccextractor/leptonica-1.83.1.patch36
2 files changed, 43 insertions, 2 deletions
diff --git a/multimedia/ccextractor/ccextractor.SlackBuild b/multimedia/ccextractor/ccextractor.SlackBuild
index a7850354b9..734b159af3 100644
--- a/multimedia/ccextractor/ccextractor.SlackBuild
+++ b/multimedia/ccextractor/ccextractor.SlackBuild
@@ -26,7 +26,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=ccextractor
VERSION=${VERSION:-0.94}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -71,7 +71,7 @@ mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar -xvf $CWD/$PRGNAM-$VERSION.tar.gz
-cd $PRGNAM-$VERSION/linux
+cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
@@ -79,9 +79,14 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+# Fix compiling with new leptonica
+patch -p1 < $CWD/leptonica-1.83.1.patch
+
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
+cd linux
./autogen.sh
+sed -i 's/-llept/-lleptonica/g' configure
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
diff --git a/multimedia/ccextractor/leptonica-1.83.1.patch b/multimedia/ccextractor/leptonica-1.83.1.patch
new file mode 100644
index 0000000000..af419af8a7
--- /dev/null
+++ b/multimedia/ccextractor/leptonica-1.83.1.patch
@@ -0,0 +1,36 @@
+diff -up ccextractor-0.94/src/lib_ccx/ocr.c.orig ccextractor-0.94/src/lib_ccx/ocr.c
+--- ccextractor-0.94/src/lib_ccx/ocr.c.orig 2023-03-16 18:58:34.902356675 -0500
++++ ccextractor-0.94/src/lib_ccx/ocr.c 2023-03-16 19:00:33.481092541 -0500
+@@ -1,10 +1,10 @@
+ #include <math.h>
+-#include "png.h"
++#include <png.h>
+ #include "lib_ccx.h"
+ #ifdef ENABLE_OCR
+ #include <tesseract/capi.h>
+-#include "ccx_common_constants.h"
+ #include <leptonica/allheaders.h>
++#include "ccx_common_constants.h"
+ #include <dirent.h>
+ #include "ccx_encoders_helpers.h"
+ #include "ocr.h"
+@@ -331,6 +331,8 @@ char *ocr_bitmap(void *arg, png_color *p
+ }
+
+ BOX *crop_points = ignore_alpha_at_edge(copy->alpha, copy->data, w, h, color_pix, &color_pix_out);
++ l_int32 x, y, _w, _h;
++ boxGetGeometry(crop_points, &x, &y, &_w, &_h);
+ // Converting image to grayscale for OCR to avoid issues with transparency
+ cpix_gs = pixConvertRGBToGray(cpix, 0.0, 0.0, 0.0);
+
+@@ -426,8 +428,8 @@ char *ocr_bitmap(void *arg, png_color *p
+ {
+ for (int j = x1; j <= x2; j++)
+ {
+- if (copy->data[(crop_points->y + i) * w + (crop_points->x + j)] != firstpixel)
+- histogram[copy->data[(crop_points->y + i) * w + (crop_points->x + j)]]++;
++ if (copy->data[(y + i) * w + (x + j)] != firstpixel)
++ histogram[copy->data[(y + i) * w + (x + j)]]++;
+ }
+ }
+ /* sorted in increasing order of intensity */