summaryrefslogtreecommitdiffstats
path: root/abs/extra/xbmc/PKGBUILD
blob: 252e3129ef5a9385e2cfab8136c49a75e271561c (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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# $Id: PKGBUILD 48068 2011-05-27 21:25:39Z schuay $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Brad Fanella <bradfanella@archlinux.us>
# Contributor: [vEX] <niechift.dot.vex.at.gmail.dot.com>
# Contributor: Zeqadious <zeqadious.at.gmail.dot.com>
# Contributor: BlackEagle < ike DOT devolder AT herecura DOT be >

_prefix=/usr

pkgname=xbmc
pkgver=10.1
pkgrel=4
pkgdesc="A software media player and entertainment hub for digital media"
arch=('i686' 'x86_64')
url="http://xbmc.org"
license=('GPL' 'custom')
depends=('bzip2' 'curl' 'enca' 'faac' 'faad2' 'fontconfig' 'fribidi'
        'glew' 'jasper' 'libcdio' 'libgl' 'libmad' 'libmms'
        'libmpeg2' 'libmysqlclient' 'libsamplerate' 'libxinerama'
        'libxrandr' 'libxtst' 'lzo2' 'sdl_image' 'sdl_mixer'
        'smbclient' 'wavpack' 'mesa-demos' 'xorg-utils' 'libmicrohttpd'
        'libssh' 'libva' 'libmodplug' 'rtmpdump'
        'sqlite3')
makedepends=('boost' 'cmake' 'gperf' 'nasm' 'libvdpau' 'unzip' 'zip')
optdepends=('lirc: remote controller support'
        'unrar: access compressed files without unpacking them'
        'udisks: automount external drives'
        'upower: used to trigger suspend functionality'
        'libvdpau: for nvidia hardware acceleration'
        'lcms'
        'tk')
install=("${pkgname}.install")
source=("http://mirrors.xbmc.org/releases/source/xbmc-$pkgver.tar.gz"
        'FEH.sh'
        'snapstream_remote.patch')

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

  # Patch to add Snapstream Firelfy remote
  patch -Np1 -i ${srcdir}/snapstream_remote.patch || return 1

  # remove "--as-needed" from LDFLAGS, since it causes
  # undefined symbols at runtime:
  # /usr/lib/xbmc/system/players/dvdplayer/avcodec-52-i486-linux.so:
  #  undefined symbol: NeAACDecOpen
  unset LDFLAGS; LDFLAGS="-Wl,--hash-style=gnu"

  # fix linking issue with gcc 4.5, see git 6ea61fce78q
  sed -i 's: --soname,: -Wl,--soname,:' \
    xbmc/cores/dvdplayer/Codecs/{,libdvd/}Makefile.in

  msg "Bootstrapping XBMC"
  ./bootstrap

  msg "Configuring XBMC"
  ./configure --prefix=${_prefix} \
    --enable-vdpau \
    --disable-hal \
    --disable-avahi \
    --enable-external-libraries \
    --disable-external-liba52 \
    --disable-external-libdts \
    --disable-external-ffmpeg \
    --enable-rtmp \
    --disable-external-python \
    --disable-debug

  # Now (finally) build
  msg "Running make"
  make
  make -C lib/addons/script.module.pil
  make -C lib/addons/script.module.pysqlite
}

package() {
  cd "${srcdir}/xbmc-$pkgver"
  msg "Running make install"
  make prefix="${pkgdir}${_prefix}" install

  # Replace FEH.py with FEH.sh (and thus remove external python dependency)
  install -D -m 0755 "${srcdir}/FEH.sh" "${pkgdir}${_prefix}/share/xbmc/FEH.sh"
  sed -i -e 's/^python \(.*\)FEH.py \(.*\)$/\1FEH.sh \2/' "${pkgdir}${_prefix}/bin/xbmc"

  # lsb_release fix
  sed -i -e 's/which lsb_release &> \/dev\/null/\[ -f \/etc\/arch-release ]/g' "${pkgdir}${_prefix}/bin/xbmc"
  sed -i -e "s/lsb_release -a 2> \/dev\/null | sed -e 's\/\^\/    \/'/cat \/etc\/arch-release/g" "${pkgdir}${_prefix}/bin/xbmc"

  # .desktop files
  install -D -m 0644 "${srcdir}/xbmc-$pkgver/tools/Linux/xbmc.desktop" "${pkgdir}${_prefix}/share/applications/xbmc.desktop"
  install -D -m 0644 "${srcdir}/xbmc-$pkgver/tools/Linux/xbmc-48x48.png" "${pkgdir}${_prefix}/share/pixmaps/xbmc.png"

  # Tools
  install -D -m 0755 "${srcdir}/xbmc-$pkgver/xbmc-xrandr" "${pkgdir}${_prefix}/share/xbmc/xbmc-xrandr"
  install -D -m 0755 "${srcdir}/xbmc-$pkgver/tools/TexturePacker/TexturePacker" "${pkgdir}${_prefix}/share/xbmc/"

  # Licenses
  install -d -m 0755 "${pkgdir}${_prefix}/share/licenses/${pkgname}"
  for licensef in LICENSE.GPL copying.txt; do
    mv "${pkgdir}${_prefix}/share/doc/xbmc/${licensef}" "${pkgdir}${_prefix}/share/licenses/${pkgname}"
  done

  # cleanup some stuff
  msg "Cleanup unneeded files"
  rm -rf "${pkgdir}/usr/share/xsessions"
  rm -f "${pkgdir}/usr/share/xbmc/FEH.py"
  rm -f "${pkgdir}/usr/share/icons/hicolor/icon-theme.cache"
}
# vim:set ts=2 sw=2 et:
md5sums=('391398126cb86a4f6fbd0b7037997d84'
         '7127c0336f91ff48e408e2d1078fe8eb'
         'ae41945febf6906761589ddad33c0205')