|
Lines 1-6
Link Here
|
| 1 |
# Copyright 1999-2006 Gentoo Foundation |
1 |
# Copyright 1999-2006 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header: /var/cvsroot/gentoo-x86/media-video/ffmpeg/ffmpeg-0.4.9_p20060302.ebuild,v 1.3 2006/03/04 06:58:43 lu_zero Exp $ |
3 |
# $Header: |
| 4 |
|
4 |
|
| 5 |
inherit eutils flag-o-matic multilib toolchain-funcs |
5 |
inherit eutils flag-o-matic multilib toolchain-funcs |
| 6 |
|
6 |
|
|
Lines 12-18
Link Here
|
| 12 |
S_STATIC=${S_BASE}-static |
12 |
S_STATIC=${S_BASE}-static |
| 13 |
S_SHARED=${S_BASE}-shared |
13 |
S_SHARED=${S_BASE}-shared |
| 14 |
|
14 |
|
| 15 |
SRC_URI="mirror://gentoo/${MY_P}.tar.bz2" |
15 |
SRC_URI="mirror://gentoo/${MY_P}.tar.bz2 |
|
|
16 |
amr? ( http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-510.zip |
| 17 |
http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip )" |
| 16 |
|
18 |
|
| 17 |
LICENSE="GPL-2" |
19 |
LICENSE="GPL-2" |
| 18 |
SLOT="0" |
20 |
SLOT="0" |
|
Lines 20-27
Link Here
|
| 20 |
# ~ia64 ~arm ~mips ~hppa |
22 |
# ~ia64 ~arm ~mips ~hppa |
| 21 |
#KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc-macos ~ppc64 ~sparc ~x86" |
23 |
#KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc-macos ~ppc64 ~sparc ~x86" |
| 22 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc-macos ~ppc64 ~sparc ~x86" |
24 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc-macos ~ppc64 ~sparc ~x86" |
| 23 |
IUSE="aac altivec debug doc ieee1394 a52 encode imlib mmx ogg vorbis oss test |
25 |
IUSE="aac altivec amr debug doc ieee1394 a52 encode imlib mmx ogg vorbis oss test |
| 24 |
theora threads truetype v4l x264 xvid dts network zlib sdl" |
26 |
theora threads truetype v4l v4l2 x264 xvid dts network zlib sdl" |
| 25 |
|
27 |
|
| 26 |
DEPEND="imlib? ( media-libs/imlib2 ) |
28 |
DEPEND="imlib? ( media-libs/imlib2 ) |
| 27 |
truetype? ( >=media-libs/freetype-2 ) |
29 |
truetype? ( >=media-libs/freetype-2 ) |
|
Lines 39-50
Link Here
|
| 39 |
ieee1394? ( =media-libs/libdc1394-1* |
41 |
ieee1394? ( =media-libs/libdc1394-1* |
| 40 |
sys-libs/libraw1394 ) |
42 |
sys-libs/libraw1394 ) |
| 41 |
test? ( net-misc/wget ) |
43 |
test? ( net-misc/wget ) |
| 42 |
x264? ( media-libs/x264-svn )" |
44 |
x264? ( media-libs/x264-svn ) |
|
|
45 |
amr? ( app-arch/unzip )" |
| 43 |
|
46 |
|
| 44 |
src_unpack() { |
47 |
src_unpack() { |
| 45 |
unpack ${A} || die |
48 |
unpack ${A} || die |
| 46 |
cd ${S_BASE} |
49 |
cd ${S_BASE} |
| 47 |
|
50 |
|
|
|
51 |
# amr (float) support |
| 52 |
if use amr; then |
| 53 |
einfo "Including amr wide and narrow band (float) support ... " |
| 54 |
|
| 55 |
# narrow band codec |
| 56 |
mkdir ${S_BASE}/libavcodec/amr_float |
| 57 |
cd ${S_BASE}/libavcodec/amr_float |
| 58 |
unzip -q ${WORKDIR}/26104-510_ANSI_C_source_code.zip |
| 59 |
|
| 60 |
# wide band codec |
| 61 |
mkdir ${S_BASE}/libavcodec/amrwb_float |
| 62 |
cd ${S_BASE}/libavcodec/amrwb_float |
| 63 |
unzip -q ${WORKDIR}/26204-510_ANSI-C_source_code.zip |
| 64 |
fi |
| 65 |
|
| 66 |
cd ${S_BASE} |
| 67 |
|
| 48 |
#Append -fomit-frame-pointer to avoid some common issues |
68 |
#Append -fomit-frame-pointer to avoid some common issues |
| 49 |
use debug || append-flags "-fomit-frame-pointer" |
69 |
use debug || append-flags "-fomit-frame-pointer" |
| 50 |
|
70 |
|
|
Lines 71-77
Link Here
|
| 71 |
mv ${S_BASE} ${S_SHARED} |
91 |
mv ${S_BASE} ${S_SHARED} |
| 72 |
cd ${S_SHARED} |
92 |
cd ${S_SHARED} |
| 73 |
epatch "${FILESDIR}/ffmpeg-shared-gcc4.1.patch" |
93 |
epatch "${FILESDIR}/ffmpeg-shared-gcc4.1.patch" |
| 74 |
|
|
|
| 75 |
} |
94 |
} |
| 76 |
|
95 |
|
| 77 |
src_compile() { |
96 |
src_compile() { |
|
Lines 81-91
Link Here
|
| 81 |
|
100 |
|
| 82 |
local myconf="" |
101 |
local myconf="" |
| 83 |
|
102 |
|
| 84 |
#disable mmx accelerated code if not requirested, or if PIC is required |
103 |
#disable mmx accelerated code if not requested, or if PIC is required |
| 85 |
# as the provided asm decidedly is not PIC. |
104 |
# as the provided asm decidedly is not PIC. |
| 86 |
if ( ! has_pic && use mmx ) || use amd64; then |
105 |
if ( has_pic || ! use mmx ) && ( ! use amd64 ); then |
| 87 |
myconf="${myconf} --enable-mmx" |
|
|
| 88 |
else |
| 89 |
myconf="${myconf} --disable-mmx" |
106 |
myconf="${myconf} --disable-mmx" |
| 90 |
fi |
107 |
fi |
| 91 |
|
108 |
|
|
Lines 93-123
Link Here
|
| 93 |
myconf="${myconf} --enable-memalign-hack" |
110 |
myconf="${myconf} --enable-memalign-hack" |
| 94 |
fi |
111 |
fi |
| 95 |
|
112 |
|
| 96 |
myconf="${myconf} |
113 |
# enabled by default |
| 97 |
$(use_enable altivec) \ |
114 |
(! use altivec) && myconf="${myconf} --disable-altivec" |
| 98 |
$(use_enable debug) \ |
115 |
(! use debug) && myconf="${myconf} --disable-debug" |
| 99 |
$(use_enable encode mp3lame) \ |
116 |
(! use oss) && myconf="${myconf} --disable-audio-oss" |
| 100 |
$(use_enable a52) --disable-a52bin \ |
117 |
(! use v4l) && myconf="${myconf} --disable-v4l" |
| 101 |
$(use_enable oss audio-oss) \ |
118 |
(! use v4l2) && myconf="${myconf} --disable-v4l2" |
| 102 |
$(use_enable v4l) \ |
119 |
(! use ieee1394) && myconf="${myconf} --disable-dv1394" |
| 103 |
$(use_enable ieee1394 dv1394) $(use_enable ieee1394 dc1394) \ |
120 |
(! use network) && myconf="${myconf} --disable-network" |
| 104 |
$(use_enable threads pthreads) \ |
121 |
(! use zlib) && myconf="${myconf} --disable-zlib" |
| 105 |
$(use_enable xvid) \ |
122 |
(! use sdl) && myconf="${myconf} --disable-ffplay" |
| 106 |
$(use_enable ogg libogg) \ |
123 |
|
| 107 |
$(use_enable vorbis) \ |
124 |
myconf="${myconf} --disable-opts" |
| 108 |
$(use_enable theora) \ |
125 |
|
| 109 |
$(use_enable dts) \ |
126 |
# disabled by default |
| 110 |
$(use_enable network) \ |
127 |
(use encode) && myconf="${myconf} --enable-mp3lame" |
| 111 |
$(use_enable zlib) \ |
128 |
(use a52) && myconf="${myconf} --enable-a52" |
| 112 |
$(use_enable sdl ffplay) \ |
129 |
(use ieee1394) && myconf="${myconf} --enable-dc1394" |
| 113 |
$(use_enable x264) \ |
130 |
(use threads) && myconf="${myconf} --enable-pthreads" |
| 114 |
$(use_enable aac faad) $(use_enable aac faac) --disable-faadbin \ |
131 |
(use xvid) && myconf="${myconf} --enable-xvid" |
| 115 |
--enable-gpl \ |
132 |
(use ogg) && myconf="${myconf} --enable-libogg" |
| 116 |
--enable-pp \ |
133 |
(use vorbis) && myconf="${myconf} --enable-vorbis" |
| 117 |
--disable-opts" |
134 |
(use theora) && myconf="${myconf} --enable-theora" |
|
|
135 |
(use dts) && myconf="${myconf} --enable-dts" |
| 136 |
(use x264) && myconf="${myconf} --enable-x264" |
| 137 |
(use aac) && myconf="${myconf} --enable-faad --enable-faac" |
| 138 |
(use amr) && myconf="${myconf} --enable-amr_nb --enable-amr_wb" |
| 118 |
|
139 |
|
|
|
140 |
myconf="${myconf} --enable-gpl --enable-pp" |
| 141 |
|
| 119 |
cd ${S_STATIC} |
142 |
cd ${S_STATIC} |
| 120 |
econf --disable-shared-pp --disable-shared --enable-static ${myconf} || die "Configure failed" |
143 |
#econf generates configure options unknown to ffmpeg's configure, so configure manually |
|
|
144 |
./configure \ |
| 145 |
--prefix=/usr \ |
| 146 |
--mandir=/usr/share/man \ |
| 147 |
--enable-static --disable-shared \ |
| 148 |
${myconf} || die "static failed" |
| 149 |
|
| 150 |
|
| 121 |
emake CC="$(tc-getCC)" || die "static failed" |
151 |
emake CC="$(tc-getCC)" || die "static failed" |
| 122 |
|
152 |
|
| 123 |
# Specific workarounds for too-few-registers arch... |
153 |
# Specific workarounds for too-few-registers arch... |
|
Lines 125-139
Link Here
|
| 125 |
filter-flags -fforce-addr -momit-leaf-frame-pointer |
155 |
filter-flags -fforce-addr -momit-leaf-frame-pointer |
| 126 |
append-flags -fomit-frame-pointer |
156 |
append-flags -fomit-frame-pointer |
| 127 |
is-flag -O? || append-flags -O2 |
157 |
is-flag -O? || append-flags -O2 |
| 128 |
ewarn "" |
158 |
if (use debug); then |
| 129 |
ewarn "Debug information will be almost useless as the frame pointer is omitted." |
159 |
# no need to warn about debug if not using debug flag |
| 130 |
ewarn "This makes debugging harder, so crashes that has no fixed behavior are" |
160 |
ewarn "" |
| 131 |
ewarn "difficult to fix. Please have that in mind." |
161 |
ewarn "Debug information will be almost useless as the frame pointer is omitted." |
| 132 |
ewarn "" |
162 |
ewarn "This makes debugging harder, so crashes that has no fixed behavior are" |
|
|
163 |
ewarn "difficult to fix. Please have that in mind." |
| 164 |
ewarn "" |
| 165 |
fi |
| 133 |
fi |
166 |
fi |
| 134 |
|
167 |
|
| 135 |
cd ${S_SHARED} |
168 |
cd ${S_SHARED} |
| 136 |
econf --enable-shared-pp --enable-shared --disable-static ${myconf} || die "Configure failed" |
169 |
#econf generates configure options unknown to ffmpeg's configure, so configure manually |
|
|
170 |
./configure \ |
| 171 |
--prefix=/usr \ |
| 172 |
--mandir=/usr/share/man \ |
| 173 |
--disable-static --enable-shared \ |
| 174 |
${myconf} || die "shared failed" |
| 175 |
|
| 137 |
emake CC="$(tc-getCC)" || die "shared failed" |
176 |
emake CC="$(tc-getCC)" || die "shared failed" |
| 138 |
} |
177 |
} |
| 139 |
|
178 |
|