PKGBUILDs/alarm/kodi-rbp4/PKGBUILD

321 lines
12 KiB
Bash
Raw Normal View History

2019-07-24 23:51:15 +00:00
# vim:set ts=2 sw=2 et:
# Contributor: graysky <graysky AT archlinux DOT us>
2019-07-27 16:34:34 +00:00
# Contributor: popcornmix & asavah from kodi forums - adapting for makechrootpkg
2019-07-24 23:51:15 +00:00
# Contributor: BlackIkeEagle < ike DOT devolder AT gmail DOT com >
# Contributor: Oleg Rakhmanov <oleg [at] archlinuxarm [dot] com>
# Contributor: tomasgroth at yahoo.dk
# Contributor: WarheadsSE <max@warheads.net>
# Contributor: Adrian Fedoreanu <adrian [dot] fedoreanu [at] gmail [dot] com>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: DonVla <donvla@users.sourceforge.net>
# Contributor: Ulf Winkelvos <ulf [at] winkelvos [dot] de>
# Contributor: Ralf Barth <archlinux dot org at haggy dot org>
# Contributor: B & monty - Thanks for your hints :)
# Contributor: marzoul
# Contributor: 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: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Maxime Gauduin <alucryd@gmail.com>
buildarch=4
_prefix=/usr
pkgbase=kodi-rbp4
pkgname=('kodi-rbp4' 'kodi-rbp4-eventclients' 'kodi-rbp4-tools-texturepacker' 'kodi-rbp4-dev')
2020-06-01 21:48:22 +00:00
pkgver=18.7.1
2020-07-10 20:55:39 +00:00
pkgrel=2
2019-07-24 23:51:15 +00:00
_codename=Leia
2019-08-31 14:17:33 +00:00
_ffmpeg_version="4.0.4-$_codename-18.4"
2019-07-24 23:51:15 +00:00
_libdvdcss_version="1.4.2-$_codename-Beta-5"
_libdvdnav_version="6.0.0-$_codename-Alpha-3"
_libdvdread_version="6.0.0-$_codename-Alpha-3"
_fmt_version="5.1.0"
_crossguid_version="8f399e8bd4"
_fstrcmp_version="0.7.D001"
_flatbuffers_version="1.9.0"
arch=('armv7h')
url="https://kodi.tv"
license=('GPL2')
makedepends=(
'afpfs-ng' 'bluez-libs' 'cmake' 'curl' 'doxygen' 'glew'
'gperf' 'hicolor-icon-theme' 'java-runtime' 'libaacs' 'libass'
'libbluray' 'libcdio' 'libcec-rpi' 'libgl' 'mariadb-libs' 'libmicrohttpd'
'libmodplug' 'libmpeg2' 'libnfs' 'libplist' 'libpulse' 'libva'
'libvdpau' 'libxrandr' 'libxslt' 'lirc' 'lzo' 'mesa' 'nasm'
2020-07-10 20:55:39 +00:00
'python2-pycryptodomex' 'python2-pillow6' 'python2-pybluez' 'python2-simplejson'
2019-07-24 23:51:15 +00:00
'shairplay' 'smbclient' 'taglib' 'tinyxml' 'swig'
'upower' 'giflib' 'rapidjson' 'ghostscript'
'libinput' 'libxkbcommon'
)
2019-07-27 16:34:34 +00:00
# leia_rpi4 branch contains patches to enable hardware decoding on rpi4
# expect kodi v19 to not to use MMAL but to use ffmpeg+v4l2
# https://github.com/popcornmix/xbmc/commits/leia_pi4
source=(
2019-11-19 20:13:31 +00:00
"xbmc-$pkgver-$_codename.tar.gz::https://github.com/popcornmix/xbmc/archive/leia_pi4_$pkgver-Leia.tar.gz"
2019-07-24 23:51:15 +00:00
'kodi.service'
'99-kodi.rules'
'polkit.rules'
"ffmpeg-$_ffmpeg_version.tar.gz::https://github.com/xbmc/FFmpeg/archive/$_ffmpeg_version.tar.gz"
"libdvdcss-$_libdvdcss_version.tar.gz::https://github.com/xbmc/libdvdcss/archive/$_libdvdcss_version.tar.gz"
"libdvdnav-$_libdvdnav_version.tar.gz::https://github.com/xbmc/libdvdnav/archive/$_libdvdnav_version.tar.gz"
"libdvdread-$_libdvdread_version.tar.gz::https://github.com/xbmc/libdvdread/archive/$_libdvdread_version.tar.gz"
"http://mirrors.kodi.tv/build-deps/sources/fmt-$_fmt_version.tar.gz"
"http://mirrors.kodi.tv/build-deps/sources/crossguid-$_crossguid_version.tar.gz"
"http://mirrors.kodi.tv/build-deps/sources/fstrcmp-$_fstrcmp_version.tar.gz"
"http://mirrors.kodi.tv/build-deps/sources/flatbuffers-$_flatbuffers_version.tar.gz"
2019-07-27 16:34:34 +00:00
01-fix.in-tree.ffmpeg.paths.for.makechrootpkg.hack.patch
2020-07-10 20:55:39 +00:00
18131.patch
2020-01-14 19:40:23 +00:00
sysusers.conf
tmpfiles.conf
2019-07-24 23:51:15 +00:00
)
noextract=(
"libdvdcss-$_libdvdcss_version.tar.gz"
"libdvdnav-$_libdvdnav_version.tar.gz"
"libdvdread-$_libdvdread_version.tar.gz"
"ffmpeg-$_ffmpeg_version.tar.gz"
"fmt-$_fmt_version.tar.gz"
"crossguid-$_crossguid_version.tar.gz"
"fstrcmp-$_fstrcmp_version.tar.gz"
"flatbuffers-$_flatbuffers_version.tar.gz"
)
2020-06-01 21:48:22 +00:00
sha256sums=('63f9e5e4219e5e8cad96e68d10393f6ac11d28e4b3915a6f6168340531210bff'
2019-07-24 23:51:15 +00:00
'585796d8a7f1ece32c24ff67b38885f0e3397372a4b9879eee3160a59391e333'
2019-08-03 00:21:23 +00:00
'8e14cf455898246d11edd4ff7f4ed11a44c729fb40c34455a5b336a90ccc1f7b'
2020-07-10 20:55:39 +00:00
'5d38a895ee7b93689fab79124a3aad23a5e3e643abd08878d778d04066c8d26f'
2019-08-31 14:17:33 +00:00
'e11e7594af35f36ab2711252c3d6bb106908f26605498aef4a9be2d7bc001db2'
2019-07-24 23:51:15 +00:00
'38816f8373e243bc5950449b4f3b18938c4e1c59348e3411e23f31db4072e40d'
'071e414e61b795f2ff9015b21a85fc009dde967f27780d23092643916538a57a'
'a30b6aa0aad0f2c505bc77948af2d5531a80b6e68112addb4c123fca24d5d3bf'
'73d4cab4fa8a3482643d8703de4d9522d7a56981c938eca42d929106ff474b44'
'3d77d09a5df0de510aeeb940df4cb534787ddff3bb1828779753f5dfa1229d10'
'e4018e850f80700acee8da296e56e15b1eef711ab15157e542e7d7e1237c3476'
2019-07-27 16:34:34 +00:00
'5ca5491e4260cacae30f1a5786d109230db3f3a6e5a0eb45d0d0608293d247e3'
2020-01-14 19:40:23 +00:00
'70b4c7db8766761ca060c038c8abb36c8c678246ca6c5efbde84c58442748ef2'
2020-07-10 20:55:39 +00:00
'1bfa84c0ae99a4ed731261cb39cb347c2809ca63d0d318393bdbbee900bbf8bc'
2020-01-14 19:40:23 +00:00
'f521b98232e5035b7cada46cf03975b8d753e93d0802bf22913fceed769f9d96'
'9c5e79ed8719cd032a3b17dac585aeff28a198e37af1da9af68ef1b86bab4d18')
2019-07-24 23:51:15 +00:00
prepare() {
2019-07-27 16:34:34 +00:00
# Must use MMAL headers and pc files rather than opengl ones so we copy the
# contents of raspberrypi-firmware dependency to $srcdir and delete the offending
# directories therein as well as redirect cmake
mkdir -p "$srcdir/opt"
cp -a /opt/vc "$srcdir/opt"
rm -rf "$srcdir"/opt/vc/include/{EGL,GLES,GLES2}
# Just these three are needed in a directory all by themselves
# to which we point cmake via PKG_CONFIG_PATH
mkdir "$srcdir/pkgconfig"
for i in bcm_host.pc mmal.pc vcsm.pc; do
cp "$srcdir/opt/vc/lib/pkgconfig/$i" "$srcdir/pkgconfig"
done
2019-07-24 23:51:15 +00:00
# force python 'binary' as python2
[[ -d "$srcdir/path" ]] && rm -rf "$srcdir/path"
mkdir "$srcdir/path"
ln -s /usr/bin/python2 "$srcdir/path/python"
2019-11-19 20:13:31 +00:00
cd "xbmc-leia_pi4_$pkgver-$_codename"
2019-07-27 16:34:34 +00:00
2019-07-24 23:51:15 +00:00
[[ -d kodi-build ]] && rm -rf kodi-build
2019-07-27 16:34:34 +00:00
mkdir "$srcdir/kodi-build"
2019-07-24 23:51:15 +00:00
2019-07-27 16:34:34 +00:00
# Big thanks to asavah for helpful advice here and in the cmake step
patch -Np1 -i ../01-fix.in-tree.ffmpeg.paths.for.makechrootpkg.hack.patch
2020-07-10 20:55:39 +00:00
# fix for libmicrohttpd 0.9.7.1
patch -Np1 -i ../18131.patch
2019-07-24 23:51:15 +00:00
}
build() {
export PATH="$srcdir/path:$PATH"
2019-07-27 16:34:34 +00:00
cd "$srcdir/kodi-build"
2019-07-24 23:51:15 +00:00
# building for RPi4
unset CFLAGS CXXFLAGS
2019-08-31 14:17:33 +00:00
export CFLAGS="-march=armv8-a+crc+simd -mtune=cortex-a72 -mfpu=neon-fp-armv8 -mfloat-abi=hard -O2 -pipe -fstack-protector-strong -fno-plt"
export CXXFLAGS="${CFLAGS}"
2019-07-24 23:51:15 +00:00
2019-07-27 16:34:34 +00:00
# exporting PKG_CONFIG_PATH and building with the extra lib definitions
# are part of the workaround discussed above
export PKG_CONFIG_PATH="$srcdir/pkgconfig"
_rootopt="$srcdir/opt/vc"
_libdir="$_rootopt/lib"
2019-07-24 23:51:15 +00:00
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=/usr/lib \
2019-07-27 16:34:34 +00:00
-DMMAL_INCLUDE_DIR="$_rootopt/include" \
-DMMAL_LIBRARY="$_libdir/libmmal.so" \
-DMMALCORE_LIBRARY="$_libdir/libmmal_core.so" \
-DMMALUTIL_LIBRARY="$_libdir/libmmal_util.so" \
-DMMALCLIENT_LIBRARY="$_libdir/libmmal_vc_client.so" \
-DMMALCOMPONENT_LIBRARY="$_libdir/libmmal_components.so" \
-DBCM_LIBRARY="$_libdir/libbcm_host.so" \
-DVCHIQ_LIBRARY="$_libdir/libvchiq_arm.so" \
-DVCHOSTIF_LIBRARY="$_libdir/libvchostif.a" \
-DVCILCS_LIBRARY="$_libdir/libvcilcs.a" \
-DVCOS_LIBRARY="$_libdir/libvcos.so" \
-DVCSM_LIBRARY="$_libdir/libvcsm.so" \
-DCONTAINER_LIBRARY="$_libdir/libcontainers.so" \
-DVERBOSE=ON \
2019-07-24 23:51:15 +00:00
-DENABLE_INTERNAL_FFMPEG=ON \
-DENABLE_INTERNAL_FMT=ON \
-DENABLE_INTERNAL_CROSSGUID=ON \
-DENABLE_INTERNAL_FSTRCMP=ON \
-DENABLE_INTERNAL_FLATBUFFERS=ON \
2019-12-29 14:43:27 +00:00
-DENABLE_EVENTCLIENTS=ON \
2019-07-24 23:51:15 +00:00
-DENABLE_VAAPI=OFF \
-DENABLE_VDPAU=OFF \
2019-07-27 16:34:34 +00:00
-DENABLE_OPENGL=OFF \
2020-03-01 12:12:56 +00:00
-DENABLE_MYSQLCLIENT=ON \
2019-07-24 23:51:15 +00:00
-Dlibdvdcss_URL="$srcdir/libdvdcss-$_libdvdcss_version.tar.gz" \
-Dlibdvdnav_URL="$srcdir/libdvdnav-$_libdvdnav_version.tar.gz" \
-Dlibdvdread_URL="$srcdir/libdvdread-$_libdvdread_version.tar.gz" \
-DFFMPEG_URL="$srcdir/ffmpeg-$_ffmpeg_version.tar.gz" \
-DFMT_URL="$srcdir/fmt-$_fmt_version.tar.gz" \
-DCROSSGUID_URL="$srcdir/crossguid-$_crossguid_version.tar.gz" \
-DFSTRCMP_URL="$srcdir/fstrcmp-$_fstrcmp_version.tar.gz" \
-DFLATBUFFERS_URL="$srcdir/flatbuffers-$_flatbuffers_version.tar.gz" \
-DCORE_PLATFORM_NAME=gbm \
-DGBM_RENDER_SYSTEM=gles \
2019-11-19 20:13:31 +00:00
../"xbmc-leia_pi4_$pkgver-$_codename"
2019-07-24 23:51:15 +00:00
make
make preinstall
}
package_kodi-rbp4() {
pkgdesc="A software media player and entertainment hub for digital media (Raspberry Pi 4)"
depends=(
2019-10-01 10:12:56 +00:00
'desktop-file-utils' 'hicolor-icon-theme' 'mesa' 'python2-pycryptodomex'
2020-07-10 20:55:39 +00:00
'python2-pillow6' 'python2-simplejson' 'xorg-xdpyinfo'
2019-07-24 23:51:15 +00:00
'bluez-libs' 'curl' 'lcms2' 'libass' 'libbluray' 'libcdio' 'libcec-rpi'
'libinput' 'libmicrohttpd' 'libnfs' 'libpulse' 'libva' 'libxkbcommon'
'libxslt' 'lirc' 'mariadb-libs' 'python2' 'smbclient' 'taglib'
2020-05-06 00:53:36 +00:00
'tinyxml' 'polkit' 'linux>=5.4.35'
2019-07-24 23:51:15 +00:00
)
optdepends=(
'afpfs-ng: Apple shares support'
'bluez: Blutooth support'
'python2-pybluez: Bluetooth support'
2019-07-27 16:34:34 +00:00
'libplist: Limited AirPlay support'
2019-07-24 23:51:15 +00:00
'pulseaudio: PulseAudio support'
'shairplay: Limited AirPlay support'
'upower: Display battery level'
)
install='kodi.install'
provides=('xbmc' 'kodi')
conflicts=('xbmc' 'kodi' 'arm-mem-git' 'shairplay-git')
replaces=('xbmc-rbp-git')
_components=('kodi' 'kodi-bin')
export PATH="$srcdir/path:$PATH"
cd kodi-build
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
2020-01-14 19:40:23 +00:00
install -Dm755 "$srcdir/kodi-build/kodi-gbm" "$pkgdir/usr/lib/kodi/kodi-gbm"
2019-07-24 23:51:15 +00:00
# fix permissions necessary for accelerated video playback
install -Dm0644 "$srcdir/99-kodi.rules" "$pkgdir/etc/udev/rules.d/99-kodi.rules"
2020-01-14 19:40:23 +00:00
# systemd manages kodi user
install -Dm644 "$srcdir"/sysusers.conf "$pkgdir/usr/lib/sysusers.d/kodi.conf"
install -Dm644 "$srcdir"/tmpfiles.conf "$pkgdir/usr/lib/tmpfiles.d/kodi.conf"
# systemd service and polkit rules
install -Dm0644 "$srcdir/kodi.service" "$pkgdir/usr/lib/systemd/system/kodi.service"
install -Dm0644 "$srcdir/polkit.rules" "$pkgdir/usr/share/polkit-1/rules.d/10-kodi.rules"
chmod 0750 "$pkgdir/usr/share/polkit-1/rules.d/"
2019-07-24 23:51:15 +00:00
}
package_kodi-rbp4-eventclients() {
pkgdesc="Kodi Event Clients (Raspberry Pi4)"
provides=('kodi-eventclients')
conflicts=('kodi-eventclients')
optdepends=('python2: most eventclients are implemented in python2')
_components=(
'kodi-eventclients-common'
'kodi-eventclients-ps3'
'kodi-eventclients-kodi-send'
)
export PATH="$srcdir/path:$PATH"
cd kodi-build
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
}
package_kodi-rbp4-tools-texturepacker() {
pkgdesc="Kodi Texturepacker tool (Raspberry Pi4)"
depends=('libpng' 'giflib' 'libjpeg-turbo' 'lzo')
_components=('kodi-tools-texturepacker')
2020-03-01 12:12:56 +00:00
export PATH="$srcdir/path:$PATH"
2019-07-24 23:51:15 +00:00
cd kodi-build
for _cmp in ${_components[@]}; do
DESTDIR="$pkgdir" /usr/bin/cmake \
-DCMAKE_INSTALL_COMPONENT="$_cmp" \
-P cmake_install.cmake
done
}
package_kodi-rbp4-dev() {
pkgdesc="Kodi dev files (Raspberry Pi4)"
depends=('kodi')
provides=('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')
export PATH="$srcdir/path:$PATH"
cd kodi-build
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
}