#!/bin/bash # Slackware build script for ffmpeg # Copyright 2010-2017 Heinz Wiesinger, Amsterdam, The Netherlands # Copyright 2017, 2018 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Originally written by core (eroc@linuxmail.org) # Modified by Robby Workman # Included in Slint by Didier Spaier didieratslintdotfr # Note enabling lensfun or opencv fail? Maybe try again with ffmpeg5... #Pour opencv essayer un symlink... cd $(dirname $0) ; CWD=$(pwd) PKGNAM=ffmpeg VERSION=5.1.2 BUILD=${BUILD:-1slint} SRCNAM=ffmpeg if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac fi TMP=$CWD PKG=$TMP/package-$PKGNAM NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "} if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" else SLKCFLAGS="-O2" LIBDIRSUFFIX="" fi # If PulseAudio is not found, use the _alsa $TAG and disable it in the build: if [ ! -r /usr/lib${LIBDIRSUFFIX}/pkgconfig/libpulse.pc ]; then TAG="_alsa" PULSEAUDIO=no 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 "$PKGNAM-$VERSION-$ARCH-$BUILD$TAG.txz" exit 0 fi rm -rf $PKG mkdir -p $TMP $PKG cd $TMP rm -rf $PKGNAM-$VERSION tar xf $CWD/$SRCNAM-$VERSION.tar.xz || exit 1 cd $SRCNAM-$VERSION || exit 1 chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ -o -perm 511 \) -exec chmod 755 {} \+ -o \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+ # Fix linking with flite: sed -i "s| -lflite\"| -lflite -lm -lasound\"|" configure || exit 1 CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --shlibdir=/usr/lib${LIBDIRSUFFIX} \ --docdir=/usr/doc/$PKGNAM-$VERSION/html \ --mandir=/usr/man \ --disable-debug \ --disable-static \ --enable-shared \ --enable-encoder=aac \ --enable-fontconfig \ --enable-frei0r \ --enable-gcrypt \ --enable-gpl \ --enable-ladspa \ --enable-libaom \ --enable-libass \ --enable-libbluray \ --enable-libbs2b \ --enable-libcaca \ --enable-libcdio \ --enable-libcelt \ --enable-libcodec2 \ --enable-libdav1d \ --enable-libdc1394 \ --enable-libdrm \ --enable-libfdk-aac \ --enable-libflite \ --enable-libfreetype \ --enable-libfribidi \ --enable-libgme \ --enable-libgsm \ --enable-libiec61883 \ --enable-libilbc \ --enable-libglslang \ --enable-libjack \ --enable-libmodplug \ --enable-libmp3lame \ --enable-libopencore-amrnb \ --enable-libopencore-amrwb \ --enable-libopenjpeg \ --enable-libopus \ --enable-libplacebo \ --enable-libpulse \ --enable-librsvg \ --enable-librtmp \ --enable-librubberband \ --enable-libsmbclient \ --enable-libsnappy \ --enable-libsoxr \ --enable-libspeex \ --enable-libsrt \ --enable-libssh \ --enable-libtesseract \ --enable-libtheora \ --enable-libtwolame \ --enable-libv4l2 \ --enable-libvidstab \ --enable-libvorbis \ --enable-libvpx \ --enable-libwebp \ --enable-libx264 \ --enable-libx265 \ --enable-libxml2 \ --enable-libxvid \ --enable-libxml2 \ --enable-libzimg \ --enable-libzmq \ --enable-libzvbi \ --enable-lv2 \ --enable-nonfree \ --enable-openal \ --enable-opencl \ --enable-opengl \ --enable-openssl \ --enable-shared \ --enable-vapoursynth \ --enable-version3 #libtls... #chromaprint: circular dep? make $NUMJOBS || make || exit 1 make install DESTDIR=$PKG || exit 1 make install-man DESTDIR=$PKG || exit 1 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 find $PKG/usr/man -type f -exec gzip -9 {} \+ mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION/txt cp -a \ Changelog COPYING* CREDITS INSTALL* LICENSE* MAINTAINERS README* \ RELEASE VERSION \ $PKG/usr/doc/$PKGNAM-$VERSION cp -a doc/*.txt $PKG/usr/doc/$PKGNAM-$VERSION/txt/ find . -name "RELEASE_NOTES" -exec cp -a {} $PKG/usr/doc/$PKGNAM-$VERSION/ \; # If there's a ChangeLog, installing at least part of the recent history # is useful, but don't let it get totally out of control: if [ -r ChangeLog ]; then DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION) cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog touch -r ChangeLog $DOCSDIR/ChangeLog fi mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG local f for f in usr/lib64/ffmpeg5.1/*; do if [[ $f == *.so ]]; then ln -srf -- usr/lib/"$(readlink "$f")" "$f" elif [[ ! -d $f ]]; then mv "$f" usr/lib fi done /sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD$TAG.txz