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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Sat Jun 23 05:12:30 2012 UTC (2 years, 2 months ago) by jer
Branch: MAIN
Changes since 1.1: +3 -4 lines
Stable for HPPA (bug #422537).

(Portage version: 2.2.0_alpha110/cvs/Linux x86_64)

1 scarabeus 1.1 # Copyright 1999-2012 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 jer 1.2 # $Header: /var/cvsroot/gentoo-x86/media-video/libav/libav-0.8.3.ebuild,v 1.1 2012/06/20 11:09:21 scarabeus Exp $
4 scarabeus 1.1
5     EAPI=4
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-0.8.2.tar.xz )"
26    
27     LICENSE="LGPL-2.1 gpl? ( GPL-3 )"
28     SLOT="0"
29 jer 1.2 [[ ${PV} == *9999 ]] || \
30     KEYWORDS="~alpha ~amd64 ~arm hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
31 scarabeus 1.1 IUSE="+3dnow +3dnowext aac alsa altivec amr bindist +bzip2 cdio cpudetection
32     custom-cflags debug dirac doc +encode faac truetype frei0r +gpl gsm
33     +hardcoded-tables ieee1394 jack jpeg2k +mmx +mmxext mp3 network openssl
34     oss pic pulseaudio +qt-faststart rtmp schroedinger sdl speex ssl +ssse3
35     static-libs test theora threads v4l vaapi vdpau vorbis vpx X x264 xvid
36     +zlib"
37    
38     CPU_FEATURES="3dnow:amd3dnow 3dnowext:amd3dnowext altivec avx mmx mmxext:mmx2
39     neon ssse3 vis"
40    
41     for i in ${CPU_FEATURES}; do
42     IUSE+=" ${i%:*}"
43     done
44    
45     RDEPEND="
46     !media-video/ffmpeg
47     alsa? ( media-libs/alsa-lib )
48     amr? ( media-libs/opencore-amr )
49     bzip2? ( app-arch/bzip2 )
50     cdio? ( dev-libs/libcdio )
51     dirac? ( media-video/dirac )
52     encode? (
53     aac? ( media-libs/vo-aacenc )
54     amr? ( media-libs/vo-amrwbenc )
55     faac? ( media-libs/faac )
56     mp3? ( >=media-sound/lame-3.98.3 )
57     theora? ( >=media-libs/libtheora-1.1.1[encode] media-libs/libogg )
58     vorbis? ( media-libs/libvorbis media-libs/libogg )
59     x264? ( >=media-libs/x264-0.0.20111017 )
60     xvid? ( >=media-libs/xvid-1.1.0 )
61     )
62     truetype? ( media-libs/freetype:2 )
63     frei0r? ( media-plugins/frei0r-plugins )
64     gsm? ( >=media-sound/gsm-1.0.12-r1 )
65     ieee1394? ( media-libs/libdc1394 sys-libs/libraw1394 )
66     jack? ( media-sound/jack-audio-connection-kit )
67     jpeg2k? ( >=media-libs/openjpeg-1.3-r2 )
68     pulseaudio? ( media-sound/pulseaudio )
69     rtmp? ( >=media-video/rtmpdump-2.2f )
70     ssl? ( openssl? ( dev-libs/openssl )
71     !openssl? ( net-libs/gnutls ) )
72     sdl? ( >=media-libs/libsdl-1.2.13-r1[audio,video] )
73     schroedinger? ( media-libs/schroedinger )
74     speex? ( >=media-libs/speex-1.2_beta3 )
75     vaapi? ( x11-libs/libva )
76     vdpau? ( x11-libs/libvdpau )
77     vpx? ( >=media-libs/libvpx-0.9.6 )
78     X? ( x11-libs/libX11 x11-libs/libXext x11-libs/libXfixes )
79     zlib? ( sys-libs/zlib )
80     "
81    
82     DEPEND="${RDEPEND}
83     >=sys-devel/make-3.81
84     dirac? ( virtual/pkgconfig )
85     doc? ( app-text/texi2html )
86     mmx? ( dev-lang/yasm )
87     rtmp? ( virtual/pkgconfig )
88     schroedinger? ( virtual/pkgconfig )
89     truetype? ( virtual/pkgconfig )
90     test? ( net-misc/wget )
91     v4l? ( sys-kernel/linux-headers )
92     "
93    
94     # faac can't be binary distributed
95     # openssl support marked as nonfree
96     # faac and aac are concurent implementations
97     # amr and aac require at least lgpl3
98     # x264 requires gpl2
99     REQUIRED_USE="bindist? ( !faac !openssl )
100     rtmp? ( network )
101     amr? ( gpl ) aac? ( gpl ) x264? ( gpl ) X? ( gpl )
102     test? ( encode )"
103    
104     src_prepare() {
105     # if we have snapshot then we need to hardcode the version
106     if [[ ${PV%_p*} != ${PV} ]]; then
107     sed -i -e "s/UNKNOWN/DATE-${PV#*_pre}/" "${S}/version.sh" || die
108     fi
109     }
110    
111     src_configure() {
112     local myconf="${EXTRA_LIBAV_CONF}"
113     local uses i
114    
115     myconf+="
116     $(use_enable gpl)
117     $(use_enable gpl version3)
118     --enable-avfilter
119     "
120    
121     # enabled by default
122     uses="debug doc network zlib"
123     for i in ${uses}; do
124     use ${i} || myconf+=" --disable-${i}"
125     done
126     use bzip2 || myconf+=" --disable-bzlib"
127     use sdl || myconf+=" --disable-avplay"
128    
129     if use ssl; then
130     use openssl && myconf+=" --enable-openssl --enable-nonfree" \
131     || myconf+=" --enable-gnutls"
132     fi
133    
134     use custom-cflags && myconf+=" --disable-optimizations"
135     use cpudetection && myconf+=" --enable-runtime-cpudetect"
136    
137     #for i in h264_vdpau mpeg1_vdpau mpeg_vdpau vc1_vdpau wmv3_vdpau; do
138     # use video_cards_nvidia || myconf="${myconf} --disable-decoder=${i}"
139     # use vdpau || myconf="${myconf} --disable-decoder=${i}"
140     #done
141     use vdpau || myconf+=" --disable-vdpau"
142    
143     use vaapi && myconf+=" --enable-vaapi"
144    
145     # Encoders
146     if use encode; then
147     use mp3 && myconf+=" --enable-libmp3lame"
148     use amr && myconf+=" --enable-libvo-amrwbenc"
149     use faac && myconf+=" --enable-libfaac --enable-nonfree"
150     use aac && myconf+=" --enable-libvo-aacenc"
151     uses="theora vorbis x264 xvid"
152     for i in ${uses}; do
153     use ${i} && myconf+=" --enable-lib${i}"
154     done
155     else
156     myconf+=" --disable-encoders"
157     fi
158    
159     # libavdevice options
160     use cdio && myconf+=" --enable-libcdio"
161     use ieee1394 && myconf+=" --enable-libdc1394"
162     use pulseaudio && myconf+=" --enable-libpulse"
163     # Indevs
164     # v4l1 is gone since linux-headers-2.6.38
165     myconf+=" --disable-indev=v4l"
166     use v4l || myconf+=" --disable-indev=v4l2"
167     for i in alsa oss jack; do
168     use ${i} || myconf+=" --disable-indev=${i}"
169     done
170     use X && myconf+=" --enable-x11grab"
171     # Outdevs
172     for i in alsa oss ; do
173     use ${i} || myconf+=" --disable-outdev=${i}"
174     done
175     # libavfilter options
176     use frei0r && myconf+=" --enable-frei0r"
177     use truetype && myconf+=" --enable-libfreetype"
178    
179     # Threads; we only support pthread for now but ffmpeg supports more
180     use threads && myconf+=" --enable-pthreads"
181    
182     # Decoders
183     use amr && myconf+=" --enable-libopencore-amrwb --enable-libopencore-amrnb"
184     uses="gsm dirac rtmp schroedinger speex vpx"
185     for i in ${uses}; do
186     use ${i} && myconf+=" --enable-lib${i}"
187     done
188     use jpeg2k && myconf+=" --enable-libopenjpeg"
189    
190     # CPU features
191     for i in ${CPU_FEATURES}; do
192     use ${i%:*} || myconf+=" --disable-${i#*:}"
193     done
194    
195     # pass the right -mfpu as extra
196     use neon && myconf+=" --extra-cflags=-mfpu=neon"
197    
198     # disable mmx accelerated code if PIC is required
199     # as the provided asm decidedly is not PIC for x86.
200     if use pic && use x86 ; then
201     myconf+=" --disable-mmx --disable-mmx2"
202     fi
203    
204     # Option to force building pic
205     use pic && myconf+=" --enable-pic"
206    
207     # Try to get cpu type based on CFLAGS.
208     # Bug #172723
209     # We need to do this so that features of that CPU will be better used
210     # If they contain an unknown CPU it will not hurt since ffmpeg's configure
211     # will just ignore it.
212     for i in $(get-flag march) $(get-flag mcpu) $(get-flag mtune) ; do
213     [ "${i}" = "native" ] && i="host" # bug #273421
214     [[ ${i} = *-sse3 ]] && i="${i%-sse3}" # bug 283968
215     myconf+=" --cpu=${i}"
216     break
217     done
218    
219     # cross compile support
220     if tc-is-cross-compiler ; then
221     myconf+=" --enable-cross-compile --arch=$(tc-arch-kernel) --cross-prefix=${CHOST}-"
222     case ${CHOST} in
223     *freebsd*)
224     myconf+=" --target-os=freebsd"
225     ;;
226     mingw32*)
227     myconf+=" --target-os=mingw32"
228     ;;
229     *linux*)
230     myconf+=" --target-os=linux"
231     ;;
232     esac
233     fi
234    
235     # Misc stuff
236     use hardcoded-tables && myconf+=" --enable-hardcoded-tables"
237    
238     # Specific workarounds for too-few-registers arch...
239     if [[ $(tc-arch) == "x86" ]]; then
240     filter-flags -fforce-addr -momit-leaf-frame-pointer
241     append-flags -fomit-frame-pointer
242     is-flag -O? || append-flags -O2
243     if use debug; then
244     # no need to warn about debug if not using debug flag
245     ewarn ""
246     ewarn "Debug information will be almost useless as the frame pointer is omitted."
247     ewarn "This makes debugging harder, so crashes that has no fixed behavior are"
248     ewarn "difficult to fix. Please have that in mind."
249     ewarn ""
250     fi
251     fi
252    
253     cd "${S}"
254     ./configure \
255     --prefix="${EPREFIX}"/usr \
256     --libdir="${EPREFIX}"/usr/$(get_libdir) \
257     --shlibdir="${EPREFIX}"/usr/$(get_libdir) \
258     --mandir="${EPREFIX}"/usr/share/man \
259     --enable-shared \
260     --cc="$(tc-getCC)" \
261     --ar="$(tc-getAR)" \
262     $(use_enable static-libs static) \
263     ${myconf} || die
264     }
265    
266     src_compile() {
267     emake
268    
269     if use qt-faststart; then
270     tc-export CC
271     emake tools/qt-faststart
272     fi
273     }
274    
275     src_install() {
276     emake DESTDIR="${D}" install install-man
277    
278     dodoc Changelog README INSTALL
279     dodoc doc/*.txt
280     use doc && dodoc doc/*.html
281    
282     if use qt-faststart; then
283     dobin tools/qt-faststart
284     fi
285    
286     for i in $(usex sdl avplay "") $(usex network avserver "") avprobe; do
287     dosym ${i} /usr/bin/${i/av/ff}
288     done
289     }
290    
291     pkg_postinst() {
292     elog "Please note that the programs formerly known as ffplay, ffserver"
293     elog "and ffprobe are now called avplay, avserver and avprobe."
294     elog
295     elog "ffmpeg had been replaced by the feature incompatible avconv thus"
296     elog "the legacy ffmpeg is provided for compatibility with older scripts"
297     }
298    
299     src_test() {
300     LD_LIBRARY_PATH="${S}/libavcore:${S}/libswscale:${S}/libavcodec:${S}/libavdevice:${S}/libavfilter:${S}/libavformat:${S}/libavutil" \
301     emake fate SAMPLES="${WORKDIR}/fate"
302     }

  ViewVC Help
Powered by ViewVC 1.1.20