mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-04 14:08:51 +02:00
257 lines
7.4 KiB
Bash
257 lines
7.4 KiB
Bash
SUMMARY="Audio and video recording, conversion, and streaming library"
|
|
DESCRIPTION="FFmpeg is a complete, cross-platform solution to record, convert \
|
|
and stream audio and video. It includes libavcodec - the leading audio/video \
|
|
codec library."
|
|
HOMEPAGE="https://ffmpeg.org/"
|
|
COPYRIGHT="2000-2003 Fabrice Bellard
|
|
2003-2018 the FFmpeg developers"
|
|
LICENSE="GNU LGPL v2.1
|
|
GNU GPL v2"
|
|
REVISION="3"
|
|
SOURCE_URI="https://ffmpeg.org/releases/ffmpeg-$portVersion.tar.xz"
|
|
CHECKSUM_SHA256="2b92e9578ef8b3e49eeab229e69305f5f4cbc1fdaa22e927fc7fca18acccd740"
|
|
PATCHES="ffmpeg-$portVersion.patchset"
|
|
|
|
ARCHITECTURES="!x86_gcc2 x86 x86_64"
|
|
SECONDARY_ARCHITECTURES="?x86"
|
|
|
|
ffmpegLibs="\
|
|
libavcodec \
|
|
libavdevice \
|
|
libavfilter \
|
|
libavformat \
|
|
libavresample \
|
|
libavutil \
|
|
libpostproc \
|
|
libswresample \
|
|
libswscale \
|
|
"
|
|
# Do not sort alphabetically
|
|
libavutilVersion="55.78.100"
|
|
libavcodecVersion="57.107.100"
|
|
libavformatVersion="57.83.100"
|
|
libavdeviceVersion="57.10.100"
|
|
libavfilterVersion="6.107.100"
|
|
libavresampleVersion="3.7.0"
|
|
libswscaleVersion="4.8.100"
|
|
libswresampleVersion="2.9.100"
|
|
libpostprocVersion="54.7.100"
|
|
portVersionCompat="$portVersion compat >= 3.2"
|
|
for i in $ffmpegLibs; do
|
|
eval "${i}VersionCompat=\"\$${i}Version compat >= \${${i}Version%%.*}\""
|
|
done
|
|
|
|
PROVIDES="
|
|
ffmpeg$secondaryArchSuffix = $portVersionCompat
|
|
lib:libavcodec$secondaryArchSuffix = $libavcodecVersionCompat
|
|
lib:libavfilter$secondaryArchSuffix = $libavfilterVersionCompat
|
|
lib:libavformat$secondaryArchSuffix = $libavformatVersionCompat
|
|
lib:libavresample$secondaryArchSuffix = $libavresampleVersionCompat
|
|
lib:libavutil$secondaryArchSuffix = $libavutilVersionCompat
|
|
lib:libpostproc$secondaryArchSuffix = $libpostprocVersionCompat
|
|
lib:libswresample$secondaryArchSuffix = $libswresampleVersionCompat
|
|
lib:libswscale$secondaryArchSuffix = $libswscaleVersionCompat
|
|
"
|
|
REQUIRES="
|
|
haiku$secondaryArchSuffix
|
|
lib:libbz2$secondaryArchSuffix
|
|
lib:libgnutls$secondaryArchSuffix
|
|
lib:libmodplug$secondaryArchSuffix
|
|
lib:libogg$secondaryArchSuffix
|
|
lib:libspeex$secondaryArchSuffix
|
|
lib:libtheoradec$secondaryArchSuffix
|
|
lib:libtheoraenc$secondaryArchSuffix
|
|
lib:libvorbis$secondaryArchSuffix
|
|
lib:libvorbisenc$secondaryArchSuffix
|
|
lib:libvpx$secondaryArchSuffix
|
|
lib:libz$secondaryArchSuffix
|
|
"
|
|
CONFLICTS="
|
|
ffmpeg_legacy$secondaryArchSuffix
|
|
ffmpeg2${secondaryArchSuffix}_bin
|
|
"
|
|
|
|
PROVIDES_avdevice="
|
|
ffmpeg${secondaryArchSuffix}_avdevice = $portVersionCompat
|
|
lib:libavdevice$secondaryArchSuffix = $libavdeviceVersionCompat
|
|
"
|
|
REQUIRES_avdevice="
|
|
haiku$secondaryArchSuffix
|
|
lib:libavcodec$secondaryArchSuffix == $libavcodecVersion
|
|
lib:libavfilter$secondaryArchSuffix == $libavfilterVersion
|
|
lib:libavformat$secondaryArchSuffix == $libavformatVersion
|
|
lib:libavutil$secondaryArchSuffix == $libavutilVersion
|
|
lib:libSDL2_2.0$secondaryArchSuffix
|
|
"
|
|
|
|
PROVIDES_tools="
|
|
ffmpeg${secondaryArchSuffix}_tools = $portVersion
|
|
cmd:ffmpeg = $portVersionCompat
|
|
cmd:ffplay = $portVersionCompat
|
|
cmd:ffprobe = $portVersionCompat
|
|
cmd:ffserver = $portVersionCompat
|
|
"
|
|
REQUIRES_tools="
|
|
haiku$secondaryArchSuffix
|
|
lib:libavcodec$secondaryArchSuffix == $libavcodecVersion
|
|
lib:libavdevice$secondaryArchSuffix == $libavdeviceVersion
|
|
lib:libavfilter$secondaryArchSuffix == $libavfilterVersion
|
|
lib:libavformat$secondaryArchSuffix == $libavformatVersion
|
|
lib:libavutil$secondaryArchSuffix == $libavutilVersion
|
|
lib:libSDL2_2.0$secondaryArchSuffix
|
|
"
|
|
|
|
PROVIDES_devel="
|
|
ffmpeg${secondaryArchSuffix}_devel = $portVersionCompat
|
|
devel:libavcodec$secondaryArchSuffix = $libavcodecVersionCompat
|
|
devel:libavdevice$secondaryArchSuffix = $libavdeviceVersionCompat
|
|
devel:libavfilter$secondaryArchSuffix = $libavfilterVersionCompat
|
|
devel:libavformat$secondaryArchSuffix = $libavformatVersionCompat
|
|
devel:libavresample$secondaryArchSuffix = $libavresampleVersionCompat
|
|
devel:libavutil$secondaryArchSuffix = $libavutilVersionCompat
|
|
devel:libpostproc$secondaryArchSuffix = $libpostprocVersionCompat
|
|
devel:libswresample$secondaryArchSuffix = $libswresampleVersionCompat
|
|
devel:libswscale$secondaryArchSuffix = $libswscaleVersionCompat
|
|
"
|
|
REQUIRES_devel="
|
|
ffmpeg$secondaryArchSuffix == $portVersion base
|
|
devel:libspeex$secondaryArchSuffix
|
|
"
|
|
CONFLICTS_devel="
|
|
ffmpeg_legacy${secondaryArchSuffix}_devel
|
|
ffmpeg2${secondaryArchSuffix}_devel
|
|
"
|
|
|
|
BUILD_REQUIRES="
|
|
haiku${secondaryArchSuffix}_devel
|
|
devel:libbz2$secondaryArchSuffix
|
|
devel:libgnutls$secondaryArchSuffix
|
|
devel:libmodplug$secondaryArchSuffix
|
|
devel:libogg$secondaryArchSuffix
|
|
devel:libsdl2$secondaryArchSuffix
|
|
devel:libspeex$secondaryArchSuffix
|
|
devel:libtheora$secondaryArchSuffix
|
|
devel:libvorbis$secondaryArchSuffix
|
|
devel:libvpx$secondaryArchSuffix
|
|
devel:libz$secondaryArchSuffix
|
|
"
|
|
BUILD_PREREQUIRES="
|
|
cmd:awk
|
|
cmd:cmp
|
|
cmd:gcc$secondaryArchSuffix >= 5
|
|
cmd:grep
|
|
cmd:ld$secondaryArchSuffix
|
|
cmd:make
|
|
cmd:perl
|
|
cmd:pkg_config$secondaryArchSuffix
|
|
cmd:sed
|
|
cmd:texi2html
|
|
cmd:yasm
|
|
"
|
|
|
|
GLOBAL_WRITABLE_FILES="
|
|
settings/ffserver.conf
|
|
"
|
|
|
|
PATCH()
|
|
{
|
|
# patch hard-coded config file path
|
|
sed -i "s,/etc/ffserver.conf,$sysconfDir/ffserver.conf," \
|
|
fftools/ffserver.c \
|
|
doc/ffserver.texi
|
|
|
|
# patch hard-coded paths to perl
|
|
sed -i "s,/usr/bin/perl,$portPackageLinksDir/cmd~perl/bin/perl," \
|
|
doc/Doxyfile \
|
|
doc/texi2pod.pl
|
|
}
|
|
|
|
defineDebugInfoPackage ffmpeg$secondaryArchSuffix \
|
|
$libDir/libavcodec.so.$libavcodecVersion \
|
|
$libDir/libavfilter.so.$libavfilterVersion \
|
|
$libDir/libavformat.so.$libavformatVersion \
|
|
$libDir/libavresample.so.$libavresampleVersion \
|
|
$libDir/libavutil.so.$libavutilVersion \
|
|
$libDir/libpostproc.so.$libpostprocVersion \
|
|
$libDir/libswresample.so.$libswresampleVersion \
|
|
$libDir/libswscale.so.$libswscaleVersion
|
|
|
|
# Can't get them working
|
|
#defineDebugInfoPackage ffmpeg${secondaryArchSuffix}_avdevice \
|
|
# $libDir/libavdevice.so.$libavdeviceVersion
|
|
|
|
#defineDebugInfoPackage ffmpeg${secondaryArchSuffix}_tools \
|
|
# $prefix/bin/ffmpeg \
|
|
# $prefix/bin/ffplay \
|
|
# $prefix/bin/ffprobe \
|
|
# $prefix/bin/ffserver
|
|
|
|
BUILD()
|
|
{
|
|
# not an autotools configure
|
|
./configure \
|
|
--prefix=$prefix \
|
|
--bindir=$prefix/bin \
|
|
--datadir=$dataDir/$portName \
|
|
--incdir=$includeDir \
|
|
--libdir=$libDir \
|
|
--shlibdir=$libDir \
|
|
--mandir=$manDir \
|
|
--disable-debug \
|
|
--enable-shared \
|
|
--enable-libmodplug \
|
|
--enable-libvorbis \
|
|
--enable-libspeex \
|
|
--enable-libtheora \
|
|
--enable-libvpx \
|
|
--enable-gpl \
|
|
--enable-avresample \
|
|
--disable-stripping \
|
|
--enable-gnutls
|
|
|
|
make $jobArgs
|
|
}
|
|
|
|
INSTALL()
|
|
{
|
|
make install
|
|
|
|
prepareInstalledDevelLibs $ffmpegLibs
|
|
fixPkgconfig
|
|
|
|
# The pkgconfig file reference other libraries using the wrong paths, which
|
|
# creates a lot of confusion. Fix them so correct paths are used.
|
|
local develPackageName="${portName}_devel-$portFullVersion"
|
|
local packageLinksDir=$(dirname $portPackageLinksDir)
|
|
local linksDir="$packageLinksDir/${develPackageName}/devel~libspeex$secondaryArchSuffix/$relativeDevelopLibDir"
|
|
sed -i -e "s,^\(Libs.private.*\)-L.*speex.* \(-lspeex.*\),\1-L$linksDir \2," \
|
|
$developLibDir/pkgconfig/libavcodec.pc \
|
|
$developLibDir/pkgconfig/libavdevice.pc \
|
|
$developLibDir/pkgconfig/libavfilter.pc \
|
|
$developLibDir/pkgconfig/libavformat.pc
|
|
|
|
# include the documented ffserver.conf
|
|
mkdir -p $docDir
|
|
cp doc/ffserver.conf $docDir
|
|
|
|
# Move html docs to the right place.
|
|
mv $prefix/share/doc/ffmpeg $docDir
|
|
rm -r $prefix/share
|
|
|
|
# Split out libs and executables which need libSDL
|
|
packageEntries tools $prefix/bin
|
|
packageEntries avdevice $libDir/libavdevice*
|
|
|
|
# devel package
|
|
packageEntries devel \
|
|
$dataDir/ffmpeg$secondaryArchSuffix/examples \
|
|
$manDir/man3 \
|
|
$docDir \
|
|
$developDir
|
|
}
|
|
|
|
TEST()
|
|
{
|
|
make check
|
|
}
|