/[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.2 - (hide annotations) (download)
Thu May 15 17:12:08 2014 UTC (6 years, 2 months ago) by ulm
Branch: MAIN
Changes since 1.1: +2 -2 lines
Fix USE dependency on media-libs/libsdl, "audio" USE flag was renamed to "sound", bug 357661.

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

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

  ViewVC Help
Powered by ViewVC 1.1.20