summaryrefslogtreecommitdiff
path: root/community/mplayer2/PKGBUILD
blob: 4a4da3547b03a99833aec666f0f2322debef7d0e (plain)
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# $Id: PKGBUILD 58413 2011-11-12 17:18:14Z ibiru $
# Maintainer: Stéphane Gaudreault <stephane@archlinux.org>
# Contributor: Bartek Piotrowski <barthalion@gmail.com>

pkgname=mplayer2
pkgver=2.0.20111101
pkgrel=1.1
pkgdesc="A movie player"
arch=('i686' 'x86_64' 'mips64el')
license=('GPL')
url="http://www.mplayer2.org/"
if [ "${CARCH}" = "mips64el" ] ; then
    # OpenGL, VDPAU and XVMC don't have efficient implementations on
    # the supported mips64el machines.
    depends=('ffmpeg' 'libdvdcss' 'libdvdread' 'libdvdnav' 'libass' 'fontconfig' 'freetype2'
        'ttf-dejavu' 'sdl' 'aalib' 'libcaca' 'faad2' 'libpulse' 'jack' 'ncurses' 'libxxf86vm' 'cdparanoia' 'libmad' 
        'a52dec' 'libdca' 'libxxf86dga' 'libxss' 'mpg123' 'ladspa' 'speex' 'libxv')
    makedepends=('live-media' 'p7zip-libre' 'gettext')
else
    depends=('libgl' 'libvdpau' 'ffmpeg' 'libdvdcss' 'libdvdread' 'libdvdnav' 'libxvmc' 'libass' 'fontconfig' 'freetype2'
        'ttf-dejavu' 'sdl' 'aalib' 'libcaca' 'faad2' 'libpulse' 'jack' 'ncurses' 'libxxf86vm' 'cdparanoia' 'libmad' 
        'a52dec' 'libdca' 'libxxf86dga' 'libxss' 'mpg123' 'ladspa' 'speex')
    makedepends=('live-media' 'mesa' 'p7zip-libre' 'yasm' 'gettext')
fi
backup=('etc/mplayer/codecs.conf' 'etc/mplayer/input.conf')
provides=('mplayer')
conflicts=('mplayer')
#source=(http://ftp.mplayer2.org/pub/release/${pkgname}-${pkgver/_/-}.tar.xz
source=(ftp://ftp.archlinux.org/other/community/${pkgname}/${pkgname}-${pkgver}.tar.xz)
sha1sums=('78c78605733ca792bb12a52a751a508bfc0f213d')
options=('!emptydirs')

# source PKGBUILD && mksource
mksource() {
  _gitroot="git://git.mplayer2.org/mplayer2.git"
  _gitname="${pkgname}-${pkgver}"

  if [[ -d "$_gitname" ]]; then
    cd "$_gitname" && git pull origin
  else
    git clone "$_gitroot" "$_gitname"
  fi

  tar -cJvf ${_gitname}.tar.xz ${_gitname}
  rm -fr ${_gitname}
}

build() {
    cd "${srcdir}/${pkgname}-${pkgver}"

    if [ "$CARCH" = "mips64el" ]; then
    ./configure --prefix=/usr \
                --disable-arts \
                --enable-speex \
                --disable-openal \
                --disable-libdv \
                --disable-musepack \
                --disable-esd \
                --disable-mga \
                --disable-vdpau \
                --disable-gl \
                --enable-xv \
                --language=all \
                --enable-translation \
                --confdir=/etc/mplayer
    else
    ./configure --prefix=/usr \
                --enable-runtime-cpudetection \
                --disable-arts \
                --enable-speex \
                --disable-openal \
                --disable-libdv \
                --disable-musepack \
                --disable-esd \
                --disable-mga \
                --language=all \
                --enable-translation \
                --confdir=/etc/mplayer
    fi
    make
}

package() {
    cd "${srcdir}/${pkgname}-${pkgver}"

    make DESTDIR="${pkgdir}" install
    install -Dm644 etc/{codecs.conf,input.conf,example.conf} "${pkgdir}"/etc/mplayer/
    install -dm755 "${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/
}