summaryrefslogtreecommitdiffstats
path: root/multimedia/ccextractor
diff options
context:
space:
mode:
Diffstat (limited to 'multimedia/ccextractor')
-rw-r--r--multimedia/ccextractor/README8
-rw-r--r--multimedia/ccextractor/ccextractor.SlackBuild83
-rw-r--r--multimedia/ccextractor/ccextractor.info8
-rw-r--r--multimedia/ccextractor/leptonica-1.83.1.patch36
4 files changed, 89 insertions, 46 deletions
diff --git a/multimedia/ccextractor/README b/multimedia/ccextractor/README
index 6dccda83a4..8f1e782dc5 100644
--- a/multimedia/ccextractor/README
+++ b/multimedia/ccextractor/README
@@ -3,10 +3,4 @@ independent subtitle files from the closed captions data. CCExtractor
is portable, small, and very fast. Notable features include the
ability to extract subtitles in real-time, translate subtitles,
extract closed captions from DVDs, and convert closed captions
-to subtitles.
-
-By default only build the CLI version of ccextractor. If you would
-like to also build the GUI version, then install glfw3 available
-here at SBo and run the script like so
-
-GUI=yes ./ccextractor.SlackBuild
+to subtitles.
diff --git a/multimedia/ccextractor/ccextractor.SlackBuild b/multimedia/ccextractor/ccextractor.SlackBuild
index 78018a2b3b..8e072caee8 100644
--- a/multimedia/ccextractor/ccextractor.SlackBuild
+++ b/multimedia/ccextractor/ccextractor.SlackBuild
@@ -1,8 +1,8 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for ccextractor
-# Copyright 2019 Matt Dinslage, Springfield, MO
+# Copyright 2023 Matt Dinslage, Springfield MO
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,10 +22,13 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=ccextractor
-VERSION=${VERSION:-0.88}
-BUILD=${BUILD:-1}
+VERSION=${VERSION:-0.94}
+BUILD=${BUILD:-4}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -35,14 +38,15 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-# Pass GUI=yes if you want to build gui support
-GUI=${GUI:-"no"}
-
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
@@ -57,21 +61,14 @@ else
LIBDIRSUFFIX=""
fi
-if [ "${GUI:-yes}" = "yes" ]; then
- gui="--with-gui"
-else
- gui=""
-fi
-
-
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
-tar -xvf $CWD/$PRGNAM-$VERSION.tar.gz
-cd $PRGNAM-$VERSION/linux
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
@@ -79,32 +76,48 @@ 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 {} \;
-CFLAGS="$SLKCFLAGS" \
-CXXFLAGS="$SLKCFLAGS" \
-./autogen.sh
-./configure \
- --prefix=/usr \
- --libdir=/usr/lib${LIBDIRSUFFIX} \
- --sysconfdir=/etc \
- --localstatedir=/var \
- --enable-static=no \
- --docdir=/usr/doc/$PRGNAM-$VERSION \
- $gui \
- --enable-ocr \
- --build=$ARCH-slackware-linux
-
-make
-make install DESTDIR=$PKG
+# Fix libdir
+if [ "$ARCH" = "x86_64" ]; then
+sed -i \
+ -e 's|${prefix}/lib|${prefix}/lib64|g' \
+ -e 's|lib/pkgconfig|lib64/pkgconfig|g' \
+ -e 's|lib)|lib64)|g' \
+ src/lib_ccx/CMakeLists.txt
+fi
+
+# Fix building with new leptonica
+patch -p1 < $CWD/leptonica-1.83.1.patch
+
+mkdir -p build
+cd build
+ cmake ../src \
+ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DLIB_SUFFIX=${LIBDIRSUFFIX} \
+ -DMAN_INSTALL_DIR=/usr/man \
+ -DWITHOUT_RUST=ON \
+ -DWITH_OCR=ON \
+ -DWITH_HARDSUBX=ON \
+ -DWITH_FFMPEG=ON \
+ -DCMAKE_BUILD_TYPE=Release ..
+ make
+ make install/strip DESTDIR=$PKG
+cd ..
+
+rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a ../LICENSE.txt ../README.md $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a \
+ LICENSE.txt README.md \
+ $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/multimedia/ccextractor/ccextractor.info b/multimedia/ccextractor/ccextractor.info
index 2e5ee2b47c..07374db12e 100644
--- a/multimedia/ccextractor/ccextractor.info
+++ b/multimedia/ccextractor/ccextractor.info
@@ -1,10 +1,10 @@
PRGNAM="ccextractor"
-VERSION="0.88"
+VERSION="0.94"
HOMEPAGE="https://www.ccextractor.org/"
-DOWNLOAD="https://github.com/CCExtractor/ccextractor/archive/v0.88/ccextractor-0.88.tar.gz"
-MD5SUM="914f8704251ce24dcbb756590cf39955"
+DOWNLOAD="https://github.com/CCExtractor/ccextractor/archive/v0.94/ccextractor-0.94.tar.gz"
+MD5SUM="218f8f4628294fa218f2aad162bf68c7"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="tesseract"
MAINTAINER="M.Dinslage"
-EMAIL="daedra1980@gmail.com"
+EMAIL="matthewdinslage@gmail.com"
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 */