PKGBUILD 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  1. # Maintainer (arch): Sergej Pupykin <pupykin.s+arch@gmail.com>
  2. # Maintainer (arch): BlackIkeEagle < ike DOT devolder AT gmail DOT com >
  3. # Contributor: graysky <graysky AT archlinux DOT us>
  4. # Contributor: DonVla <donvla@users.sourceforge.net>
  5. # Contributor: Ulf Winkelvos <ulf [at] winkelvos [dot] de>
  6. # Contributor: Ralf Barth <archlinux dot org at haggy dot org>
  7. # Contributor: B & monty - Thanks for your hints :)
  8. # Contributor: marzoul
  9. # Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
  10. # Contributor: Brad Fanella <bradfanella@archlinux.us>
  11. # Contributor: [vEX] <niechift.dot.vex.at.gmail.dot.com>
  12. # Contributor: Zeqadious <zeqadious.at.gmail.dot.com>
  13. # Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
  14. # Contributor: Maxime Gauduin <alucryd@gmail.com>
  15. # Contributor: André Silva <emulatorman@hyperbola.info>
  16. # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
  17. # Contributor: Isaac David <isacdaavid () isacdaavid!info>
  18. # Contributor: bill-auger <bill-auger@programmer.net>
  19. # Contributor: Edgar Hucek <gimli at dark-green dot com>
  20. # parabola changes and rationale:
  21. # - replace non-free addons
  22. # - remove RAR decompression
  23. _pkgbase=kodi-libre
  24. pkgbase=kodi
  25. pkgname=(
  26. 'kodi' 'kodi-x11' 'kodi-wayland' 'kodi-gbm'
  27. 'kodi-eventclients' 'kodi-tools-texturepacker' 'kodi-dev'
  28. )
  29. pkgver=18.9
  30. pkgrel=3
  31. pkgrel+=.parabola1
  32. arch=('x86_64')
  33. arch+=('armv7h' 'i686')
  34. url="https://kodi.tv"
  35. license=('GPL2')
  36. makedepends=(
  37. 'afpfs-ng' 'bluez-libs' 'cmake' 'curl' 'dav1d' 'doxygen' 'git' 'glew'
  38. 'gperf' 'hicolor-icon-theme' 'java-runtime' 'libaacs' 'libass'
  39. 'libbluray' 'libcdio' 'libcec' 'libgl' 'mariadb-libs' 'libmicrohttpd'
  40. 'libmodplug' 'libmpeg2' 'libnfs' 'libplist' 'libpulse' 'libva'
  41. 'libvdpau' 'libxrandr' 'libxslt' 'lirc' 'lzo' 'mesa' 'nasm'
  42. 'python2-pycryptodomex' 'python2-pillow6' 'python2-pybluez'
  43. 'python2-simplejson' 'shairplay' 'smbclient' 'taglib' 'tinyxml' 'swig'
  44. 'upower' 'giflib' 'rapidjson' 'ghostscript' 'meson' 'gtest' 'graphviz'
  45. # wayland
  46. 'wayland-protocols' 'waylandpp' 'libxkbcommon'
  47. # gbm
  48. 'libinput'
  49. )
  50. [[ "${CARCH}" == 'armv7h' ]] && makedepends=(${makedepends[@]/libvdpau/})
  51. _codename=Leia
  52. _sse_workaround=1
  53. _libdvdcss_version="1.4.2-$_codename-Beta-5"
  54. _libdvdnav_version="6.0.0-$_codename-Alpha-3"
  55. _libdvdread_version="6.0.0-$_codename-Alpha-3"
  56. _ffmpeg_version="4.0.4-$_codename-18.4"
  57. _fmt_version="5.1.0"
  58. _crossguid_version="8f399e8bd4"
  59. _fstrcmp_version="0.7.D001"
  60. _flatbuffers_version="1.9.0"
  61. source=(
  62. "$pkgbase-$pkgver-$_codename.tar.gz::https://github.com/xbmc/xbmc/archive/$pkgver-$_codename.tar.gz"
  63. "$pkgbase-libdvdcss-$_libdvdcss_version.tar.gz::https://github.com/xbmc/libdvdcss/archive/$_libdvdcss_version.tar.gz"
  64. "$pkgbase-libdvdnav-$_libdvdnav_version.tar.gz::https://github.com/xbmc/libdvdnav/archive/$_libdvdnav_version.tar.gz"
  65. "$pkgbase-libdvdread-$_libdvdread_version.tar.gz::https://github.com/xbmc/libdvdread/archive/$_libdvdread_version.tar.gz"
  66. "$pkgbase-ffmpeg-$_ffmpeg_version.tar.gz::https://github.com/xbmc/FFmpeg/archive/$_ffmpeg_version.tar.gz"
  67. "$pkgbase-fmt-$_fmt_version.tar.gz::http://mirrors.kodi.tv/build-deps/sources/fmt-$_fmt_version.tar.gz"
  68. "$pkgbase-crossguid-$_crossguid_version.tar.gz::http://mirrors.kodi.tv/build-deps/sources/crossguid-$_crossguid_version.tar.gz"
  69. "$pkgbase-fstrcmp-$_fstrcmp_version.tar.gz::http://mirrors.kodi.tv/build-deps/sources/fstrcmp-$_fstrcmp_version.tar.gz"
  70. "$pkgbase-flatbuffers-$_flatbuffers_version.tar.gz::http://mirrors.kodi.tv/build-deps/sources/flatbuffers-$_flatbuffers_version.tar.gz"
  71. 'cheat-sse-build.patch'
  72. '17804.patch'
  73. )
  74. source+=(http://repo.parabola.nu/other/kodi-libre/addons/${_codename,,}/addons.xml.gz)
  75. noextract=(
  76. "$pkgbase-libdvdcss-$_libdvdcss_version.tar.gz"
  77. "$pkgbase-libdvdnav-$_libdvdnav_version.tar.gz"
  78. "$pkgbase-libdvdread-$_libdvdread_version.tar.gz"
  79. "$pkgbase-ffmpeg-$_ffmpeg_version.tar.gz"
  80. "$pkgbase-fmt-$_fmt_version.tar.gz"
  81. "$pkgbase-crossguid-$_crossguid_version.tar.gz"
  82. "$pkgbase-fstrcmp-$_fstrcmp_version.tar.gz"
  83. "$pkgbase-flatbuffers-$_flatbuffers_version.tar.gz"
  84. )
  85. sha512sums=('72e4e2afa46d5d2061ed348af5c9a4218474589cb38d630e6d0643b35aff3b0aefb3db81333d52da6c799c530a1b709b1d7ccb6ec77dcb0cba06fce6791cb353'
  86. '5185dbdbeb1bd13ea9d8723f1f4ab599d6f3102f5ba1096cd085aa1cda252c045f327c719227bba8e1b742352ade5e335106c8d0c1637a5a6b93ce661620dd7e'
  87. '11c93eaacd156f8fd7dec7c43d366438b201f31ad55b2870463a9e286912b6ada08882319a021fb7992190f87b909a49f2b83e0321cc17aedc29f7fe5898fa72'
  88. 'b3419ba0a1a2dd70f1bb6236afdfe1c6e88c9ad4264198b289e3bba9375e077cecf7f89848c7b09debaa445327f3507101f3d157e692f7a7163b2bb52643e1e7'
  89. 'c6dd75dbff7119adeeda246cfb640b5e8d3b4c242ef83e5ba070207b60f0c715c3fe3cb328d87687b70a133f122a03aba990f0e95f3aac7d5dbcee25bec59078'
  90. 'b759a718353254fa8cd981e483bf01a45af0fc76901216404ace5e47f5d3edf43d42422184e5413c221e49832322fdf60d1860e8ec87349c674511064b31e5d6'
  91. '2682d63609d3dcdfcd8136be632e45df26ad88ce93b9c49745cf728bbd2e6254a7b05c8b059ab581d532372e504206a525a52564b64d076dfdae9c965a09fd16'
  92. 'aaeb0227afd5ada5955cbe6a565254ff88d2028d677d199c00e03b7cb5de1f2c69b18e6e8b032e452350a8eda7081807b01765adbeb8476eaf803d9de6e5509c'
  93. '0ba07dbe5b2fde1d0a6e14ee26ee2816062541d934eda204b846a30c019362f2626761b628c900293928b9b546dba8ca477c13182e022c3e0e0a142fd67f0696'
  94. '91409cc66959a30f2d0dbf8d28e47dd2acbac560efb8961550c5928ae8546a32d1f156f8e55f073f953b114230117ec96c224212d28c1c1d752540c836c9ae1a'
  95. '69e477773bf6f4160288e445c7c2492e4de7054960bfcd6833f206e5c994c6b7a7995c51c1a45c702c34343063912c4c61590129f87181b21738ba7e489cd01d')
  96. sha512sums+=('4288afffc27debe4ebcff0eecb0f11a8bce15a2a4d72b64a57c245dd0d477f68bce0dcbb7614ebb7d016d17a3ddaa4f9fbb916477ef84ebab09aa84e1c68adb5')
  97. prepare() {
  98. # force python 'binary' as python2
  99. [[ -d "$srcdir/path" ]] && rm -rf "$srcdir/path"
  100. mkdir "$srcdir/path"
  101. ln -s /usr/bin/python2 "$srcdir/path/python"
  102. [[ -d kodi-build-x11 ]] && rm -rf kodi-build-x11
  103. mkdir kodi-build-x11
  104. [[ -d kodi-build-wayland ]] && rm -rf kodi-build-wayland
  105. mkdir kodi-build-wayland
  106. [[ -d kodi-build-gbm ]] && rm -rf kodi-build-gbm
  107. mkdir kodi-build-gbm
  108. cd "xbmc-$pkgver-$_codename"
  109. patch -p1 -i "$srcdir/17804.patch"
  110. [[ "$_sse_workaround" -eq 1 ]] && patch -p1 -i "$srcdir/cheat-sse-build.patch"
  111. # replace default add-ons
  112. sed -i 's|mirrors\.kodi\.tv/|repo.parabola.nu/other/kodi-libre/|' addons/repository.xbmc.org/addon.xml
  113. # NOTE: this fails to build OOTB, with the vendored 'fmt'
  114. # ... xbmc/utils/StringUtils.h:29:10: fatal error: fmt/format.h: No such file or directory
  115. # it failed worse with the 'fmt' package installed - did this dirty trick instead:
  116. # ln -s /build/kodi/src/kodi-build-x11/build/include/fmt /usr/include/fmt
  117. }
  118. build() {
  119. export PATH="$srcdir/path:$PATH"
  120. echo "building kodi-x11"
  121. cd "$srcdir/kodi-build-x11"
  122. cmake -DCMAKE_INSTALL_PREFIX=/usr \
  123. -DCMAKE_INSTALL_LIBDIR=/usr/lib \
  124. -DENABLE_EVENTCLIENTS=ON \
  125. -DENABLE_INTERNAL_FFMPEG=ON \
  126. -DENABLE_INTERNAL_FMT=ON \
  127. -DENABLE_INTERNAL_CROSSGUID=ON \
  128. -DENABLE_INTERNAL_FSTRCMP=ON \
  129. -DENABLE_INTERNAL_FLATBUFFERS=ON \
  130. -Dlibdvdcss_URL="$srcdir/$pkgbase-libdvdcss-$_libdvdcss_version.tar.gz" \
  131. -Dlibdvdnav_URL="$srcdir/$pkgbase-libdvdnav-$_libdvdnav_version.tar.gz" \
  132. -Dlibdvdread_URL="$srcdir/$pkgbase-libdvdread-$_libdvdread_version.tar.gz" \
  133. -DFFMPEG_URL="$srcdir/$pkgbase-ffmpeg-$_ffmpeg_version.tar.gz" \
  134. -DFMT_URL="$srcdir/$pkgbase-fmt-$_fmt_version.tar.gz" \
  135. -DCROSSGUID_URL="$srcdir/$pkgbase-crossguid-$_crossguid_version.tar.gz" \
  136. -DFSTRCMP_URL="$srcdir/$pkgbase-fstrcmp-$_fstrcmp_version.tar.gz" \
  137. -DFLATBUFFERS_URL="$srcdir/$pkgbase-flatbuffers-$_flatbuffers_version.tar.gz" \
  138. -DX11_RENDER_SYSTEM=gl \
  139. $( [[ "${CARCH}" == 'armv7h' ]] && echo '-DENABLE_VAAPI=OFF' ) \
  140. ../"xbmc-$pkgver-$_codename"
  141. make
  142. make preinstall
  143. echo "building kodi-wayland"
  144. cd "$srcdir/kodi-build-wayland"
  145. cmake -DCMAKE_INSTALL_PREFIX=/usr \
  146. -DCMAKE_INSTALL_LIBDIR=/usr/lib \
  147. -DENABLE_EVENTCLIENTS=ON \
  148. -DENABLE_INTERNAL_FFMPEG=ON \
  149. -DENABLE_INTERNAL_FMT=ON \
  150. -DENABLE_INTERNAL_CROSSGUID=ON \
  151. -DENABLE_INTERNAL_FSTRCMP=ON \
  152. -DENABLE_INTERNAL_FLATBUFFERS=ON \
  153. -Dlibdvdcss_URL="$srcdir/$pkgbase-libdvdcss-$_libdvdcss_version.tar.gz" \
  154. -Dlibdvdnav_URL="$srcdir/$pkgbase-libdvdnav-$_libdvdnav_version.tar.gz" \
  155. -Dlibdvdread_URL="$srcdir/$pkgbase-libdvdread-$_libdvdread_version.tar.gz" \
  156. -DFFMPEG_URL="$srcdir/$pkgbase-ffmpeg-$_ffmpeg_version.tar.gz" \
  157. -DFMT_URL="$srcdir/$pkgbase-fmt-$_fmt_version.tar.gz" \
  158. -DCROSSGUID_URL="$srcdir/$pkgbase-crossguid-$_crossguid_version.tar.gz" \
  159. -DFSTRCMP_URL="$srcdir/$pkgbase-fstrcmp-$_fstrcmp_version.tar.gz" \
  160. -DFLATBUFFERS_URL="$srcdir/$pkgbase-flatbuffers-$_flatbuffers_version.tar.gz" \
  161. -DCORE_PLATFORM_NAME=wayland \
  162. -DWAYLAND_RENDER_SYSTEM=gl \
  163. ../"xbmc-$pkgver-$_codename"
  164. make
  165. make preinstall
  166. echo "building kodi-gbm"
  167. cd "$srcdir/kodi-build-gbm"
  168. cmake -DCMAKE_INSTALL_PREFIX=/usr \
  169. -DCMAKE_INSTALL_LIBDIR=/usr/lib \
  170. -DENABLE_EVENTCLIENTS=ON \
  171. -DENABLE_INTERNAL_FFMPEG=ON \
  172. -DENABLE_INTERNAL_FMT=ON \
  173. -DENABLE_INTERNAL_CROSSGUID=ON \
  174. -DENABLE_INTERNAL_FSTRCMP=ON \
  175. -DENABLE_INTERNAL_FLATBUFFERS=ON \
  176. -Dlibdvdcss_URL="$srcdir/$pkgbase-libdvdcss-$_libdvdcss_version.tar.gz" \
  177. -Dlibdvdnav_URL="$srcdir/$pkgbase-libdvdnav-$_libdvdnav_version.tar.gz" \
  178. -Dlibdvdread_URL="$srcdir/$pkgbase-libdvdread-$_libdvdread_version.tar.gz" \
  179. -DFFMPEG_URL="$srcdir/$pkgbase-ffmpeg-$_ffmpeg_version.tar.gz" \
  180. -DFMT_URL="$srcdir/$pkgbase-fmt-$_fmt_version.tar.gz" \
  181. -DCROSSGUID_URL="$srcdir/$pkgbase-crossguid-$_crossguid_version.tar.gz" \
  182. -DFSTRCMP_URL="$srcdir/$pkgbase-fstrcmp-$_fstrcmp_version.tar.gz" \
  183. -DFLATBUFFERS_URL="$srcdir/$pkgbase-flatbuffers-$_flatbuffers_version.tar.gz" \
  184. -DCORE_PLATFORM_NAME=gbm \
  185. -DGBM_RENDER_SYSTEM=gles \
  186. ../"xbmc-$pkgver-$_codename"
  187. make
  188. make preinstall
  189. }
  190. # kodi
  191. # components: kodi
  192. package_kodi() {
  193. pkgdesc="A software media player and entertainment hub for digital media"
  194. pkgdesc+=", without nonfree addons or RAR decompression"
  195. depends=(
  196. 'desktop-file-utils' 'hicolor-icon-theme' 'mesa' 'python2-pycryptodomex'
  197. 'python2-pillow6' 'python2-simplejson' 'xorg-xdpyinfo'
  198. 'KODI-BIN'
  199. )
  200. optdepends=(
  201. 'afpfs-ng: Apple shares support'
  202. 'bluez: Blutooth support'
  203. 'python2-pybluez: Bluetooth support'
  204. 'libplist: AirPlay support'
  205. 'pulseaudio: PulseAudio support'
  206. 'shairplay: AirPlay support'
  207. 'upower: Display battery level'
  208. )
  209. provides=('xbmc')
  210. conflicts=('xbmc')
  211. replaces=('xbmc')
  212. _components=(
  213. 'kodi'
  214. 'kodi-bin'
  215. )
  216. export PATH="$srcdir/path:$PATH"
  217. cd kodi-build-x11
  218. # install eventclients
  219. for _cmp in ${_components[@]}; do
  220. DESTDIR="$pkgdir" /usr/bin/cmake \
  221. -DCMAKE_INSTALL_COMPONENT="$_cmp" \
  222. -P cmake_install.cmake
  223. done
  224. # python2 is being used
  225. cd "$pkgdir"
  226. grep -lR '#!.*python' * | \
  227. while read file; do sed -s 's/\(#!.*python\)/\12/g' -i "$file"; done
  228. # remove x11 binaries
  229. rm "$pkgdir/usr/lib/kodi/"{kodi-x11,kodi-xrandr}
  230. }
  231. # kodi-x11
  232. # components: kodi-bin
  233. package_kodi-x11() {
  234. pkgdesc="x11 kodi binary"
  235. provides=('KODI-BIN')
  236. replaces=('kodi-bin')
  237. depends=(
  238. 'bluez-libs' 'curl' 'lcms2' 'libass' 'libbluray' 'libcdio' 'libcec'
  239. 'libmicrohttpd' 'libnfs' 'libpulse' 'libva' 'libvdpau' 'libxrandr'
  240. 'libxslt' 'lirc' 'mariadb-libs' 'python2' 'smbclient' 'taglib'
  241. 'tinyxml' 'kodi'
  242. )
  243. [[ "${CARCH}" == 'armv7h' ]] && depends=(${depends[@]/libvdpau/})
  244. cd kodi-build-x11
  245. install -Dm755 kodi-x11 "$pkgdir/usr/lib/kodi/kodi-x11"
  246. install -Dm755 kodi-xrandr "$pkgdir/usr/lib/kodi/kodi-xrandr"
  247. }
  248. # kodi-wayland
  249. # components: kodi-bin
  250. package_kodi-wayland() {
  251. pkgdesc="wayland kodi binary"
  252. provides=('KODI-BIN')
  253. depends=(
  254. 'bluez-libs' 'curl' 'lcms2' 'libass' 'libbluray' 'libcdio' 'libcec'
  255. 'libmicrohttpd' 'libnfs' 'libpulse' 'libva' 'libxkbcommon' 'libxslt'
  256. 'lirc' 'mariadb-libs' 'python2' 'smbclient' 'taglib' 'tinyxml'
  257. 'waylandpp' 'kodi'
  258. )
  259. cd kodi-build-wayland
  260. install -Dm755 kodi-wayland "$pkgdir/usr/lib/kodi/kodi-wayland"
  261. }
  262. # kodi-gbm
  263. # components: kodi-bin
  264. package_kodi-gbm() {
  265. pkgdesc="gbm kodi binary"
  266. provides=('KODI-BIN')
  267. depends=(
  268. 'bluez-libs' 'curl' 'lcms2' 'libass' 'libbluray' 'libcdio' 'libcec'
  269. 'libinput' 'libmicrohttpd' 'libnfs' 'libpulse' 'libva' 'libxkbcommon'
  270. 'libxslt' 'lirc' 'mariadb-libs' 'python2' 'smbclient' 'taglib'
  271. 'tinyxml' 'kodi'
  272. )
  273. cd kodi-build-gbm
  274. install -Dm755 kodi-gbm "$pkgdir/usr/lib/kodi/kodi-gbm"
  275. }
  276. # kodi-eventclients
  277. # components: kodi-eventclients-common kodi-eventclients-ps3 kodi-eventclients-wiiremote kodi-eventclients-kodi-send
  278. package_kodi-eventclients() {
  279. pkgdesc="Kodi Event Clients"
  280. conflicts=('kodi-eventclients')
  281. optdepends=('python2: most eventclients are implemented in python2')
  282. _components=(
  283. 'kodi-eventclients-common'
  284. 'kodi-eventclients-ps3'
  285. 'kodi-eventclients-kodi-send'
  286. )
  287. export PATH="$srcdir/path:$PATH"
  288. cd kodi-build-x11
  289. # install eventclients
  290. for _cmp in ${_components[@]}; do
  291. DESTDIR="$pkgdir" /usr/bin/cmake \
  292. -DCMAKE_INSTALL_COMPONENT="$_cmp" \
  293. -P cmake_install.cmake
  294. done
  295. # python2 is being used
  296. cd "$pkgdir"
  297. grep -lR '#!.*python' * | \
  298. while read file; do sed -s 's/\(#!.*python\)/\12/g' -i "$file"; done
  299. }
  300. # kodi-tools-texturepacker
  301. # components: kodi-tools-texturepacker
  302. package_kodi-tools-texturepacker() {
  303. pkgdesc="Kodi Texturepacker tool"
  304. depends=('libpng' 'giflib' 'libjpeg-turbo' 'lzo')
  305. _components=(
  306. 'kodi-tools-texturepacker'
  307. )
  308. cd kodi-build-x11
  309. # install eventclients
  310. for _cmp in ${_components[@]}; do
  311. DESTDIR="$pkgdir" /usr/bin/cmake \
  312. -DCMAKE_INSTALL_COMPONENT="$_cmp" \
  313. -P cmake_install.cmake
  314. done
  315. }
  316. # kodi-dev
  317. # components: kodi-addon-dev kodi-audio-dev kodi-eventclients-dev kodi-game-dev
  318. # kodi-inputstream-dev kodi-peripheral-dev kodi-pvr-dev
  319. # kodi-screensaver-dev kodi-visualization-dev
  320. package_kodi-dev() {
  321. pkgdesc="Kodi dev files"
  322. depends=('kodi')
  323. _components=(
  324. 'kodi-addon-dev'
  325. 'kodi-audio-dev'
  326. 'kodi-eventclients-dev'
  327. 'kodi-game-dev'
  328. 'kodi-inputstream-dev'
  329. 'kodi-peripheral-dev'
  330. 'kodi-pvr-dev'
  331. 'kodi-screensaver-dev'
  332. 'kodi-visualization-dev'
  333. )
  334. export PATH="$srcdir/path:$PATH"
  335. cd kodi-build-x11
  336. # install eventclients
  337. for _cmp in ${_components[@]}; do
  338. DESTDIR="$pkgdir" /usr/bin/cmake \
  339. -DCMAKE_INSTALL_COMPONENT="$_cmp" \
  340. -P cmake_install.cmake
  341. done
  342. # python2 is being used
  343. cd "$pkgdir"
  344. grep -lR '#!.*python' * | \
  345. while read file; do sed -s 's/\(#!.*python\)/\12/g' -i "$file"; done
  346. }