/[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.4 - (show annotations) (download)
Sat Jun 7 21:32:06 2014 UTC (6 years, 2 months ago) by mgorny
Branch: MAIN
Changes since 1.3: +116 -116 lines
Enable multilib support, bug #489816.

(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key EFB4464E!)

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

  ViewVC Help
Powered by ViewVC 1.1.20