1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Maintainer: loonyphoenix < loonyphoenix at gmail >
# This package is based on mplayer2-git, but simplifies its building by
# linking to the system ffmpeg/libav libraries

pkgname=mplayer2-simple-git
pkgver=20120802
pkgrel=1
pkgdesc="An advanced general-purpose media player. A fork of the original MPlayer project"
arch=('i686' 'x86_64')
license=('GPL')
url="http://www.mplayer2.org/"
install=mplayer2.install
depends=('ffmpeg' 'fontconfig' 'libass' 'libdvdread' 'libdvdnav' 'libgl'
         'libxss' 'libxxf86dga' 'ttf-dejavu')
# Uncomment lines below to add dependencies 
#depends+=('a52dec' 'aalib' 'cdparanoia' 'desktop-file-utils' 'enca' 'faad2'
#         'freetype2' 'jack' 'ladspa' 'lame' 'libbluray' 'libcaca' 'libcdio'
#         'libdca' 'libdvdnav' 'libjpeg' 'libmad' 'libpulse' 'libtheora' 'libvdpau'
#         'libxinerama' 'libxv' 'libxxf86vm' 'lirc-utils' 'mpg123' 'ncurses' 'sdl')
optdepends=('libdvdcss: for playback of encrypted dvds'
            'unrar: for playback of media files inside rar archives')
makedepends=('mesa' 'unzip' 'yasm' 'python')
backup=('etc/mplayer/codecs.conf' 'etc/mplayer/input.conf')
provides=('mplayer' 'mplayer2' 'mplayer2-git')
conflicts=('mplayer' 'mplayer2' 'mplayer2-git')
options=(!emptydirs)
source=('mplayer.desktop')
md5sums=('af6ba58cc34322bf12e46e8d1d42d75f')

_gitroot="git://git.mplayer2.org/mplayer2.git"
_gitname="mplayer2"
_gitbranch="master"

build() {

  cd "$srcdir"
  msg "Connecting to GIT server...."

  if [[ -d "$_gitname" ]]; then
    cd "$_gitname" && git pull origin $_gitbranch
    msg "The local files are updated."
  else
    git clone "$_gitroot" "$_gitname" -B $_gitbranch --depth=1
  fi

  msg "GIT checkout done or server timeout"
  msg "Starting build..."

  rm -rf "$srcdir/$_gitname-build"
  cp -r "$srcdir/$_gitname" "$srcdir/$_gitname-build"
  cd "$srcdir/$_gitname-build"

  ./configure --prefix=/usr --confdir=/etc/mplayer \
              --enable-translation --language=all \
              --enable-joystick \
              --disable-speex \
              --disable-openal \
              --disable-libdv \
              --disable-musepack \
              --disable-mga

  make

}

package() {
  cd "${srcdir}/${_gitname}-build"

  make DESTDIR="${pkgdir}" install
  install -m644 etc/{codecs,input,example}.conf "${pkgdir}/etc/mplayer/"
  install -d -m755 "${pkgdir}/usr/share/mplayer"
  ln -s /usr/share/fonts/TTF/DejaVuSans.ttf "${pkgdir}/usr/share/mplayer/subfont.ttf"

  install -dm755 "${pkgdir}"/usr/share/applications/
  install -m 644 etc/mplayer.desktop "${pkgdir}"/usr/share/applications/
}