# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package # BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE # BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT prepare() { cd "$BPM_SOURCE" patch -Np1 -i "$BPM_WORKDIR"/svt-av1-fix.patch } # The build function is executed in the source directory # This function is used to compile the source code build() { ./configure --prefix=/usr \ --incdir=/usr/include/ffmpeg4.4 \ --libdir=/usr/lib/ffmpeg4.4 \ --enable-gpl \ --enable-version3 \ --disable-static \ --enable-shared \ --disable-debug \ --disable-stripping \ --disable-doc \ --disable-programs \ --enable-gnutls \ --enable-libaom \ --enable-libass \ --enable-libdrm \ --enable-libfreetype \ --enable-libmp3lame \ --enable-libopus \ --enable-libpulse \ --enable-libspeex \ --enable-libvorbis \ --enable-libvpx \ --enable-libwebp \ --enable-libx264 \ --enable-libx265 \ --enable-libxml2 \ --enable-vulkan \ --enable-librav1e \ --enable-libsvtav1 \ --enable-gmp \ --enable-libopenjpeg \ --enable-libopus \ --enable-librsvg \ --ignore-tests=enhanced-flv-av1 \ --docdir=/usr/share/doc/ffmpeg make make tools/qt-faststart make doc/ff{mpeg,play}.1 } # The package function is executed in the source directory # This function is used to move the compiled files into the output directory package() { make DESTDIR="$BPM_OUTPUT" install # Move libs to /usr/lib, except the .so symlinks pushd "$BPM_OUTPUT" &> /dev/null local f for f in usr/lib/ffmpeg4.4/*; do if [[ $f == *.so ]]; then ln -srf -- usr/lib/"$(readlink "$f")" "$f" elif [[ ! -d $f ]]; then mv "$f" usr/lib fi done rm -r usr/share popd &> /dev/null # Install package license install -Dm644 "$BPM_SOURCE"/COPYING.GPLv3 "$BPM_OUTPUT"/usr/share/licenses/ffmpeg4.4/COPYING.GPLv3 }