/[gentoo-x86]/media-video/libav/libav-10.9999.ebuild
Gentoo

Contents of /media-video/libav/libav-10.9999.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Wed Jun 4 13:34:15 2014 UTC (6 years, 2 months ago) by lu_zero
Branch: MAIN
Changes since 1.2: +9 -4 lines
Update dependencies

(Portage version: 2.2.10/cvs/Linux x86_64, unsigned Manifest commit)

1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/media-video/libav/libav-9999.ebuild,v 1.65 2014/05/15 17:12:08 ulm Exp $
4
5 EAPI=5
6
7 if [[ ${PV} == *9999 ]] ; then
8 SCM="git-2"
9 EGIT_REPO_URI="git://git.libav.org/libav.git"
10 [[ ${PV%9999} != "" ]] && EGIT_BRANCH="release/${PV%.9999}"
11 fi
12
13 inherit eutils flag-o-matic multilib toolchain-funcs ${SCM}
14
15 DESCRIPTION="Complete solution to record, convert and stream audio and video."
16 HOMEPAGE="http://libav.org/"
17 if [[ ${PV} == *9999 ]] ; then
18 SRC_URI=""
19 elif [[ ${PV%_p*} != ${PV} ]] ; then # Gentoo snapshot
20 SRC_URI="http://dev.gentoo.org/~lu_zero/libav/${P}.tar.xz"
21 else # Official release
22 SRC_URI="http://${PN}.org/releases/${P}.tar.xz"
23 fi
24
25 SRC_URI+=" test? ( http://dev.gentoo.org/~lu_zero/libav/fate-10.tar.xz )"
26
27 LICENSE="LGPL-2.1 gpl? ( GPL-3 )"
28 SLOT="0/10"
29 [[ ${PV} == *9999 ]] || KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64
30 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos
31 ~x64-solaris ~x86-solaris"
32 IUSE="aac alsa amr bindist +bzip2 cdio cpudetection custom-cflags debug doc
33 +encode faac fdk frei0r +gpl gsm +hardcoded-tables ieee1394 jack jpeg2k mp3
34 +network openssl opus oss pic pulseaudio rtmp schroedinger sdl speex ssl
35 static-libs test theora threads tools truetype v4l vaapi vdpau vorbis vpx X
36 wavpack webp x264 xvid +zlib"
37
38 # String for CPU features in the useflag[:configure_option] form
39 # if :configure_option isn't set, it will use 'useflag' as configure option
40 CPU_FEATURES="3dnow:amd3dnow 3dnowext:amd3dnowext altivec avx mmx mmxext neon ssse3 vis avx2"
41 for i in ${CPU_FEATURES} ; do
42 IUSE+=" ${i%:*}"
43 done
44
45 TOOLS="aviocat graph2dot ismindex pktdumper qt-faststart trasher"
46
47 RDEPEND="
48 !media-video/ffmpeg:0
49 alsa? ( media-libs/alsa-lib )
50 amr? ( media-libs/opencore-amr )
51 bzip2? ( app-arch/bzip2 )
52 cdio? (
53 || (
54 dev-libs/libcdio-paranoia
55 <dev-libs/libcdio-0.90[-minimal]
56 )
57 )
58 encode? (
59 aac? ( media-libs/vo-aacenc )
60 amr? ( media-libs/vo-amrwbenc )
61 faac? ( media-libs/faac )
62 fdk? ( media-libs/fdk-aac )
63 mp3? ( >=media-sound/lame-3.98.3 )
64 theora? (
65 >=media-libs/libtheora-1.1.1[encode]
66 media-libs/libogg
67 )
68 vorbis? ( media-libs/libvorbis media-libs/libogg )
69 webp? ( media-libs/libwebp )
70 wavpack? ( media-sound/wavpack )
71 x264? ( >=media-libs/x264-0.0.20111017:= )
72 xvid? ( >=media-libs/xvid-1.1.0 )
73 )
74 frei0r? ( media-plugins/frei0r-plugins )
75 gsm? ( >=media-sound/gsm-1.0.12-r1 )
76 ieee1394? (
77 media-libs/libdc1394
78 sys-libs/libraw1394
79 )
80 jack? ( media-sound/jack-audio-connection-kit )
81 jpeg2k? ( >=media-libs/openjpeg-1.3-r2:0 )
82 opus? ( media-libs/opus )
83 pulseaudio? ( media-sound/pulseaudio )
84 rtmp? ( >=media-video/rtmpdump-2.2f )
85 ssl? (
86 openssl? ( dev-libs/openssl )
87 !openssl? ( net-libs/gnutls )
88 )
89 sdl? ( >=media-libs/libsdl-1.2.13-r1[sound,video] )
90 schroedinger? ( media-libs/schroedinger )
91 speex? ( >=media-libs/speex-1.2_beta3 )
92 truetype? ( media-libs/freetype:2 )
93 vaapi? ( x11-libs/libva )
94 vdpau? ( x11-libs/libvdpau )
95 vpx? ( >=media-libs/libvpx-0.9.6 )
96 X? (
97 x11-libs/libX11
98 x11-libs/libXext
99 x11-libs/libXfixes
100 )
101 zlib? ( sys-libs/zlib )
102 "
103
104 DEPEND="${RDEPEND}
105 >=sys-devel/make-3.81
106 doc? ( app-text/texi2html )
107 ieee1394? ( virtual/pkgconfig )
108 mmx? ( dev-lang/yasm )
109 rtmp? ( virtual/pkgconfig )
110 schroedinger? ( virtual/pkgconfig )
111 ssl? ( virtual/pkgconfig )
112 test? ( sys-devel/bc )
113 truetype? ( virtual/pkgconfig )
114 v4l? ( sys-kernel/linux-headers )
115 "
116
117 # faac can't be binary distributed
118 # openssl support marked as nonfree
119 # faac and aac are concurent implementations
120 # amr and aac require at least lgpl3
121 # x264 requires gpl2
122 REQUIRED_USE="bindist? ( !faac !openssl !fdk )
123 rtmp? ( network )
124 amr? ( gpl ) aac? ( gpl ) x264? ( gpl ) X? ( gpl ) cdio? ( gpl )
125 test? ( encode zlib )
126 "
127
128 # Test on live ebuild are not possible as they require trunk fate
129 RESTRICT="test"
130
131 src_prepare() {
132 # if we have snapshot then we need to hardcode the version
133 if [[ ${PV%_p*} != ${PV} ]]; then
134 sed -i -e "s/UNKNOWN/DATE-${PV#*_pre}/" "${S}/version.sh" || die
135 fi
136 }
137
138 src_configure() {
139 local myconf="${EXTRA_LIBAV_CONF}"
140 local uses i
141
142 use zlib && TOOLS+=" cws2fws"
143
144 myconf+="
145 $(use_enable gpl)
146 $(use_enable gpl version3)
147 --enable-avfilter
148 "
149
150 # enabled by default
151 uses="debug doc network zlib"
152 for i in ${uses}; do
153 use ${i} || myconf+=" --disable-${i}"
154 done
155 use bzip2 || myconf+=" --disable-bzlib"
156 use sdl || myconf+=" --disable-avplay"
157
158 if use ssl; then
159 use openssl && myconf+=" --enable-openssl --enable-nonfree" \
160 || myconf+=" --enable-gnutls"
161 fi
162
163 use custom-cflags && myconf+=" --disable-optimizations"
164 use cpudetection && myconf+=" --enable-runtime-cpudetect"
165
166 use vdpau || myconf+=" --disable-vdpau"
167
168 use vaapi && myconf+=" --enable-vaapi"
169
170 # Encoders
171 if use encode; then
172 use faac && myconf+=" --enable-nonfree"
173 use fdk && myconf+=" --enable-nonfree --enable-libfdk-aac"
174 use mp3 && myconf+=" --enable-libmp3lame"
175 use amr && myconf+=" --enable-libvo-amrwbenc"
176 use aac && myconf+=" --enable-libvo-aacenc"
177 uses="faac theora vorbis wavpack webp x264 xvid"
178 for i in ${uses}; do
179 use ${i} && myconf+=" --enable-lib${i}"
180 done
181 else
182 myconf+=" --disable-encoders"
183 fi
184
185 # libavdevice options
186 use cdio && myconf+=" --enable-libcdio"
187 use ieee1394 && myconf+=" --enable-libdc1394"
188 use pulseaudio && myconf+=" --enable-libpulse"
189
190 # Indevs
191 # v4l1 is gone since linux-headers-2.6.38
192 myconf+=" --disable-indev=v4l"
193 use v4l || myconf+=" --disable-indev=v4l2"
194 for i in alsa oss jack; do
195 use ${i} || myconf+=" --disable-indev=${i}"
196 done
197 use X && myconf+=" --enable-x11grab"
198 # Outdevs
199 for i in alsa oss ; do
200 use ${i} || myconf+=" --disable-outdev=${i}"
201 done
202 # libavfilter options
203 use frei0r && myconf+=" --enable-frei0r"
204 use truetype && myconf+=" --enable-libfreetype"
205
206 # Threads; we only support pthread for now
207 use threads && myconf+=" --enable-pthreads"
208
209 # Decoders
210 use amr && myconf+=" --enable-libopencore-amrwb --enable-libopencore-amrnb"
211 uses="gsm opus rtmp schroedinger speex vpx"
212 for i in ${uses}; do
213 use ${i} && myconf+=" --enable-lib${i}"
214 done
215 use jpeg2k && myconf+=" --enable-libopenjpeg"
216
217 # CPU features
218 for i in ${CPU_FEATURES}; do
219 use ${i%:*} || myconf+=" --disable-${i#*:}"
220 done
221
222 # pass the right -mfpu as extra
223 use neon && myconf+=" --extra-cflags=-mfpu=neon"
224
225 # disable mmx accelerated code if PIC is required
226 # as the provided asm decidedly is not PIC for x86.
227 if use pic && use x86 ; then
228 myconf+=" --disable-mmx --disable-mmxext"
229 fi
230
231 # Option to force building pic
232 use pic && myconf+=" --enable-pic"
233
234 # cross compile support
235 if tc-is-cross-compiler ; then
236 myconf+=" --enable-cross-compile --arch=$(tc-arch-kernel) --cross-prefix=${CHOST}-"
237 case ${CHOST} in
238 *freebsd*)
239 myconf+=" --target-os=freebsd"
240 ;;
241 mingw32*)
242 myconf+=" --target-os=mingw32"
243 ;;
244 *linux*)
245 myconf+=" --target-os=linux"
246 ;;
247 esac
248 fi
249
250 # Misc stuff
251 use hardcoded-tables && myconf+=" --enable-hardcoded-tables"
252
253 # Specific workarounds for too-few-registers arch...
254 if [[ $(tc-arch) == "x86" ]]; then
255 filter-flags -fforce-addr -momit-leaf-frame-pointer
256 append-flags -fomit-frame-pointer
257 is-flag -O? || append-flags -O2
258 if use debug; then
259 # no need to warn about debug if not using debug flag
260 ewarn ""
261 ewarn "Debug information will be almost useless as the frame pointer is omitted."
262 ewarn "This makes debugging harder, so crashes that has no fixed behavior are"
263 ewarn "difficult to fix. Please have that in mind."
264 ewarn ""
265 fi
266 fi
267
268 cd "${S}"
269 ./configure \
270 --prefix="${EPREFIX}"/usr \
271 --libdir="${EPREFIX}"/usr/$(get_libdir) \
272 --shlibdir="${EPREFIX}"/usr/$(get_libdir) \
273 --mandir="${EPREFIX}"/usr/share/man \
274 --enable-shared \
275 --cc="$(tc-getCC)" \
276 --ar="$(tc-getAR)" \
277 --optflags="${CFLAGS}" \
278 --extra-cflags="${CFLAGS}" \
279 $(use_enable static-libs static) \
280 ${myconf} || die
281
282 MAKEOPTS+=" V=1"
283 }
284
285 src_compile() {
286 local i
287
288 emake
289
290 if use tools; then
291 tc-export CC
292
293 for i in ${TOOLS}; do
294 emake tools/${i}
295 done
296 fi
297 }
298
299 src_install() {
300 local i
301
302 emake DESTDIR="${D}" install install-man
303
304 dodoc Changelog README INSTALL
305 dodoc doc/*.txt
306 use doc && dodoc doc/*.html
307
308 if use tools; then
309 for i in ${TOOLS}; do
310 dobin tools/${i}
311 done
312 fi
313 }
314
315 src_test() {
316 LD_LIBRARY_PATH="${S}/libavcore:${S}/libswscale:${S}/libavcodec:${S}/libavdevice:${S}/libavfilter:${S}/libavformat:${S}/libavutil" \
317 emake -j1 fate
318 }

  ViewVC Help
Powered by ViewVC 1.1.20