multimedia/ccextractor: Switch to cmake.

Signed-off-by: bedlam <dave@slackbuilds.org>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
M.Dinslage 2023-03-26 23:22:51 +01:00 committed by Willy Sudiarto Raharjo
parent 58ff6e68c0
commit 9552b7fb8c
No known key found for this signature in database
GPG key ID: 3F617144D7238786

View file

@ -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
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 ..
make
make install DESTDIR=$PKG
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