summaryrefslogtreecommitdiffstats
path: root/abs/extra/kodi/PKGBUILD
blob: e1e20152546758e1754a82ec9a69dd0e648a4426 (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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# vim:set ts=2 sw=2 et:
# $Id$
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: BlackIkeEagle < ike DOT devolder AT gmail DOT com >
# Contributor: Brad Fanella <bradfanella@archlinux.us>
# Contributor: [vEX] <niechift.dot.vex.at.gmail.dot.com>
# Contributor: Zeqadious <zeqadious.at.gmail.dot.com>
# Contributor: BlackIkeEagle < ike DOT devolder AT gmail DOT com >
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Maxime Gauduin <alucryd@gmail.com>

pkgbase=kodi
pkgname=('kodi' 'kodi-eventclients' 'kodi-tools-texturepacker' 'kodi-dev')
pkgver=18.0
_codename=Leia
pkgrel=0
arch=('x86_64')
url="http://kodi.tv"
license=('GPL2')
makedepends=(
  'afpfs-ng' 'bluez-libs' 'boost' 'cmake' 'curl' 'cwiid' 'fmt' 'doxygen' 'git' 'glew'
  'gperf' 'hicolor-icon-theme' 'jasper' 'java-runtime' 'libaacs' 'libass'
  'libbluray' 'libcdio' 'libcec' 'libgl' 'libmysqlclient' 'libmicrohttpd'
  'libmodplug' 'libmpeg2' 'libnfs' 'libplist' 'libssh' 'libva'
  'libvdpau' 'libxrandr' 'libxslt' 'lzo' 'mesa' 'nasm' 'nss-mdns'
  'python2-pillow' 'python2-pybluez' 'python2-simplejson' 'rapidjson' 'rtmpdump' 'sdl2'
  'sdl_image' 'shairplay' 'smbclient' 'swig' 'taglib' 'tinyxml' 'unzip' 'upower'
  'yajl' 'zip' 'mesa' 'dcadec' 'libcrossguid' 'giflib' 'ghostscript'
)
source=(
  "xbmc-$pkgver$_codename.tar.gz::https://github.com/xbmc/xbmc/archive/$pkgver-$_codename.tar.gz"
  'kodi.sh'
  'kodi_lib.conf'
  'kodi.install'
)

prepare() {
  cd "$srcdir/xbmc-$pkgver-$_codename"

  find -type f -name *.py -exec sed 's|^#!.*python$|#!/usr/bin/python2|' -i "{}" +
#  sed 's|^#!.*python$|#!/usr/bin/python2|' -i tools/depends/native/rpl-native/rpl
    sed 's/python/python2/' -i tools/Linux/kodi.sh.in
#  sed 's/shell python/shell python2/' -i tools/EventClients/Makefile.in

}

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

    # Bootstrapping
  # MAKEFLAGS=-j1 ./bootstrap

  #./configure --help
  #return 1

  # Configuring XBMC
   export PYTHON_VERSION=2  # external python v2
   cmake \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=/usr/lib \
    -DLIRC_DEVICE=/run/lirc/lircd \
    -DENABLE_AIRTUNES=off \
    -DENABLE_INTERNAL_FFMPEG=on \
    -DENABLE_INTERNAL_FMT=on \
    -DENABLE_INTERNAL_FSTRCMP=1 \
    -DENABLE_INTERNAL_FLATBUFFERS=on \
    .
  make VERBOSE=1
  make preinstall
}

package_kodi() {
  pkgdesc="A software media player and entertainment hub for digital media"

  # depends expected for kodi plugins:
  # 'python2-pillow' 'python2-pybluez' 'python2-simplejson'
  # depends expeced in FEH.py
  # 'mesa-demos' 'xorg-xdpyinfo'
  depends=(
    'python2-pillow' 'python2-pybluez' 'python2-simplejson'
    'mesa-demos' 'xorg-xdpyinfo'
    'bluez-libs' 'fribidi' 'glew' 'hicolor-icon-theme' 'libass' 'libcdio'
    'libjpeg-turbo' 'libmysqlclient' 'libmicrohttpd' 'libnfs' 'libssh'
    'libva' 'libxrandr' 'libxslt' 'lzo' 'sdl2' 'smbclient' 'taglib' 'tinyxml'
    'yajl' 'mesa' 'dcadec' 'desktop-file-utils'
  )
  optdepends=(
    'afpfs-ng: Apple shares support'
    'bluez: Blutooth support'
    'libplist: AirPlay support'
    'libcec: Pulse-Eight USB-CEC adapter support'
    'lirc: Remote controller support'
    'shairplay: AirPlay support'
    'udisks: Automount external drives'
    'unrar: Archives support'
    'unzip: Archives support'
    'upower: Display battery level'
    'lsb-release: log distro information in crashlog'
  )
  install="kodi.install"
  provides=('xbmc')
  conflicts=('xbmc')
  replaces=('xbmc')

  cd "$srcdir/xbmc-$pkgver-$_codename"
  # Running make install
  make DESTDIR="$pkgdir" install

  # We will no longer support the xbmc name
  #rm "$pkgdir/usr/share/xsessions/xbmc.desktop"
  #rm "$pkgdir/usr/bin/"xbmc{,-standalone}
  # we will leave /usr/{include,lib,share}/xbmc for now

  # Licenses
    install -dm755 ${pkgdir}/usr/share/licenses/${pkgname}
  for licensef in LICENSE.md ; do
        mv ${pkgdir}/usr/share/doc/kodi/${licensef} \
            ${pkgdir}/usr/share/licenses/${pkgname}
  done

  # LinHES stuff
  mkdir -p ${pkgdir}/usr/LH/bin
  install -D -m 0755 ${srcdir}/kodi.sh ${pkgdir}/usr/LH/bin
  #add in kodi_lib.conf
  install -D -m0744 ${srcdir}/kodi_lib.conf ${pkgdir}/etc/gen_lib_xml.d/kodi_lib.conf
}

# kodi-eventclients
# components: kodi-eventclients-common kodi-eventclients-ps3 kodi-eventclients-wiiremote kodi-eventclients-xbmc-send
package_kodi-eventclients() {
  pkgdesc="Kodi Event Clients"
  depends=('cwiid')

  _components=(
               'kodi-eventclients-common'
               'kodi-eventclients-ps3'
               'kodi-eventclients-wiiremote'
               'kodi-eventclients-xbmc-send'
              )

  cd "$srcdir/xbmc-$pkgver-$_codename"
  # install eventclients
  for _cmp in ${_components[@]}; do
    DESTDIR="$pkgdir" /usr/bin/cmake \
      -DCMAKE_INSTALL_COMPONENT="$_cmp" \
      -P cmake_install.cmake
  done

  # python2 is being used
  cd "$pkgdir"
  grep -lR '#!.*python' * | while read file; do sed -s 's/\(#!.*python\)/\12/g' -i "$file"; done
}

# kodi-tools-texturepacker
# components: kodi-tools-texturepacker
package_kodi-tools-texturepacker() {
  pkgdesc="Kodi Texturepacker tool"
  depends=('giflib' 'libjpeg-turbo' 'libpng' 'lzo')

  _components=('kodi-tools-texturepacker')

  cd "$srcdir/xbmc-$pkgver-$_codename"
  # install eventclients
  for _cmp in ${_components[@]}; do
    DESTDIR="$pkgdir" /usr/bin/cmake \
      -DCMAKE_INSTALL_COMPONENT="$_cmp" \
      -P cmake_install.cmake
  done
}

# kodi-dev
# components: kodi-addon-dev kodi-audio-dev kodi-eventclients-dev kodi-game-dev kodi-inputstream-dev kodi-peripheral-dev kodi-pvr-dev kodi-screensaver-dev kodi-visualization-dev
package_kodi-dev() {
  pkgdesc="Kodi dev files"
  depends=('kodi')

  _components=(
               'kodi-addon-dev'
               'kodi-audio-dev'
               'kodi-eventclients-dev'
               'kodi-game-dev'
               'kodi-inputstream-dev'
               'kodi-peripheral-dev'
               'kodi-pvr-dev'
               'kodi-screensaver-dev'
               'kodi-visualization-dev'
              )

  cd "$srcdir/xbmc-$pkgver-$_codename"
  # install eventclients
  for _cmp in ${_components[@]}; do
    DESTDIR="$pkgdir" /usr/bin/cmake \
      -DCMAKE_INSTALL_COMPONENT="$_cmp" \
      -P cmake_install.cmake
  done

  # python2 is being used
  cd "$pkgdir"
  grep -lR '#!.*python' * | while read file; do sed -s 's/\(#!.*python\)/\12/g' -i "$file"; done
}

md5sums=('010eefd71ffe789dcee0daf0c692123d'
         'f6adc8e06d7076143ca2ad118126b158'
         'f04d1c89f5108c6aba36cf708a74cc95'
         '3913d248542a1268f916536a14c59d5c')