updated on Wed Jan 11 08:01:35 UTC 2012
[aur-mirror.git] / mplayer2-lite-git / PKGBUILD
blob1738c737974856bfcfd483bae068d1426252c32f
1 # Maintainer: Felix Yan <felixonmars@gmail.com>
2 # Contributor: Matej Lach <matej.lach@gmail.com>
3 # Contributor: cantabile <cantabile dot desu at gmail dot com>
4 # Contributor: extcake < extcake@gmail.com >
5 # Based on the mplayer2-git and mplayer-mt-lite package
7 pkgname=mplayer2-lite-git
8 pkgver=20111225
9 pkgrel=1
10 pkgdesc="A movie player for linux (uses dynamically linked libav; git version)"
11 arch=('i686' 'x86_64')
12 license=('GPL')
13 url="http://www.mplayer2.org/"
15 # set 1 to force mplayer not to use alsa-lib.
16 _noalsa=0
18 # depnds only you already have, others should contained in ffmpeg's depends.
19 [ "x$_noalsa" == "x0" ] && _alsa=$(pacman -Q alsa-lib 2>/dev/null | awk '{print $1}')
20 _smbclient=$(pacman -Q smbclient 2>/dev/null | awk '{print $1}')
21 _libxvmc=$(pacman -Q libxvmc 2>/dev/null | awk '{print $1}')
22 _faad2=$(pacman -Q faad2 2>/dev/null | awk '{print $1}')
23 _libpulse=$(pacman -Q libpulse 2>/dev/null | awk '{print $1}')
25 depends=('libgl' 'libxv' 'libxss' 'fribidi' 'libbluray' 'libxxf86dga' 'sdl' 'desktop-file-utils' 'ffmpeg')
26 makedepends=('git' 'live-media' 'mesa' 'python2' 'unzip' 'videoproto' 'yasm')
27 backup=('etc/mplayer/codecs.conf' 'etc/mplayer/input.conf')
28 provides=('mplayer' 'mplayer2')
29 conflicts=('mplayer' 'mplayer2')
30 options=(!emptydirs)
31 install=mplayer2.install
32 source=('mplayer2.install' 'mplayer.desktop')
33 md5sums=('cbc234e5e789e30c624741173992a225'
34         'af6ba58cc34322bf12e46e8d1d42d75f')
36 _gitroot="git://git.mplayer2.org/mplayer2.git"
37 _gitname="mplayer2"
39 build() {
40   # Custom CFLAGS break the mplayer build
41   unset CFLAGS
42   unset LDFLAGS
44   msg "Connecting to GIT server...."
46   if [ -d $_gitname ] ; then
47     cd $_gitname && git pull origin
48     msg "The local files are updated."
49   else
50     git clone $_gitroot $_gitname
51   fi
53   rm -rf "$srcdir/$_gitname-build"
54   cp -r "$srcdir/$_gitname" "$srcdir/$_gitname-build"
55   cd "$srcdir/$_gitname-build"
57   msg "GIT checkout done or server timeout"
58   msg "Starting make..."
60   _options=""
61   [ ! -z $_xvmc ] && _options="$_options --enable-xvmc"
62   [ ! -z $_faad2 ] && _options="$_options --enable-faad"
63   [ "x$_noalsa" == "x1" ] && _options="$_options --disable-alsa"
65   ./configure --prefix=/usr --confdir=/etc/mplayer \
66       --yasm=yasm --language=all
68   [ "$CARCH" = "i686" ] &&  sed 's|-march=i486|-march=i686|g' -i config.mak
70   make
73 package() {
74   cd "${srcdir}/${_gitname}-build"
76   make -j1 DESTDIR="${pkgdir}" install
78   install -d ${pkgdir}/etc/mplayer/
79   install -m644 ${srcdir}/${_gitname}-build/etc/{codecs,input,example}.conf "${pkgdir}/etc/mplayer/"
80   install -d -m755 "${pkgdir}/usr/share/mplayer"
81   ln -s /usr/share/fonts/TTF/DejaVuSans.ttf "${pkgdir}/usr/share/mplayer/subfont.ttf"
83   # there is a desktop file where the xpm is, but we don't want that
84   install -Dm644 "${srcdir}/mplayer.desktop" "${pkgdir}/usr/share/applications/mplayer.desktop"
85   install -Dm644 "${srcdir}/${_gitname}-build/etc/mplayer.xpm" "${pkgdir}/usr/share/pixmaps/mplayer.xpm"