Files
BMLFS/build-scripts/ffmpeg.build
2024-08-18 14:53:57 -05:00

107 lines
4.0 KiB
Bash

#! /bin/bash
# FFmpeg
# Source: https://ffmpeg.org/releases/ffmpeg-7.0.1.tar.xz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: NONE
# Recommended: libass, fdk-aac, FreeType, LAME, libtheora, libvorbis, AOM
# Recommended: libvpx, Opus, x264, x265, yasm, alsa-lib, libva, libvdpau
# Optional: Fontconfig, frei0r-plugins, libcdio(to identify and play CDs),
# Optional: libdrm(for “kmsgrab” input), libwebp, opencv, OpenJPEG,
# Optional: GnuTLS, PulseAudio, Speex, v4l-utils, XviD, X Window System,
# Optional: Flite, GSM, libaacplus, libbluray, libcaca, libcelt, libdc1394,
# Optional: libdca, libiec61883, libilbc, libmodplug, libnut (Git checkout),
# Optional: librtmp, libssh, OpenAL, OpenCore AMR, Schroedinger, TwoLAME,
# OPtional: vo-aaenc, vo-amrwbenc, and ZVBI
# Apply patches from Chimera Linux
patch -Np1 -i ../patches/ffmpeg-chimera/0001-ffbuild-libversion.sh-add-shebang.patch
patch -Np1 -i ../patches/ffmpeg-chimera/add-av_stream_get_first_dts-for-chromium.patch
patch -Np1 -i ../patches/ffmpeg-chimera/bigendian.patch
patch -Np1 -i ../patches/ffmpeg-chimera/clang-ppc4xx.patch
#patch -Np1 -i ../patches/ffmpeg-chimera/riscv-asm.patch
patch -Np1 -i ../patches/ffmpeg-chimera/v4l-ioctl.patch
patch -Np1 -i ../patches/ffmpeg-chimera/vec-xl.patch
case $(uname -m) in
i686) export ECONF="--disable-asm --enable-libaom --enable-pic" ;;
x86_64|aarch64) export ECONF="--enable-libaom" ;;
esac &&
# If using LLVm instead of GCC, add these flags:
export XARGS="--cc=clang --cxx=clang++ "
./configure --prefix=/usr \
--enable-gpl \
--enable-version3 \
--enable-nonfree \
--disable-static \
--enable-shared \
--disable-debug \
--enable-libass \
--enable-libfdk-aac \
--enable-libfreetype \
--enable-libmp3lame \
--enable-libopus \
--enable-libtheora \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-libx265 \
--docdir=/usr/share/doc/ffmpeg-7.0.1 $ECONF $XARGS &&
read -p "Compile?" && make -j2 &&
unset ECONF XARGS
gcc tools/qt-faststart.c -o tools/qt-faststart &&
sudo -S make DESTDIR=$BUILD install &&
sudo -S install -v -m755 tools/qt-faststart ${BUILD}/usr/bin &&
sudo -S mkdir -pv /BMAN/install && \
sudo -S mkdir -pv /BMAN/usr/share && \
sudo -S mv $BUILD/usr/share/doc /BMAN/usr/share
sudo -S mv $BUILD/usr/share/man /BMAN/usr/share
cd $BUILD && sudo -S mkdir -v ${BUILD}/install &&
cat > /tmp/slack-desc << "EOF"
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
ffmpeg: ffmpeg (software to record, convert and stream audio and video)
ffmpeg:
ffmpeg: FFmpeg is a complete solution to record, convert and stream audio and
ffmpeg: video. It includes libavcodec, the leading audio/video codec library.
ffmpeg:
ffmpeg:
ffmpeg:
ffmpeg:
ffmpeg:
ffmpeg: ffmpeg home: http://ffmpeg.org/
ffmpeg:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/ffmpeg-7.0.1-$PSUFFIX &&
cd /BMAN
cat > /tmp/slack-desc << "EOF"
ffmpeg-doc: Manuals for ffmpeg
ffmpeg-doc:
ffmpeg-doc: A complete solution to record, convert and stream audio and video.
ffmpeg-doc: It includes libavcodec, the leading audio/video codec library.
ffmpeg-doc:
ffmpeg-doc: http://ffmpeg.org/
ffmpeg-doc:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/ffmpeg-doc-7.0.1-$NOPSUFFIX &&
sudo -S rm -rf /BMAN/*
sudo -S rm -rf ${BUILD}/*