aboutsummaryrefslogtreecommitdiff
path: root/multimedia/ccextractor
diff options
context:
space:
mode:
authorM.Dinslage <matthewdinslage@gmail.com>2023-03-26 23:22:51 +0100
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2023-04-01 09:14:07 +0700
commit9552b7fb8cef418581fe6338f21fbe6d81c980f0 (patch)
treefccb1e9ac6077c137d563c9e7d0046e074c507c9 /multimedia/ccextractor
parent58ff6e68c036d6de2a27ccf60948c85e5832a2a7 (diff)
multimedia/ccextractor: Switch to cmake.
Signed-off-by: bedlam <dave@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'multimedia/ccextractor')
-rw-r--r--multimedia/ccextractor/ccextractor.SlackBuild62
1 files changed, 34 insertions, 28 deletions
diff --git a/multimedia/ccextractor/ccextractor.SlackBuild b/multimedia/ccextractor/ccextractor.SlackBuild
index 734b159af378a..8e072caee8fc4 100644
--- a/multimedia/ccextractor/ccextractor.SlackBuild
+++ b/multimedia/ccextractor/ccextractor.SlackBuild
@@ -2,7 +2,7 @@
# 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
@@ -26,7 +26,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=ccextractor
VERSION=${VERSION:-0.94}
-BUILD=${BUILD:-3}
+BUILD=${BUILD:-4}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -38,9 +38,6 @@ if [ -z "$ARCH" ]; then
esac
fi
-# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
-# the name of the created package would be, and then exit. This information
-# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@@ -70,7 +67,7 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
-tar -xvf $CWD/$PRGNAM-$VERSION.tar.gz
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
@@ -79,35 +76,44 @@ 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
+# 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
-CFLAGS="$SLKCFLAGS" \
-CXXFLAGS="$SLKCFLAGS" \
-cd linux
-./autogen.sh
-sed -i 's/-llept/-lleptonica/g' configure
-./configure \
- --prefix=/usr \
- --libdir=/usr/lib${LIBDIRSUFFIX} \
- --sysconfdir=/etc \
- --localstatedir=/var \
- --enable-static=no \
- --docdir=/usr/doc/$PRGNAM-$VERSION \
- --without-rust \
- --enable-hardsubx \
- --enable-ffmpeg \
- --enable-ocr \
- --build=$ARCH-slackware-linux
-
-make
-make install DESTDIR=$PKG
+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