PKGBUILDs/alarm/kodi-rbp3/PKGBUILD

255 lines
9.2 KiB
Bash
Raw Normal View History

2019-02-01 01:28:06 +00:00
# Contributor graysky <graysky AT archlinux DOT org>
# 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>
buildarch=4
_prefix=/usr
pkgbase=kodi-rbp3
pkgname=('kodi-rbp3' 'kodi-rbp3-eventclients' 'kodi-rbp3-tools-texturepacker' 'kodi-rbp3-dev')
2020-10-24 13:14:31 +00:00
pkgver=18.9
pkgrel=1
2019-02-01 01:28:06 +00:00
_codename=Leia
2019-11-18 20:35:06 +00:00
_tag="$pkgver-$_codename"
2019-09-01 09:54:53 +00:00
_ffmpeg_version="4.0.4-$_codename-18.4"
2019-02-01 01:28:06 +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')
2019-09-01 09:54:53 +00:00
url="https://kodi.tv"
2019-02-01 01:28:06 +00:00
license=('GPL2')
makedepends=(
'afpfs-ng' 'bluez-libs' 'boost' 'cmake' 'curl' 'doxygen'
'gperf' 'hicolor-icon-theme' 'jasper' 'java-environment' 'libaacs' 'libass'
'libbluray-kodi-rbp' 'libcdio' 'mariadb-libs' 'libmicrohttpd' 'groff'
'libmodplug' 'libmpeg2' 'libnfs' 'libplist' 'libpulse' 'libssh' 'libcec-rpi'
2020-07-10 21:03:20 +00:00
'libxrandr' 'libxslt' 'lirc' 'lzo' 'nasm' 'nss-mdns' 'python2-pillow6'
2019-02-01 01:28:06 +00:00
'python2-pybluez' 'python2-simplejson' 'raspberrypi-firmware' 'rtmpdump'
'shairplay' 'smbclient' 'speex' 'swig' 'taglib' 'tinyxml' 'unzip' 'upower'
'yajl' 'zip' 'giflib' 'rapidjson' 'polkit' 'libinput' 'libxkbcommon' 'ghostscript'
)
source=("https://github.com/popcornmix/xbmc/archive/newclock5_$_tag.tar.gz"
'kodi.service'
'kodi-framebuffer'
'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"
2020-01-16 01:21:38 +00:00
sysusers.conf
tmpfiles.conf
2019-02-01 01:28:06 +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-10-24 13:14:31 +00:00
sha256sums=('82829e066b6468f2a4d30a4a5e2f67e436312425f71cc29095770e3b29f9cb15'
2020-10-19 20:08:21 +00:00
'75e49edccf6d124c49f6c47a10c1da6dfdc406bbbc1931d1031ee3b34b737ea1'
2019-02-01 01:28:06 +00:00
'fe7a1ab2a6e2bf00f756c76545a338d2763003052764d722d492b06b1bc05f5e'
'b31570f95654434b01fd8531612fbb6be77cbc1c519dd60f92feae26eb160f3d'
2020-07-10 21:03:20 +00:00
'5d38a895ee7b93689fab79124a3aad23a5e3e643abd08878d778d04066c8d26f'
2019-09-01 09:54:53 +00:00
'e11e7594af35f36ab2711252c3d6bb106908f26605498aef4a9be2d7bc001db2'
2019-02-01 01:28:06 +00:00
'38816f8373e243bc5950449b4f3b18938c4e1c59348e3411e23f31db4072e40d'
'071e414e61b795f2ff9015b21a85fc009dde967f27780d23092643916538a57a'
'a30b6aa0aad0f2c505bc77948af2d5531a80b6e68112addb4c123fca24d5d3bf'
'73d4cab4fa8a3482643d8703de4d9522d7a56981c938eca42d929106ff474b44'
'3d77d09a5df0de510aeeb940df4cb534787ddff3bb1828779753f5dfa1229d10'
'e4018e850f80700acee8da296e56e15b1eef711ab15157e542e7d7e1237c3476'
2020-01-16 01:21:38 +00:00
'5ca5491e4260cacae30f1a5786d109230db3f3a6e5a0eb45d0d0608293d247e3'
'f521b98232e5035b7cada46cf03975b8d753e93d0802bf22913fceed769f9d96'
2020-07-30 12:05:22 +00:00
'9c5e79ed8719cd032a3b17dac585aeff28a198e37af1da9af68ef1b86bab4d18')
2019-02-01 01:28:06 +00:00
prepare() {
2019-05-15 00:03:45 +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-02-01 01:28:06 +00:00
cd "xbmc-newclock5_$_tag"
[[ -d kodi-build ]] && rm -rf kodi-build
mkdir $srcdir/kodi-build
2020-07-10 21:03:20 +00:00
2019-02-01 01:28:06 +00:00
}
build() {
2019-05-15 00:03:45 +00:00
export PATH="$srcdir/path:$PATH"
2019-02-01 01:28:06 +00:00
cd kodi-build
2019-09-01 09:54:53 +00:00
_CPU="cortex-a53"
unset CFLAGS CXXFLAGS
export CFLAGS="-march=armv8-a+crc+simd -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard -O2 -pipe -fstack-protector-strong -fno-plt"
export CXXFLAGS="${CFLAGS}"
2019-02-01 01:28:06 +00:00
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=/usr/lib \
-DCMAKE_PREFIX_PATH=/opt/vc \
-DCORE_PLATFORM_NAME=rbpi \
-DWITH_CPU="$_CPU" \
-DENABLE_EVENTCLIENTS=ON \
-DENABLE_OPENGL=OFF \
-DENABLE_INTERNAL_FFMPEG=ON \
-DENABLE_INTERNAL_FMT=ON \
-DENABLE_INTERNAL_CROSSGUID=ON \
-DENABLE_INTERNAL_FSTRCMP=ON \
-DENABLE_INTERNAL_FLATBUFFERS=ON \
2020-03-01 11:36:09 +00:00
-DENABLE_MYSQLCLIENT=ON \
2019-02-01 01:28:06 +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" \
../"xbmc-newclock5_$_tag"
make
make preinstall
}
package_kodi-rbp3() {
pkgdesc="A software media player and entertainment hub for digital media (Raspberry Pi3)"
depends=(
'bluez-libs' 'desktop-file-utils' 'freetype2' 'fribidi' 'libcec-rpi'
'hicolor-icon-theme' 'libass' 'libcdio' 'libjpeg-turbo' 'mariadb-libs'
'libmicrohttpd' 'libpulse' 'libssh' 'libxrandr' 'lirc' 'raspberrypi-firmware'
2020-07-10 21:03:20 +00:00
'libxslt' 'lzo' 'python2-pillow6' 'python2-simplejson' 'smbclient'
2019-02-01 01:28:06 +00:00
'speex' 'taglib' 'tinyxml' 'xorg-xdpyinfo' 'yajl' 'libinput' 'libxkbcommon' 'libbluray-kodi-rbp'
'fbset' 'libnfs' 'curl'
)
optdepends=(
'afpfs-ng: Apple shares support'
'bluez: Blutooth support'
'python2-pybluez: Bluetooth support'
'libplist: Limited AirPlay support'
'lsb-release: log distro information in crashlog'
'shairplay: Limited AirPlay support'
'unrar: Archives support'
'unzip: Archives 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')
2019-05-15 00:03:45 +00:00
export PATH="$srcdir/path:$PATH"
2019-02-01 01:28:06 +00:00
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"
2020-01-16 01:21:38 +00:00
grep -lR '#!.*python' * | \
while read file; do sed -s 's/\(#!.*python\)/\12/g' -i "$file"; done
2019-02-01 01:28:06 +00:00
2020-01-16 01:21:38 +00:00
# fix permissions necessary for accelerated video playback
install -Dm0644 "$srcdir/99-kodi.rules" "$pkgdir/etc/udev/rules.d/99-kodi.rules"
# 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, polkit rules, and framebuffer tweak
2019-02-01 01:28:06 +00:00
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"
2020-01-16 01:21:38 +00:00
install -Dm0644 "$srcdir/kodi-framebuffer" "$pkgdir/etc/conf.d/kodi-framebuffer"
2019-02-01 01:28:06 +00:00
chmod 0750 "$pkgdir/usr/share/polkit-1/rules.d/"
}
package_kodi-rbp3-eventclients() {
pkgdesc="Kodi Event Clients (Raspberry Pi3)"
provides=('kodi-eventclients')
conflicts=('kodi-eventclients')
optdepends=('python2: most eventclients are implemented in python2')
2020-01-16 01:21:38 +00:00
_components=(
'kodi-eventclients-common'
2019-02-01 01:28:06 +00:00
'kodi-eventclients-ps3'
2020-01-16 01:21:38 +00:00
'kodi-eventclients-kodi-send'
)
2019-02-01 01:28:06 +00:00
2019-05-15 00:03:45 +00:00
export PATH="$srcdir/path:$PATH"
2019-02-01 01:28:06 +00:00
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"
2020-01-16 01:21:38 +00:00
grep -lR '#!.*python' * | \
while read file; do sed -s 's/\(#!.*python\)/\12/g' -i "$file"; done
2019-02-01 01:28:06 +00:00
}
package_kodi-rbp3-tools-texturepacker() {
pkgdesc="Kodi Texturepacker tool (Raspberry Pi3)"
depends=('libpng' 'giflib' 'libjpeg-turbo' 'lzo')
_components=('kodi-tools-texturepacker')
2019-05-15 00:03:45 +00:00
export PATH="$srcdir/path:$PATH"
2019-02-01 01:28:06 +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-rbp3-dev() {
pkgdesc="Kodi dev files (Raspberry Pi3)"
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')
2019-05-15 00:03:45 +00:00
export PATH="$srcdir/path:$PATH"
2019-02-01 01:28:06 +00:00
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"
2020-01-16 01:21:38 +00:00
grep -lR '#!.*python' * | \
while read file; do sed -s 's/\(#!.*python\)/\12/g' -i "$file"; done
2019-02-01 01:28:06 +00:00
}