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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.20