mirror of
https://github.com/dslm4515/BMLFS.git
synced 2026-01-14 00:33:30 +00:00
109 lines
4.5 KiB
Bash
109 lines
4.5 KiB
Bash
#! /bin/bash
|
|
|
|
# FFmpeg
|
|
# Source: https://ffmpeg.org/releases/ffmpeg-7.1.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/0002-avcodec-libsvtav1-unbreak-build-with-latest-svtav1.patch
|
|
patch -Np1 -i ../patches/ffmpeg-chimera/add-av_stream_get_first_dts-for-chromium.patch
|
|
patch -Np1 -i ../patches/ffmpeg-chimera/clang-ppc4xx.patch
|
|
patch -Np1 -i ../patches/ffmpeg-chimera/fp.patch
|
|
patch -Np1 -i ../patches/ffmpeg-chimera/h264dsp-rvv.patch
|
|
patch -Np1 -i ../patches/ffmpeg-chimera/vapoursynth-script.patch
|
|
patch -Np1 -i ../patches/ffmpeg-chimera/vec-xl.patch
|
|
|
|
export PVER="7.1.1"
|
|
|
|
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++ "
|
|
|
|
# Set build options
|
|
export CARGS="--prefix=/usr --docdir=/usr/share/doc/ffmpeg-$PVER "
|
|
export CARGS+="--enable-gpl --enable-version3 --enable-nonfree "
|
|
export CARGS+="--disable-static --enable-shared --disable-debug "
|
|
export CARGS+="--enable-postproc --enable-runtime-cpudetect "
|
|
|
|
# Omit packages, if not installed:
|
|
export CARGS+="--enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus "
|
|
export CARGS+="--enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 "
|
|
export CARGS+="--enable-libass --enable-libcdio --enable-libdrm --enable-libdvdnav --enable-libdvdread "
|
|
export CARGS+="--enable-libjxl --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libplacebo "
|
|
export CARGS+="--enable-libpulse --enable-librsvg --enable-libv4l2 --enable-libshaderc --enable-libxvid "
|
|
export CARGS+="--enable-libwebp --enable-vulkan --enable-vaapi --enable-libxml2 --enable-libspeex "
|
|
export CARGS+="--enable-libfribidi --enable-alsa --enable-libharfbuzz "
|
|
|
|
CFLAGS="-D_GNU_SOURCE " \
|
|
./configure $CARGS $ECONF $XARGS
|
|
|
|
read -p "Compile?" && make -j2 &&
|
|
unset ECONF XARGS CARGS
|
|
|
|
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-$PVER-$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-$PVER-$NOPSUFFIX &&
|
|
sudo -S rm -rf /BMAN/*
|
|
sudo -S rm -rf ${BUILD}/*
|