Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Unix Operating Systems > Gentoo Linux Support

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-21-2008, 12:20 PM
northrup.james@gmail.com
 
Posts: n/a
Default ffmpeg live[svn]-ebuild with amr+gsm+libnut+static options againstlayman

cat /dev/flames >/dev/null

root@localhost ffmpeg # cat /usr/portage/local/layman/zugaina/media-
video/ffmpeg/ffmpeg-99999999999.ebuild digest


{{{

# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit subversion flag-o-matic multilib toolchain-funcs

ESVN_REPO_URI="svn://svn.mplayerhq.hu/ffmpeg/trunk"
ESVN_PROJECT="ffmpeg"
ESVN_FETCH_CMD="svn checkout"

MY_P=${P/_/-}

DESCRIPTION="Complete solution to record, convert and stream audio and
video. Includes libavcodec. (source from CVS)"
HOMEPAGE="http://ffmpeg.sourceforge.net/"
SRC_URI="
amr? ( http://dev.gentooexperimental.org/~kiorky/26104-510.zip )
amr? ( http://dev.gentooexperimental.org/~kiorky/26204-510.zip )
"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="-*"
IUSE="a52 aac altivec amr avisynth doc dts encode faac faad gpl gsm
ieee1394 mmx mp3
network nut ogg opts oss pp static swscaler theora threads v4l vorbis
x264 xvid zlib "

DEPEND="
a52? ( >=media-libs/a52dec-0.7.4-r4 )
aac? ( media-libs/faad2 media-libs/faac )
doc? ( app-text/texi2html )
dts? ( media-libs/libdts )
encode? ( media-sound/lame )
faad? ( media-libs/faad2 )
gsm? ( media-sound/gsm )
ieee1394? ( =media-libs/libdc1394-1* sys-libs/libraw1394 )
imlib? ( media-libs/imlib2 )
nut? ( media-libs/libnut )
test? ( net-misc/wget )
theora? ( media-libs/libtheora )
truetype? ( >=media-libs/freetype-2 )
vorbis? ( media-libs/libvorbis )
x264? ( >=media-libs/x264-svn-999999999 )
xvid? ( media-libs/xvid )
zlib? ( sys-libs/zlib )
"

RDEPEND="${DEPEND}"
S="${WORKDIR}"


src_unpack() {
subversion_src_unpack
unpack ${A}
if use "amr"; then
einfo "Patching for amr wide and narrow band (float) support ... "

# narrow band codec
mkdir "${S}/libavcodec/amrnb" || die "mkdir failed"
unzip -q 26104-510_ANSI_C_source_code.zip \
-d "${S}/libavcodec/amrnb" || die "unzip ansi failed"
ln -sf "${S}/libavcodec/amrnb" "${S}/libavcodec/amr_float"

# wide band codec
mkdir "${S}/libavcodec/amrwb" || die "mkdir libavcodec failed"
unzip -q 26204-510_ANSI-C_source_code.zip \
-d "${S}/libavcodec/amrwb" || die "unzip2 ansi failed"
ln -sf "${S}/libavcodec/amrwb" "${S}/libavcodec/amrwb_float"

# Patch if we're on 64-bit
if useq alpha || useq amd64 || useq ia64 || useq ppc64; then
pushd "${S}/libavcodec" || die cd failed
epatch ${FILESDIR}/ffmpeg-amr-64bit.patch
popd
fi
fi
}

src_compile() {
# set -x
filter-flags -fforce-addr -momit-leaf-frame-pointer
local myconf=() extra_libs=() extra_includes=()
use "avisynth" &&
myconf+=( --enable-avisynth )

! use "altivec" &&
myconf+=( --disable-altivec )

use "amr" && {
einfo "Including amr wide and narrow band (float) support ... "
myconf+=( --enable-libamr-nb )
myconf+=( --enable-libamr-wb )


for i in amrnb amrwb;
do

pushd "${S}/libavcodec/$i"

extra_includes+=( -I${PWD} )

extra_libs+=( -L${PWD} )

gcc $CFLAGS -c $(ls *.c|grep -v decode|grep -v encode) &&
ar rcvs lib$i.a *.o &&
popd||die "bad build of $i"
done
chmod +rw ${S}/libavcodec/amrwb/if_rom.h
{
cat <<EOF
#ifndef block_size
extern const UWord8 block_size[];
#endif
EOF
} >>${S}/libavcodec/amrwb/if_rom.h


}

use "a52" &&
myconf+=( --enable-liba52 )

use "network" ||
myconf+=( --disable-protocols --disable-ipv6 --disable-network --
disable-ffserver )

use "faac" &&
myconf+=( --enable-libfaac )

use "faad" &&
myconf+=( --enable-libfaad )

use "threads" &&
myconf+=( --enable-pthreads )

use "pp" &&
myconf+=( --enable-pp )

use "gsm" && {
myconf+=( --enable-libgsm )
extra_includes+=( -I/usr/include/gsm )
}
use "gpl" &&
myconf+=( --enable-gpl )

use "mp3" &&
myconf+=( --enable-libmp3lame )

use "opts" ||
myconf+=( --disable-optimizations )

use "nut" &&
myconf+=( --enable-libnut )

use "static" &&
myconf+=( --enable-static --disable-shared )

use "swscaler" &&
myconf+=( --enable-swscaler )

use "theora" &&
myconf+=( --enable-libtheora )

use "vorbis" &&
myconf+=( --enable-libvorbis )

use "v4l" ||
myconf+=( --disable-v4l )

use "x264" &&
myconf+=( --enable-libx264 )

use "xvid" &&
myconf+=( --enable-libxvid )


./configure --prefix=/usr --mandir=/usr/share/man \
${myconf[@]} \
${extra_includes[*]:+--extra-cflags="${extra_includes[*]}"} \
${extra_libs[*]:+--extra-ldflags="${extra_libs[*]}"} ||
die "Configure failed"

# custom version hook
FFMPEG_VERSION=$(LANG=C LC_ALL=C svn info \
${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/svn-src/${PN}/trunk | \
grep Revision|sed -re "s/.*:\s*//g" || die "svn retrieve
failed" )
FFMPEG_VERSION="\"dev-SVN-r$FFMPEG_VERSION "
FFMPEG_VERSION="$FFMPEG_VERSION built on $(date "+%Y-%m-%d %H:%m"
|| die "date failed") \""
einfo "FFMpeg version set to: $FFMPEG_VERSION"
FFMPEG_VERSION="#define FFMPEG_VERSION $FFMPEG_VERSION"
echo "$FFMPEG_VERSION" > version.h || die "echo failed"
emake || die "Compilation failed"
}

src_install() {
addpredict "/usr"
addpredict "/usr/lib"
use doc && make documentation
cd "${S}" || die "cd failed"
make DESTDIR="${D}" install || die "Install Failed"
dodoc ChangeLog README INSTALL
dodoc doc/*
}
cat: digest: No such file or directory
root@localhost ffmpeg # cat /usr/portage/local/layman/zugaina/media-
video/ffmpeg/ffmpeg-99999999999.ebuild
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit subversion flag-o-matic multilib toolchain-funcs

ESVN_REPO_URI="svn://svn.mplayerhq.hu/ffmpeg/trunk"
ESVN_PROJECT="ffmpeg"
ESVN_FETCH_CMD="svn checkout"

MY_P=${P/_/-}

DESCRIPTION="Complete solution to record, convert and stream audio and
video. Includes libavcodec. (source from CVS)"
HOMEPAGE="http://ffmpeg.sourceforge.net/"
SRC_URI="
amr? ( http://dev.gentooexperimental.org/~kiorky/26104-510.zip )
amr? ( http://dev.gentooexperimental.org/~kiorky/26204-510.zip )
"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="-*"
IUSE="a52 aac altivec amr avisynth doc dts encode faac faad gpl gsm
ieee1394 mmx mp3
network nut ogg opts oss pp static swscaler theora threads v4l vorbis
x264 xvid zlib "

DEPEND="
a52? ( >=media-libs/a52dec-0.7.4-r4 )
aac? ( media-libs/faad2 media-libs/faac )
doc? ( app-text/texi2html )
dts? ( media-libs/libdts )
encode? ( media-sound/lame )
faad? ( media-libs/faad2 )
gsm? ( media-sound/gsm )
ieee1394? ( =media-libs/libdc1394-1* sys-libs/libraw1394 )
imlib? ( media-libs/imlib2 )
nut? ( media-libs/libnut )
test? ( net-misc/wget )
theora? ( media-libs/libtheora )
truetype? ( >=media-libs/freetype-2 )
vorbis? ( media-libs/libvorbis )
x264? ( >=media-libs/x264-svn-999999999 )
xvid? ( media-libs/xvid )
zlib? ( sys-libs/zlib )
"

RDEPEND="${DEPEND}"
S="${WORKDIR}"


src_unpack() {
subversion_src_unpack
unpack ${A}
if use "amr"; then
einfo "Patching for amr wide and narrow band (float) support ... "

# narrow band codec
mkdir "${S}/libavcodec/amrnb" || die "mkdir failed"
unzip -q 26104-510_ANSI_C_source_code.zip \
-d "${S}/libavcodec/amrnb" || die "unzip ansi failed"
ln -sf "${S}/libavcodec/amrnb" "${S}/libavcodec/amr_float"

# wide band codec
mkdir "${S}/libavcodec/amrwb" || die "mkdir libavcodec failed"
unzip -q 26204-510_ANSI-C_source_code.zip \
-d "${S}/libavcodec/amrwb" || die "unzip2 ansi failed"
ln -sf "${S}/libavcodec/amrwb" "${S}/libavcodec/amrwb_float"

# Patch if we're on 64-bit
if useq alpha || useq amd64 || useq ia64 || useq ppc64; then
pushd "${S}/libavcodec" || die cd failed
epatch ${FILESDIR}/ffmpeg-amr-64bit.patch
popd
fi
fi
}

src_compile() {
# set -x
filter-flags -fforce-addr -momit-leaf-frame-pointer
local myconf=() extra_libs=() extra_includes=()
use "avisynth" &&
myconf+=( --enable-avisynth )

! use "altivec" &&
myconf+=( --disable-altivec )

use "amr" && {
einfo "Including amr wide and narrow band (float) support ... "
myconf+=( --enable-libamr-nb )
myconf+=( --enable-libamr-wb )


for i in amrnb amrwb;
do

pushd "${S}/libavcodec/$i"

extra_includes+=( -I${PWD} )

extra_libs+=( -L${PWD} )

gcc $CFLAGS -c $(ls *.c|grep -v decode|grep -v encode) &&
ar rcvs lib$i.a *.o &&
popd||die "bad build of $i"
done
chmod +rw ${S}/libavcodec/amrwb/if_rom.h
{
cat <<EOF
#ifndef block_size
extern const UWord8 block_size[];
#endif
EOF
} >>${S}/libavcodec/amrwb/if_rom.h


}

use "a52" &&
myconf+=( --enable-liba52 )

use "network" ||
myconf+=( --disable-protocols --disable-ipv6 --disable-network --
disable-ffserver )

use "faac" &&
myconf+=( --enable-libfaac )

use "faad" &&
myconf+=( --enable-libfaad )

use "threads" &&
myconf+=( --enable-pthreads )

use "pp" &&
myconf+=( --enable-pp )

use "gsm" && {
myconf+=( --enable-libgsm )
extra_includes+=( -I/usr/include/gsm )
}
use "gpl" &&
myconf+=( --enable-gpl )

use "mp3" &&
myconf+=( --enable-libmp3lame )

use "opts" ||
myconf+=( --disable-optimizations )

use "nut" &&
myconf+=( --enable-libnut )

use "static" &&
myconf+=( --enable-static --disable-shared )

use "swscaler" &&
myconf+=( --enable-swscaler )

use "theora" &&
myconf+=( --enable-libtheora )

use "vorbis" &&
myconf+=( --enable-libvorbis )

use "v4l" ||
myconf+=( --disable-v4l )

use "x264" &&
myconf+=( --enable-libx264 )

use "xvid" &&
myconf+=( --enable-libxvid )


./configure --prefix=/usr --mandir=/usr/share/man \
${myconf[@]} \
${extra_includes[*]:+--extra-cflags="${extra_includes[*]}"} \
${extra_libs[*]:+--extra-ldflags="${extra_libs[*]}"} ||
die "Configure failed"

# custom version hook
FFMPEG_VERSION=$(LANG=C LC_ALL=C svn info \
${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/svn-src/${PN}/trunk | \
grep Revision|sed -re "s/.*:\s*//g" || die "svn retrieve
failed" )
FFMPEG_VERSION="\"dev-SVN-r$FFMPEG_VERSION "
FFMPEG_VERSION="$FFMPEG_VERSION built on $(date "+%Y-%m-%d %H:%m"
|| die "date failed") \""
einfo "FFMpeg version set to: $FFMPEG_VERSION"
FFMPEG_VERSION="#define FFMPEG_VERSION $FFMPEG_VERSION"
echo "$FFMPEG_VERSION" > version.h || die "echo failed"
emake || die "Compilation failed"
}

src_install() {
addpredict "/usr"
addpredict "/usr/lib"
use doc && make documentation
cd "${S}" || die "cd failed"
make DESTDIR="${D}" install || die "Install Failed"
dodoc ChangeLog README INSTALL
dodoc doc/*
}

}}}
root@localhost ffmpeg #
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:05 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145