123 lines
5.6 KiB
Plaintext
123 lines
5.6 KiB
Plaintext
# Description: Open source home theater software, running in a gbm buffer
|
|
# URL: https://kodi.tv/
|
|
# Maintainer: Tim Biermann, tbier at posteo dot de
|
|
# Depends on: crossguid dbus flatbuffers fstrcmp libass libcdio libdvdread libinput libmicrohttpd libxkbcommon mesa openjdk20-jdk rapidjson spdlog swig taglib tinyxml xkeyboard-config
|
|
# Optional: alsa-lib avahi bluez dav1d libmicrohttpd libnfs libnghttp2 libva libva-vdpau-driver libxslt mariadb mysql pipewire pulseaudio
|
|
|
|
name=kodi-gbm
|
|
version=20.5
|
|
release=1
|
|
|
|
# version variables {{{
|
|
_codename=Nexus
|
|
_ffmpeg_version="4.4.1-${_codename}-Alpha1"
|
|
_libdvdcss_version="1.4.3-Next-${_codename}-Alpha2-2"
|
|
_libdvdnav_version="6.1.1-Next-${_codename}-Alpha2-2"
|
|
_libdvdread_version="6.1.3-Next-${_codename}-Alpha2-2"
|
|
# }}}
|
|
# source {{{
|
|
source=(https://github.com/xbmc/xbmc/archive/$version-$_codename/xbmc-$version-$_codename.tar.gz
|
|
https://github.com/xbmc/FFmpeg/archive/$_ffmpeg_version/ffmpeg-$_ffmpeg_version.tar.gz
|
|
https://github.com/xbmc/libdvdcss/archive/$_libdvdcss_version/${name/-gbm/}-libdvdcss-$_libdvdcss_version.tar.gz
|
|
https://github.com/xbmc/libdvdnav/archive/$_libdvdnav_version/${name/-gbm/}-libdvdnav-$_libdvdnav_version.tar.gz
|
|
https://github.com/xbmc/libdvdread/archive/$_libdvdread_version/${name/-gbm}-libdvdread-$_libdvdread_version.tar.gz
|
|
swig-4.2.0.patch)
|
|
# }}}
|
|
# unpack_source() {{{
|
|
unpack_source() {
|
|
for file in ${source[@]}; do
|
|
case ${file##*/} in
|
|
xbmc-$version-$_codename.tar.gz)
|
|
bsdtar -p -o -C $SRC -xf $(get_filename $file) ;;
|
|
*)
|
|
cp $(get_filename $file) $SRC ;;
|
|
esac
|
|
done
|
|
}
|
|
# }}}
|
|
|
|
build() {
|
|
# clang? {{{
|
|
if [[ $PKGMK_KODI_USE_CLANG == on ]]; then
|
|
[[ -e /usr/bin/clang && -e /usr/bin/clang++ && -e /usr/bin/lld ]] && export CC=clang CXX=clang++ AR=llvm-ar NM=llvm-nm RANLIB=llvm-ranlib LDFLAGS+=' -fuse-ld=lld' && KODI_EXTRA+=' -D CMAKE_CXX_COMPILER_AR=/usr/bin/llvm-ar -D CMAKE_CXX_COMPILER_RANLIB=/usr/bin/llvm-ranlib -D CMAKE_NM=/usr/bin/llvm-nm -D ENABLE_LLD=ON -D USE_LTO=8' || echo "Please install clang first"
|
|
fi
|
|
# }}}
|
|
unset PATH
|
|
export PATH="/usr/lib/java/openjdk20-jdk/bin:/usr/bin:/bin:/usr/sbin:/sbin"
|
|
|
|
# optionals {{{
|
|
prt-get isinst alsa-lib && KODI_EXTRA+=' -D ENABLE_ALSA=ON' || KODI_EXTRA+=' -D ENABLE_ALSA=OFF'
|
|
prt-get isinst avahi && KODI_EXTRA+=' -D ENABLE_AVAHI=ON' || KODI_EXTRA+=' -D ENABLE_AVAHI=OFF'
|
|
prt-get isinst bluez sbc && KODI_EXTRA+=' -D ENABLE_BLUETOOTH=ON' || KODI_EXTRA+=' -D ENABLE_BLUETOOTH=OFF'
|
|
prt-get isinst dav1d && KODI_EXTRA+=' -D ENABLE_INTERNAL_DAV1D=OFF' || KODI_EXTRA+=' -D ENABLE_INTERNAL_DAV1D=ON'
|
|
prt-get isinst libmicrohttpd && KODI_EXTRA+=' -D ENABLE_MICROHTTPD=ON' || KODI_EXTRA+=' -D ENABLE_MICROHTTPD=OFF'
|
|
prt-get isinst libnfs && KODI_EXTRA+=' -D ENABLE_NFS=ON' || KODI_EXTRA+=' -D ENABLE_NFS=OFF'
|
|
prt-get isinst libva && KODI_EXTRA+=' -D ENABLE_VAAPI=ON' || KODI_EXTRA+=' -D ENABLE_VAAPI=OFF'
|
|
prt-get isinst libva-vdpau-driver && KODI_EXTRA+=' -D ENABLE_VDPAU=ON' || KODI_EXTRA+=' -D ENABLE_VDPAU=OFF'
|
|
prt-get isinst libxslt && KODI_EXTRA+=' -D ENABLE_XSLT=ON' || KODI_EXTRA+=' -D ENABLE_XSLT=OFF'
|
|
prt-get isinst mysql && KODI_EXTRA+=' -D ENABLE_MYSQLCLIENT=ON'
|
|
prt-get isinst mariadb && KODI_EXTRA+=' -D ENABLE_MARIADBCLIENT=ON'
|
|
prt-get isinst pulseaudio && KODI_EXTRA+=' -D ENABLE_PULSEAUDIO=ON' || KODI_EXTRA+=' -D ENABLE_PULSEAUDIO=OFF'
|
|
prt-get isinst pipewire && KODI_EXTRA+=' -D ENABLE_PIPEWIRE=ON' || KODI_EXTRA+=' -D ENABLE_PIPEWIRE=OFF'
|
|
|
|
prt-get isinst ccache && PATH="$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}' | sed 's/:*$//')"
|
|
# }}}
|
|
|
|
# grabbed off from gentoo
|
|
for i in xbmc-$version-$_codename/tools/depends/native/{TexturePacker,JsonSchemaBuilder}/src; do
|
|
pushd $i;
|
|
autoreconf -vfi;
|
|
popd
|
|
done
|
|
|
|
sed -e 's/autoreconf -vif/echo "autoreconf already done"/' -i \
|
|
xbmc-$version-$_codename/tools/depends/native/TexturePacker/src/autogen.sh \
|
|
xbmc-$version-$_codename/tools/depends/native/JsonSchemaBuilder/src/autogen.sh
|
|
|
|
patch -Np1 -d xbmc-$version-$_codename -i $SRC/swig-4.2.0.patch
|
|
|
|
cmake -S xbmc-$version-$_codename -B build -G Ninja $KODI_EXTRA \
|
|
-D CMAKE_INSTALL_PREFIX=/usr \
|
|
-D CMAKE_INSTALL_LIBDIR=lib \
|
|
-D CMAKE_BUILD_TYPE=Release \
|
|
-D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS -Wno-error=restrict" \
|
|
-D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \
|
|
-D CORE_PLATFORM_NAME=gbm \
|
|
-D ENABLE_EGL=ON \
|
|
-D APP_RENDER_SYSTEM=gl \
|
|
-D ENABLE_DBUS=ON \
|
|
-D ENABLE_DVDCSS=ON \
|
|
-D ENABLE_EVENTCLIENTS=ON \
|
|
-D ENABLE_UDEV=ON \
|
|
-D ENABLE_PYTHON=ON \
|
|
-D fmt_DIR=/usr/lib/cmake/fmt \
|
|
-D spdlog_DIR=/usr/lib/cmake/spdlog \
|
|
-D ENABLE_ISO9660PP=OFF \
|
|
-D ENABLE_GOLD=OFF \
|
|
-D ENABLE_TESTING=OFF \
|
|
-D VERBOSE=OFF \
|
|
-D LIBDVDCSS_URL="$SRC/${name/-gbm/}-libdvdcss-$_libdvdcss_version.tar.gz" \
|
|
-D LIBDVDNAV_URL="$SRC/${name/-gbm/}-libdvdnav-$_libdvdnav_version.tar.gz" \
|
|
-D LIBDVDREAD_URL="$SRC/${name/-gbm/}-libdvdread-$_libdvdread_version.tar.gz" \
|
|
-D ENABLE_INTERNAL_FFMPEG=ON \
|
|
-D FFMPEG_URL="$SRC/ffmpeg-$_ffmpeg_version.tar.gz" \
|
|
-D ENABLE_INTERNAL_CROSSGUID=OFF \
|
|
-D ENABLE_INTERNAL_FMT=OFF \
|
|
-D ENABLE_INTERNAL_FSTRCMP=OFF \
|
|
-D ENABLE_INTERNAL_FLATBUFFERS=OFF \
|
|
-D ENABLE_INTERNAL_GTEST=OFF \
|
|
-D ENABLE_INTERNAL_RapidJSON=OFF \
|
|
-Wno-dev
|
|
#-D CROSSGUID_URL="$SRC/crossguid-$_crossguid_version.tar.gz" \
|
|
cmake --build build
|
|
DESTDIR=$PKG cmake --build build --target install
|
|
|
|
export PYTHONHASHSEED=0
|
|
/usr/bin/python3 -m compileall -d / $PKG/usr/lib
|
|
/usr/bin/python3 -O -m compileall -d / $PKG/usr/lib
|
|
|
|
rm -r $PKG/usr/{lib/firewalld,share/doc}
|
|
}
|
|
|
|
# vim: foldmethod=marker foldlevelstart=1
|