Files
haikuports/media-video/ffmpeg/ffmpeg-0.11.1.recipe
2014-07-21 16:31:58 -04:00

171 lines
4.6 KiB
Plaintext

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="http://www.ffmpeg.org"
LICENSE="
GNU LGPL v2.1
GNU GPL v2
"
COPYRIGHT="
2000-2003 Fabrice Bellard
2003-2012 the FFmpeg developers
"
SRC_URI="http://www.ffmpeg.org/releases/ffmpeg-0.11.1.tar.bz2"
CHECKSUM_SHA256="b01ddfb6352c84810879988f43172c5f7be555697edb929625845c7bb953fa96"
REVISION="2"
ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
if [ $effectiveTargetArchitecture == x86_gcc2 ]; then
PATCHES="ffmpeg-0.11.1-gcc2.patch"
fi
PROVIDES="
ffmpeg$secondaryArchSuffix = $portVersion compat >= 0.11
lib:libavcodec$secondaryArchSuffix = 53.61.100 compat >= 53
lib:libavdevice$secondaryArchSuffix = 53.4.100 compat >= 53
lib:libavfilter$secondaryArchSuffix = 2.61.100 compat >= 2
lib:libavformat$secondaryArchSuffix = 53.32.100 compat >= 53
lib:libavutil$secondaryArchSuffix = 51.35.100 compat >= 51
lib:libswresample$secondaryArchSuffix = 0.6.100 compat >= 0
lib:libswscale$secondaryArchSuffix = 2.1.100 compat >= 2
"
# on x86_gcc2hybrid, the tools should be placed in $prefix/bin but
# compiled with GCC4, as the GCC2 version of FFmpeg cannot use SSE and
# other acceleration features even if the user's machine has them.
if [ -z "$secondaryArchSuffix" ] && [ "$effectiveTargetArchitecture" != "x86_gcc2" ]; then
PROVIDES="$PROVIDES
cmd:ffmpeg = $portVersion compat >= 0.11
cmd:ffprobe = $portVersion compat >= 0.11
cmd:ffserver = $portVersion compat >= 0.11
"
fi
REQUIRES="
haiku$secondaryArchSuffix >= $haikuVersion
lib:libbz2$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
"
BUILD_REQUIRES="
devel:libbz2$secondaryArchSuffix
devel:libogg$secondaryArchSuffix
devel:libspeex$secondaryArchSuffix
devel:libtheora$secondaryArchSuffix
devel:libvorbis$secondaryArchSuffix
devel:libvpx$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
haiku${secondaryArchSuffix}_devel >= $haikuVersion
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:awk
cmd:make
cmd:perl
cmd:pkg_config$secondaryArchSuffix
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," \
ffserver.c \
doc/ffserver.texi
# patch hard-coded paths to perl
sed -i "s,/usr/bin/perl,$portPackageLinksDir/cmd~perl/bin/perl," \
Doxyfile \
doc/texi2pod.pl
}
BUILD()
{
# not an auto tools configure
./configure \
--prefix=$prefix \
--bindir=$prefix/bin \
--datadir=$dataDir/$portName \
--incdir=$includeDir \
--libdir=$libDir \
--shlibdir=$libDir \
--mandir=$manDir \
--disable-debug \
--enable-shared \
--enable-libvorbis \
--enable-libspeex \
--enable-libtheora \
--enable-libvpx
make $jobArgs
}
INSTALL()
{
make install
if [ "$effectiveTargetArchitecture" == "x86_gcc2" ]; then
rm -rf $prefix/bin
fi
rm -f $prefix/bin/ffprobe
# TODO: Determine and fix what is wrong with ffprobe! The executable
# seems to be broken. The NEEDED entries in the dynamic section look
# weird and the runtime loader fails relocating with "Operation not
# allowed".
prepareInstalledDevelLibs \
libavcodec \
libavdevice \
libavfilter \
libavformat \
libavutil \
libswresample \
libswscale
fixPkgconfig
# include the documented ffserver.conf
mkdir -p $docDir
cp doc/ffserver.conf $docDir
# devel package
packageEntries devel \
$developDir
# Remove stuff we don't need in the secondary architecture base package.
if [ -n "$secondaryArchSuffix" ]; then
rm -rf $prefix/bin
rm -rf $documentationDir
fi
}
# ----- devel package -------------------------------------------------------
PROVIDES_devel="
ffmpeg${secondaryArchSuffix}_devel = $portVersion compat >= 0.11
devel:libavcodec$secondaryArchSuffix = 53.61.100 compat >= 53
devel:libavdevice$secondaryArchSuffix = 53.4.100 compat >= 53
devel:libavfilter$secondaryArchSuffix = 2.61.100 compat >= 2
devel:libavformat$secondaryArchSuffix = 53.32.100 compat >= 53
devel:libavutil$secondaryArchSuffix = 51.35.100 compat >= 51
devel:libswresample$secondaryArchSuffix = 0.6.100 compat >= 0
devel:libswscale$secondaryArchSuffix = 2.1.100 compat >= 2
"
REQUIRES_devel="
ffmpeg$secondaryArchSuffix == $portVersion
"