diff options
author | Karel Kočí <cynerd@email.cz> | 2020-02-13 08:31:23 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2020-02-13 08:31:23 +0100 |
commit | 3ec4d97a54ea72054638fec340bd58819b30ec01 (patch) | |
tree | 305f6e726d0f7571ca8cffe7dfd09fb59e3bcf2f /kodi-rpi | |
parent | 3051cb1d103c8e600346a1a5be268c1343c54f46 (diff) | |
download | alpine-personal-pkgs-3ec4d97a54ea72054638fec340bd58819b30ec01.tar.gz alpine-personal-pkgs-3ec4d97a54ea72054638fec340bd58819b30ec01.tar.bz2 alpine-personal-pkgs-3ec4d97a54ea72054638fec340bd58819b30ec01.zip |
kodi-rpi: rename from kodi and try to improve and clean
Diffstat (limited to 'kodi-rpi')
-rw-r--r-- | kodi-rpi/60-kodi.rules | 12 | ||||
-rw-r--r-- | kodi-rpi/APKBUILD | 140 | ||||
-rw-r--r-- | kodi-rpi/cassert.patch | 25 | ||||
-rw-r--r-- | kodi-rpi/fix-musl-incompability.patch | 108 | ||||
-rw-r--r-- | kodi-rpi/kodi-gbm.pre-install | 10 | ||||
-rw-r--r-- | kodi-rpi/kodi.initd | 12 | ||||
-rw-r--r-- | kodi-rpi/set-default-stacksize.patch | 10 |
7 files changed, 317 insertions, 0 deletions
diff --git a/kodi-rpi/60-kodi.rules b/kodi-rpi/60-kodi.rules new file mode 100644 index 0000000..7023ff7 --- /dev/null +++ b/kodi-rpi/60-kodi.rules @@ -0,0 +1,12 @@ +// DO NOT EDIT THIS FILE, it will be overwritten on update +// +// Allows shutting down the system when using Kodi with a dedicated user + +polkit.addRule(function(action, subject) { + if (( (action.id.indexOf("org.freedesktop.udisks.") == 0) || + (action.id.indexOf("org.freedesktop.upower.") == 0) || + (action.id.indexOf("org.freedesktop.login1.") == 0) ) && + subject.user == "kodi") { + return polkit.Result.YES; + } +}); diff --git a/kodi-rpi/APKBUILD b/kodi-rpi/APKBUILD new file mode 100644 index 0000000..3b3dd7a --- /dev/null +++ b/kodi-rpi/APKBUILD @@ -0,0 +1,140 @@ +# Maintainer: Karel Kočí <cynerd@email.cz> +pkgname=kodi-rpi +pkgver=18.5 +_realname=Leia +pkgrel=0 +_libdvdcss_pkgver="1.4.2-Leia-Beta-5" +_libdvdread_pkgver="6.0.0-Leia-Alpha-3" +_libdvdnav_pkgver="6.0.0-Leia-Alpha-3" +_crossguid_hash="8f399e8bd4" +pkgdesc="A software media player and entertainment hub for digital media (Raspberry Pi build)" +url="https://kodi.tv" +arch="armv7" +license="GPL-2.0-only" +depends="python2 + coreutils + hicolor-icon-theme + xdpyinfo + curl + py-pillow + py-bluez + py-simplejson" +# Required dependencies +depends_dev="libass-dev + libcdio-dev + curl-dev + ffmpeg-rpi-dev + flatbuffers-dev + fmt-dev + freetype-dev + fribidi-dev + fstrcmp-dev + libdvdcss-dev + lzo-dev + openssl-dev + pcre-dev + rapidjson-dev + sqlite-dev + taglib-dev + tinyxml-dev + zlib-dev + giflib-dev + libjpeg-turbo-dev +" + +# Required for Raspberry Pi +depends_dev="$depends_dev + raspberrypi-dev +" + +# Optional for extra features +depends_dev="$depends_dev + alsa-lib-dev + avahi-dev + bluez-dev + libbluray-dev + libcap-dev + libcec-dev + dbus-dev + libmicrohttpd-dev + libnfs-dev + libplist-dev + pulseaudio-dev + python2-dev + samba-dev + eudev-dev + libxslt-dev + mariadb-connector-c-dev + libshairport-dev" +makedepends="$depends_dev + cmake + swig + autoconf + automake + libtool + doxygen + graphviz + xz + tar + openjdk8-jre-base" + +replaces="xbmc" +provides="kodi kodi-bin" +options="ldpath-recursive !check" # No testsuite +source="https://github.com/xbmc/xbmc/archive/$pkgver-$_realname.tar.gz + libdvdcss-$_libdvdcss_pkgver.tar.gz::https://github.com/xbmc/libdvdcss/archive/$_libdvdcss_pkgver.tar.gz + libdvdread-$_libdvdread_pkgver.tar.gz::https://github.com/xbmc/libdvdread/archive/$_libdvdread_pkgver.tar.gz + libdvdnav-$_libdvdnav_pkgver.tar.gz::https://github.com/xbmc/libdvdnav/archive/$_libdvdnav_pkgver.tar.gz + crossguid-$_crossguid_hash.tar.gz::https://mirrors.kodi.tv/build-deps/sources/crossguid-$_crossguid_hash.tar.gz + set-default-stacksize.patch + fix-musl-incompability.patch + cassert.patch + kodi.initd + 60-kodi.rules + " + +builddir="$srcdir/xbmc-$pkgver-$_realname" + +build() { + make -C tools/depends/target/crossguid PREFIX="$PWD"/usr + + cmake "$builddir" \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DCMAKE_PREFIX_PATH=/opt/vc \ + -DENABLE_EVENTCLIENTS=ON \ + -DENABLE_INTERNAL_FFMPEG=OFF \ + -DENABLE_INTERNAL_FMT=OFF \ + -DENABLE_INTERNAL_CROSSGUID=ON \ + -DENABLE_INTERNAL_FSTRCMP=OFF \ + -DENABLE_INTERNAL_FLATBUFFERS=OFF \ + -DENABLE_INTERNAL_RapidJSON=OFF \ + -Dlibdvdcss_URL="$srcdir"/libdvdcss-$_libdvdcss_pkgver.tar.gz \ + -Dlibdvdread_URL="$srcdir"/libdvdread-$_libdvdread_pkgver.tar.gz \ + -Dlibdvdnav_URL="$srcdir"/libdvdnav-$_libdvdnav_pkgver.tar.gz \ + -DCROSSGUID_URL="$srcdir"/crossguid-$_crossguid_hash.tar.gz \ + -DWITH_CPU="cortex-a53" \ + -DCORE_PLATFORM_NAME=rbpi + # NOTE: CPU for Raspberry Pi 2 should be cortex-a7 + make + make preinstall +} + +package() { + make DESTDIR="$pkgdir" install + + install -Dm755 "$srcdir"/kodi.initd "$pkgdir"/etc/init.d/kodi +} + + +sha512sums="6fe70d8ee5b6ffd3d43b89487554e41eed8dbf95bb017b82578b547ec248ae94f4dda298f0d85c5896019f7032eba4e1e2494c8140dde9c9b9cb21802acfd029 18.5-Leia.tar.gz +5185dbdbeb1bd13ea9d8723f1f4ab599d6f3102f5ba1096cd085aa1cda252c045f327c719227bba8e1b742352ade5e335106c8d0c1637a5a6b93ce661620dd7e libdvdcss-1.4.2-Leia-Beta-5.tar.gz +b3419ba0a1a2dd70f1bb6236afdfe1c6e88c9ad4264198b289e3bba9375e077cecf7f89848c7b09debaa445327f3507101f3d157e692f7a7163b2bb52643e1e7 libdvdread-6.0.0-Leia-Alpha-3.tar.gz +11c93eaacd156f8fd7dec7c43d366438b201f31ad55b2870463a9e286912b6ada08882319a021fb7992190f87b909a49f2b83e0321cc17aedc29f7fe5898fa72 libdvdnav-6.0.0-Leia-Alpha-3.tar.gz +2682d63609d3dcdfcd8136be632e45df26ad88ce93b9c49745cf728bbd2e6254a7b05c8b059ab581d532372e504206a525a52564b64d076dfdae9c965a09fd16 crossguid-8f399e8bd4.tar.gz +3fd97e9fa22e59b3cd30fdad19474e177a9d062598765fa8ba4955f1da4e10581ff1463dd0794d3ee3cefebf753007a4d445b2bc47a257574d3927c1408b8876 set-default-stacksize.patch +65b78a96bef33cec975b371f1a930d551d7b224955d6075b7edc7e51ec30fec9c77d34f622abbaf827c60df6029206b72c02ee2d2f138d276c1b843336fd14ab fix-musl-incompability.patch +7348495a805d07730dc569b091f15765ca9d86fa28987a343dfc7fa36cd6ecbb52ac4ea76d7c9fe9eab90ed8552ef6aeae7ffd72edd11f8d780c1de2e9ffe49d cassert.patch +7e2a2289da3098e0007e461ad538dcd6435e908283caf1719788248fe736615890175e11392ca0cd68002872217bbf7b70cf909f228307828aa82467d5502ed4 kodi.initd +465a2079d598bf909a458d8e9d0ddd2b2a41dff83ba736542cffec7811c044295d5af092928f20aaa6cd3bc8b13bb03ede5c7ded1783680f890464e103392787 60-kodi.rules" diff --git a/kodi-rpi/cassert.patch b/kodi-rpi/cassert.patch new file mode 100644 index 0000000..5246c5c --- /dev/null +++ b/kodi-rpi/cassert.patch @@ -0,0 +1,25 @@ +diff --git a/xbmc/profiles/dialogs/GUIDialogProfileSettings.cpp b/xbmc/profiles/dialogs/GUIDialogProfileSettings.cpp +index 222d1fa..0f654ee 100644 +--- a/xbmc/profiles/dialogs/GUIDialogProfileSettings.cpp ++++ b/xbmc/profiles/dialogs/GUIDialogProfileSettings.cpp +@@ -30,6 +30,7 @@ + #include "utils/log.h" + #include "utils/StringUtils.h" + #include "utils/URIUtils.h" ++#include <cassert> + #include "utils/Variant.h" + #include "ServiceBroker.h" + +diff --git a/xbmc/windowing/GraphicContext.cpp b/xbmc/windowing/GraphicContext.cpp +index 1ced496..0ddbe64 100644 +--- a/xbmc/windowing/GraphicContext.cpp ++++ b/xbmc/windowing/GraphicContext.cpp +@@ -24,6 +24,8 @@ + #include "guilib/GUIWindowManager.h" + #include "guilib/TextureManager.h" + ++#include <cassert> ++ + using namespace KODI::MESSAGING; + + CGraphicContext::CGraphicContext(void) = default; diff --git a/kodi-rpi/fix-musl-incompability.patch b/kodi-rpi/fix-musl-incompability.patch new file mode 100644 index 0000000..77d9bb8 --- /dev/null +++ b/kodi-rpi/fix-musl-incompability.patch @@ -0,0 +1,108 @@ +diff --git a/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp b/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp +index 1d5564c8c5..73c07fb586 100644 +--- a/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp ++++ b/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp +@@ -72,6 +72,13 @@ + #include "platform/win32/CharsetConverter.h" + #endif + ++#ifndef _PATH_MOUNTED ++#define _PATH_MOUNTED "/proc/mounts" ++#endif ++#ifndef _PATH_MNTTAB ++#define _PATH_MNTTAB "/etc/fstab" ++#endif ++ + using namespace XFILE; + + struct SDirData +@@ -124,7 +131,7 @@ extern "C" void __stdcall init_emu_environ() + dll_putenv("OS=win10"); + #elif defined(TARGET_DARWIN) + dll_putenv("OS=darwin"); +-#elif defined(TARGET_POSIX) ++#elif defined(TARGET_POSIX) || !defined(__GLIBC__) + dll_putenv("OS=linux"); + #else + dll_putenv("OS=unknown"); +@@ -1480,7 +1487,7 @@ extern "C" + int ret; + + ret = dll_fgetpos64(stream, &tmpPos); +-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) ++#if !defined(__GLIBC__) || !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) + *pos = (fpos_t)tmpPos; + #else + pos->__pos = (off_t)tmpPos.__pos; +@@ -1493,8 +1500,9 @@ extern "C" + CFile* pFile = g_emuFileWrapper.GetFileXbmcByStream(stream); + if (pFile != NULL) + { +-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) +- *pos = pFile->GetPosition(); ++#if !defined(__GLIBC__) || !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) ++ uint64_t *ppos = (uint64_t *)pos; ++ *ppos = pFile->GetPosition(); + #else + pos->__pos = pFile->GetPosition(); + #endif +@@ -1509,8 +1517,9 @@ extern "C" + int fd = g_emuFileWrapper.GetDescriptorByStream(stream); + if (fd >= 0) + { +-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) +- if (dll_lseeki64(fd, *pos, SEEK_SET) >= 0) ++#if !defined(TARGET_POSIX) || !defined(__GLIBC__) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) ++ const uint64_t *ppos = (const uint64_t *) pos; ++ if (dll_lseeki64(fd, *ppos, SEEK_SET) >= 0) + #else + if (dll_lseeki64(fd, (__off64_t)pos->__pos, SEEK_SET) >= 0) + #endif +@@ -1532,7 +1541,7 @@ extern "C" + if (fd >= 0) + { + fpos64_t tmpPos; +-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) ++#if !defined(__GLIBC__) || !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) + tmpPos= *pos; + #else + tmpPos.__pos = (off64_t)(pos->__pos); +diff --git a/xbmc/cores/DllLoader/exports/emu_msvcrt.h b/xbmc/cores/DllLoader/exports/emu_msvcrt.h +index 7869dc221c..3b86d6b45b 100644 +--- a/xbmc/cores/DllLoader/exports/emu_msvcrt.h ++++ b/xbmc/cores/DllLoader/exports/emu_msvcrt.h +@@ -17,7 +17,7 @@ + #define _onexit_t void* + #endif + +-#if defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) ++#if !defined(__GLIBC__) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) + typedef off_t __off_t; + typedef int64_t off64_t; + typedef off64_t __off64_t; +diff --git a/xbmc/cores/DllLoader/exports/wrapper.c b/xbmc/cores/DllLoader/exports/wrapper.c +index 33ab3437c1..5a68de2c64 100644 +--- a/xbmc/cores/DllLoader/exports/wrapper.c ++++ b/xbmc/cores/DllLoader/exports/wrapper.c +@@ -23,7 +23,7 @@ + #include <dirent.h> + #include <dlfcn.h> + +-#if defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) ++#if !defined(__GLIBC__) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) + typedef off_t __off_t; + typedef int64_t off64_t; + typedef off64_t __off64_t; +diff --git a/xbmc/cores/DllLoader/ldt_keeper.c b/xbmc/cores/DllLoader/ldt_keeper.c +index 0e6bc81bf7..73f1346458 100644 +--- a/xbmc/cores/DllLoader/ldt_keeper.c ++++ b/xbmc/cores/DllLoader/ldt_keeper.c +@@ -49,7 +49,7 @@ + #ifdef __cplusplus + extern "C" { + #endif +-#if defined(TARGET_ANDROID) && defined(__i386__) && !defined(modify_ldt) ++#if defined(__linux__) && !defined(__GLIBC__) && !defined(modify_ldt) + #define modify_ldt(a,b,c) syscall( __NR_modify_ldt, a, b, c); + #else + int modify_ldt(int func, void *ptr, unsigned long bytecount); diff --git a/kodi-rpi/kodi-gbm.pre-install b/kodi-rpi/kodi-gbm.pre-install new file mode 100644 index 0000000..03b2e52 --- /dev/null +++ b/kodi-rpi/kodi-gbm.pre-install @@ -0,0 +1,10 @@ +#!/bin/sh + +addgroup -S kodi 2>/dev/null +adduser -S -D -h /var/lib/kodi -s /sbin/nologin -G kodi kodi 2>/dev/null + +for group in video audio input; do + adduser kodi $group 2>/dev/null +done + +exit 0 diff --git a/kodi-rpi/kodi.initd b/kodi-rpi/kodi.initd new file mode 100644 index 0000000..4fedd31 --- /dev/null +++ b/kodi-rpi/kodi.initd @@ -0,0 +1,12 @@ +#!/sbin/openrc-run + +supervisor=supervise-daemon + +name="Kodi" +description="A software media player and entertainment hub for digital media" + +command=/usr/lib/kodi/kodi-gbm +command_args="--standalone" +command_background=true +pidfile="/var/run/kodi.pid" +command_user="kodi:kodi" diff --git a/kodi-rpi/set-default-stacksize.patch b/kodi-rpi/set-default-stacksize.patch new file mode 100644 index 0000000..8a79215 --- /dev/null +++ b/kodi-rpi/set-default-stacksize.patch @@ -0,0 +1,10 @@ +--- ./xbmc/threads/platform/pthreads/ThreadImpl.cpp.orig ++++ ./xbmc/threads/platform/pthreads/ThreadImpl.cpp +@@ -42,6 +42,7 @@ + { + pthread_attr_t attr; + pthread_attr_init(&attr); ++ if (!stacksize) stacksize = 1024*1024; + #if !defined(TARGET_ANDROID) // http://code.google.com/p/android/issues/detail?id=7808 + if (stacksize > PTHREAD_STACK_MIN) + pthread_attr_setstacksize(&attr, stacksize); |