/[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.11 - (hide annotations) (download)
Sun Mar 15 17:33:24 2015 UTC (5 years, 4 months ago) by ulm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.10: +5 -6 lines
Add conditional bindist restriction and remove bindist USE flag, bug 541592.

(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key 9433907D693FB5B8!)

1 mgorny 1.10 # Copyright 1999-2015 Gentoo Foundation
2 lu_zero 1.1 # Distributed under the terms of the GNU General Public License v2
3 ulm 1.11 # $Header: /var/cvsroot/gentoo-x86/media-video/libav/libav-10.9999.ebuild,v 1.10 2015/01/30 16:57:31 mgorny Exp $
4 lu_zero 1.1
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 mgorny 1.4 inherit eutils flag-o-matic multilib multilib-minimal toolchain-funcs ${SCM}
14 lu_zero 1.1
15 slyfox 1.8 DESCRIPTION="Complete solution to record, convert and stream audio and video"
16 lu_zero 1.1 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 ulm 1.11 IUSE="aac alsa amr +bzip2 cdio cpudetection custom-cflags debug doc +encode
33     faac fdk frei0r +gpl gsm +hardcoded-tables ieee1394 jack jpeg2k mp3
34 lu_zero 1.1 +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 lu_zero 1.3 wavpack webp x264 xvid +zlib"
37 lu_zero 1.1
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 mgorny 1.10 CPU_FEATURES="cpu_flags_x86_3dnow:amd3dnow cpu_flags_x86_3dnowext:amd3dnowext altivec cpu_flags_x86_avx:avx cpu_flags_x86_mmx:mmx cpu_flags_x86_mmxext:mmxext neon cpu_flags_x86_ssse3:ssse3 vis cpu_flags_x86_avx2:avx2"
41 lu_zero 1.1 for i in ${CPU_FEATURES} ; do
42     IUSE+=" ${i%:*}"
43     done
44    
45     RDEPEND="
46     !media-video/ffmpeg:0
47 mgorny 1.6 alsa? ( >=media-libs/alsa-lib-1.0.27.2[${MULTILIB_USEDEP}] )
48     amr? ( >=media-libs/opencore-amr-0.1.3-r1[${MULTILIB_USEDEP}] )
49     bzip2? ( >=app-arch/bzip2-1.0.6-r4[${MULTILIB_USEDEP}] )
50 lu_zero 1.1 cdio? (
51     || (
52 mgorny 1.6 >=dev-libs/libcdio-paranoia-0.90_p1-r1[${MULTILIB_USEDEP}]
53 mgorny 1.4 <dev-libs/libcdio-0.90[-minimal,${MULTILIB_USEDEP}]
54 lu_zero 1.1 )
55     )
56     encode? (
57 mgorny 1.6 aac? ( >=media-libs/vo-aacenc-0.1.3[${MULTILIB_USEDEP}] )
58     amr? ( >=media-libs/vo-amrwbenc-0.1.2-r1[${MULTILIB_USEDEP}] )
59     faac? ( >=media-libs/faac-1.28-r3[${MULTILIB_USEDEP}] )
60     fdk? ( >=media-libs/fdk-aac-0.1.2[${MULTILIB_USEDEP}] )
61     mp3? ( >=media-sound/lame-3.99.5-r1[${MULTILIB_USEDEP}] )
62 lu_zero 1.1 theora? (
63 mgorny 1.4 >=media-libs/libtheora-1.1.1[encode,${MULTILIB_USEDEP}]
64 mgorny 1.6 >=media-libs/libogg-1.3.0[${MULTILIB_USEDEP}]
65 mgorny 1.4 )
66     vorbis? (
67 mgorny 1.6 >=media-libs/libvorbis-1.3.3-r1[${MULTILIB_USEDEP}]
68     >=media-libs/libogg-1.3.0[${MULTILIB_USEDEP}]
69 lu_zero 1.1 )
70 mgorny 1.6 webp? ( >=media-libs/libwebp-0.3.0[${MULTILIB_USEDEP}] )
71     wavpack? ( >=media-sound/wavpack-4.60.1-r1[${MULTILIB_USEDEP}] )
72     x264? ( >=media-libs/x264-0.0.20130506:=[${MULTILIB_USEDEP}] )
73     xvid? ( >=media-libs/xvid-1.3.2-r1[${MULTILIB_USEDEP}] )
74 lu_zero 1.1 )
75     frei0r? ( media-plugins/frei0r-plugins )
76 mgorny 1.6 gsm? ( >=media-sound/gsm-1.0.13-r1[${MULTILIB_USEDEP}] )
77 lu_zero 1.1 ieee1394? (
78 mgorny 1.6 >=media-libs/libdc1394-2.2.1[${MULTILIB_USEDEP}]
79     >=sys-libs/libraw1394-2.1.0-r1[${MULTILIB_USEDEP}]
80 lu_zero 1.1 )
81 mgorny 1.6 jack? ( >=media-sound/jack-audio-connection-kit-0.121.3-r1[${MULTILIB_USEDEP}] )
82     jpeg2k? ( >=media-libs/openjpeg-1.5.0:0[${MULTILIB_USEDEP}] )
83     opus? ( >=media-libs/opus-1.0.2-r2[${MULTILIB_USEDEP}] )
84     pulseaudio? ( >=media-sound/pulseaudio-2.1-r1[${MULTILIB_USEDEP}] )
85     rtmp? ( >=media-video/rtmpdump-2.4_p20131018[${MULTILIB_USEDEP}] )
86 lu_zero 1.1 ssl? (
87 mgorny 1.6 openssl? ( >=dev-libs/openssl-1.0.1h-r2[${MULTILIB_USEDEP}] )
88     !openssl? ( >=net-libs/gnutls-2.12.23-r6[${MULTILIB_USEDEP}] )
89 lu_zero 1.1 )
90 mgorny 1.6 sdl? ( >=media-libs/libsdl-1.2.15-r4[sound,video,${MULTILIB_USEDEP}] )
91     schroedinger? ( >=media-libs/schroedinger-1.0.11-r1[${MULTILIB_USEDEP}] )
92     speex? ( >=media-libs/speex-1.2_rc1-r1[${MULTILIB_USEDEP}] )
93     truetype? ( >=media-libs/freetype-2.5.0.1:2[${MULTILIB_USEDEP}] )
94     vaapi? ( >=x11-libs/libva-1.2.1-r1[${MULTILIB_USEDEP}] )
95     vdpau? ( >=x11-libs/libvdpau-0.7[${MULTILIB_USEDEP}] )
96     vpx? ( >=media-libs/libvpx-1.2.0_pre20130625[${MULTILIB_USEDEP}] )
97 lu_zero 1.1 X? (
98 mgorny 1.6 >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
99     >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
100     >=x11-libs/libXfixes-5.0.1[${MULTILIB_USEDEP}]
101 lu_zero 1.1 )
102 mgorny 1.6 zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
103 lu_zero 1.1 "
104    
105     DEPEND="${RDEPEND}
106     >=sys-devel/make-3.81
107     doc? ( app-text/texi2html )
108 mgorny 1.6 ieee1394? ( >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] )
109 mgorny 1.10 cpu_flags_x86_mmx? ( dev-lang/yasm )
110 mgorny 1.6 rtmp? ( >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] )
111     schroedinger? ( >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] )
112     ssl? ( >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] )
113 lu_zero 1.1 test? ( sys-devel/bc )
114 mgorny 1.6 truetype? ( >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] )
115 lu_zero 1.1 v4l? ( sys-kernel/linux-headers )
116     "
117    
118 mgorny 1.4 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 lu_zero 1.1 # 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 ulm 1.11 REQUIRED_USE="rtmp? ( network )
128 lu_zero 1.1 amr? ( gpl ) aac? ( gpl ) x264? ( gpl ) X? ( gpl ) cdio? ( gpl )
129     test? ( encode zlib )
130     "
131    
132 lu_zero 1.3 # Test on live ebuild are not possible as they require trunk fate
133 ulm 1.11 RESTRICT="test faac? ( bindist ) fdk? ( bindist ) openssl? ( bindist )"
134 lu_zero 1.3
135 mgorny 1.5 MULTILIB_WRAPPED_HEADERS=(
136     /usr/include/libavutil/avconfig.h
137     )
138    
139 lu_zero 1.1 src_prepare() {
140 mgorny 1.9 epatch_user
141    
142 lu_zero 1.1 # if we have snapshot then we need to hardcode the version
143     if [[ ${PV%_p*} != ${PV} ]]; then
144     sed -i -e "s/UNKNOWN/DATE-${PV#*_pre}/" "${S}/version.sh" || die
145     fi
146 mgorny 1.4
147     TOOLS=( aviocat graph2dot ismindex pktdumper qt-faststart trasher )
148     use zlib && TOOLS+=( cws2fws )
149    
150     MAKEOPTS+=" V=1"
151 lu_zero 1.1 }
152    
153 mgorny 1.4 multilib_src_configure() {
154     local myconf=( ${EXTRA_LIBAV_CONF} )
155 lu_zero 1.1 local uses i
156    
157 mgorny 1.4 myconf+=(
158 lu_zero 1.1 $(use_enable gpl)
159     $(use_enable gpl version3)
160     --enable-avfilter
161 mgorny 1.4 )
162 lu_zero 1.1
163     # enabled by default
164     uses="debug doc network zlib"
165     for i in ${uses}; do
166 mgorny 1.4 use ${i} || myconf+=( --disable-${i} )
167 lu_zero 1.1 done
168 mgorny 1.4 use bzip2 || myconf+=( --disable-bzlib )
169     use sdl || myconf+=( --disable-avplay )
170 lu_zero 1.1
171     if use ssl; then
172 mgorny 1.4 use openssl && myconf+=( --enable-openssl --enable-nonfree ) \
173     || myconf+=( --enable-gnutls )
174 lu_zero 1.1 fi
175    
176 mgorny 1.4 use custom-cflags && myconf+=( --disable-optimizations )
177     use cpudetection && myconf+=( --enable-runtime-cpudetect )
178 lu_zero 1.1
179 mgorny 1.4 use vdpau || myconf+=( --disable-vdpau )
180 lu_zero 1.1
181 mgorny 1.4 use vaapi && myconf+=( --enable-vaapi )
182 lu_zero 1.1
183     # Encoders
184     if use encode; then
185 mgorny 1.4 use faac && myconf+=( --enable-nonfree )
186     use fdk && myconf+=( --enable-nonfree --enable-libfdk-aac )
187     use mp3 && myconf+=( --enable-libmp3lame )
188     use amr && myconf+=( --enable-libvo-amrwbenc )
189     use aac && myconf+=( --enable-libvo-aacenc )
190 lu_zero 1.3 uses="faac theora vorbis wavpack webp x264 xvid"
191 lu_zero 1.1 for i in ${uses}; do
192 mgorny 1.4 use ${i} && myconf+=( --enable-lib${i} )
193 lu_zero 1.1 done
194     else
195 mgorny 1.4 myconf+=( --disable-encoders )
196 lu_zero 1.1 fi
197    
198     # libavdevice options
199 mgorny 1.4 use cdio && myconf+=( --enable-libcdio )
200     use ieee1394 && myconf+=( --enable-libdc1394 )
201     use pulseaudio && myconf+=( --enable-libpulse )
202 lu_zero 1.1
203     # Indevs
204     # v4l1 is gone since linux-headers-2.6.38
205 mgorny 1.4 myconf+=( --disable-indev=v4l )
206     use v4l || myconf+=( --disable-indev=v4l2 )
207 lu_zero 1.1 for i in alsa oss jack; do
208 mgorny 1.4 use ${i} || myconf+=( --disable-indev=${i} )
209 lu_zero 1.1 done
210 mgorny 1.4 use X && myconf+=( --enable-x11grab )
211 lu_zero 1.1 # Outdevs
212     for i in alsa oss ; do
213 mgorny 1.4 use ${i} || myconf+=( --disable-outdev=${i} )
214 lu_zero 1.1 done
215     # libavfilter options
216 mgorny 1.4 multilib_is_native_abi && use frei0r && myconf+=( --enable-frei0r )
217     use truetype && myconf+=( --enable-libfreetype )
218 lu_zero 1.1
219     # Threads; we only support pthread for now
220 mgorny 1.4 use threads && myconf+=( --enable-pthreads )
221 lu_zero 1.1
222     # Decoders
223 mgorny 1.4 use amr && myconf+=( --enable-libopencore-amrwb --enable-libopencore-amrnb )
224 lu_zero 1.1 uses="gsm opus rtmp schroedinger speex vpx"
225     for i in ${uses}; do
226 mgorny 1.4 use ${i} && myconf+=( --enable-lib${i} )
227 lu_zero 1.1 done
228 mgorny 1.4 use jpeg2k && myconf+=( --enable-libopenjpeg )
229 lu_zero 1.1
230     # CPU features
231     for i in ${CPU_FEATURES}; do
232 mgorny 1.4 use ${i%:*} || myconf+=( --disable-${i#*:} )
233 lu_zero 1.1 done
234    
235     # pass the right -mfpu as extra
236 mgorny 1.4 use neon && myconf+=( --extra-cflags=-mfpu=neon )
237 lu_zero 1.1
238     # disable mmx accelerated code if PIC is required
239     # as the provided asm decidedly is not PIC for x86.
240 mgorny 1.4 if use pic && [[ ${ABI} == x86 ]]; then
241     myconf+=( --disable-mmx --disable-mmxext )
242 lu_zero 1.1 fi
243    
244     # Option to force building pic
245 mgorny 1.4 use pic && myconf+=( --enable-pic )
246 lu_zero 1.1
247     # cross compile support
248     if tc-is-cross-compiler ; then
249 mgorny 1.4 myconf+=( --enable-cross-compile --arch=$(tc-arch-kernel) --cross-prefix=${CHOST}- )
250 lu_zero 1.1 case ${CHOST} in
251     *freebsd*)
252 mgorny 1.4 myconf+=( --target-os=freebsd )
253 lu_zero 1.1 ;;
254     mingw32*)
255 mgorny 1.4 myconf+=( --target-os=mingw32 )
256 lu_zero 1.1 ;;
257     *linux*)
258 mgorny 1.4 myconf+=( --target-os=linux )
259 lu_zero 1.1 ;;
260     esac
261     fi
262    
263     # Misc stuff
264 mgorny 1.4 use hardcoded-tables && myconf+=( --enable-hardcoded-tables )
265 lu_zero 1.1
266     # Specific workarounds for too-few-registers arch...
267 mgorny 1.4 if [[ ${ABI} == x86 ]]; then
268     local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}
269 lu_zero 1.1 filter-flags -fforce-addr -momit-leaf-frame-pointer
270     append-flags -fomit-frame-pointer
271     is-flag -O? || append-flags -O2
272     if use debug; then
273     # no need to warn about debug if not using debug flag
274     ewarn ""
275     ewarn "Debug information will be almost useless as the frame pointer is omitted."
276     ewarn "This makes debugging harder, so crashes that has no fixed behavior are"
277     ewarn "difficult to fix. Please have that in mind."
278     ewarn ""
279     fi
280     fi
281    
282 mgorny 1.7 set -- "${S}"/configure \
283 lu_zero 1.1 --prefix="${EPREFIX}"/usr \
284     --libdir="${EPREFIX}"/usr/$(get_libdir) \
285     --shlibdir="${EPREFIX}"/usr/$(get_libdir) \
286     --mandir="${EPREFIX}"/usr/share/man \
287     --enable-shared \
288     --cc="$(tc-getCC)" \
289     --ar="$(tc-getAR)" \
290     --optflags="${CFLAGS}" \
291     --extra-cflags="${CFLAGS}" \
292     $(use_enable static-libs static) \
293 mgorny 1.7 "${myconf[@]}"
294     echo "${@}"
295     "${@}" || die
296 lu_zero 1.1 }
297    
298 mgorny 1.4 multilib_src_compile() {
299 lu_zero 1.1 emake
300    
301     if use tools; then
302     tc-export CC
303    
304 mgorny 1.4 emake ${TOOLS[@]/#/tools/}
305 lu_zero 1.1 fi
306     }
307    
308 mgorny 1.4 multilib_src_install() {
309     emake DESTDIR="${D}" install install-man
310 lu_zero 1.1
311 mgorny 1.4 if use tools; then
312     dobin ${TOOLS[@]/#/tools/}
313     fi
314     }
315 lu_zero 1.1
316 mgorny 1.4 multilib_src_install_all() {
317 lu_zero 1.1 dodoc Changelog README INSTALL
318     dodoc doc/*.txt
319     use doc && dodoc doc/*.html
320     }
321    
322 mgorny 1.4 multilib_src_test() {
323     LD_LIBRARY_PATH="${BUILD_DIR}/libavcore:${BUILD_DIR}/libswscale:${BUILD_DIR}/libavcodec:${BUILD_DIR}/libavdevice:${BUILD_DIR}/libavfilter:${BUILD_DIR}/libavformat:${BUILD_DIR}/libavutil" \
324 lu_zero 1.1 emake -j1 fate
325     }

  ViewVC Help
Powered by ViewVC 1.1.20