Files
ffmpeg4.4/source.sh
T
2025-10-11 11:27:30 +03:00

63 lines
2.5 KiB
Bash

# 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
# 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-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 \
--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
}