void-packages/srcpkgs/kodi/template
2020-05-20 22:05:57 +02:00

107 lines
3.5 KiB
Bash

# Template file for 'kodi'
pkgname=kodi
version=18.7
revision=1
_codename="Leia"
wrksrc="xbmc-${version}-${_codename}"
build_style=cmake
configure_args="-DENABLE_INTERNAL_CROSSGUID=OFF -DWITH_FFMPEG=/usr"
short_desc="Software media player and entertainment hub for digital media"
maintainer="Helmut Pozimski <helmut@pozimski.eu>"
license="GPL-2.0-or-later"
homepage="http://www.kodi.tv"
distfiles="https://github.com/xbmc/xbmc/archive/${version}-${_codename}.tar.gz"
checksum=f6bb2ad9d8ca27d1b6bf68690d699f5e2bf3d0c7e5700d8e564b7583054c434e
python_version=2 #unverified
patch_args="-Np1"
LDFLAGS+=" -Wl,-z,stack-size=1048576"
lib32disabled=yes
archs="i686* x86_64* aarch64*
ppc64*"
hostmakedepends="
automake libtool pkg-config gperf cmake gettext zip unzip nasm yasm python-devel
gettext-devel libltdl-devel curl flatbuffers swig openjdk11 which"
makedepends="
eudev-libudev-devel pcre-devel expat-devel libpng-devel libjpeg-turbo-devel
libXrandr-devel avahi-libs-devel pulseaudio-devel samba-devel tiff-devel
libmysqlclient-devel libmpeg2-devel wavpack-devel zlib-devel lzo-devel
libXmu-devel glew-devel fribidi-devel sqlite-devel libcdio-devel freetype-devel
jasper-devel faac-devel SDL2_image-devel faad2-devel libmodplug-devel libressl-devel
libmad-devel fontconfig-devel libXinerama-devel libsamplerate-devel libmms-devel
enca-devel boost-devel libcurl-devel libva-devel libvdpau-devel libass-devel
libbluetooth-devel yajl-devel libplist-devel librtmp-devel tinyxml-devel
taglib-devel libcap-devel lame-devel libbluray-devel libnfs-devel ffmpeg-devel
giflib-devel libxslt-devel gnutls-devel libssh-devel libmicrohttpd-devel
libcec-devel dcadec-devel crossguid flatbuffers-devel fmt-devel lcms2-devel
libfstrcmp-devel rapidjson libcdio-paranoia"
# The following dependencies are dlopen(3)ed.
depends="libbluray libmad libvorbis libcurl libflac libmodplug libass libmpeg2
lame librtmp libnfs>=1.9.7 libplist>=1.12"
depends+=" glxinfo hicolor-icon-theme desktop-file-utils xdpyinfo"
case "$XBPS_TARGET_MACHINE" in
aarch64*)
hostmakedepends+=" libmysqlclient-devel SDL2_image-devel lzo-devel";
makedepends+=" python-devel ffmpeg-devel";
configure_args+=" -DENABLE_LDGOLD=Off -DENABLE_VAAPI=OFF";
;;
esac
# gold broken with musl
case "$XBPS_MACHINE" in
*-musl) configure_args+=" -DENABLE_LDGOLD=Off";;
esac
pre_configure() {
if [ "$CROSS_BUILD" ]; then
find -type f | \
grep "configure\.ac\|Makefile\|cmake\|config\.site" | \
xargs sed -i -e "s;-isystem;-I;g"
fi
. /etc/profile.d/10_openjdk11.sh
if [ "$CROSS_BUILD" ]; then
for i in JsonSchemaBuilder TexturePacker; do
cat > cmake/modules/Find$i.cmake <<EOF
add_executable($i::$i IMPORTED GLOBAL)
set_target_properties($i::$i PROPERTIES
IMPORTED_LOCATION "\${CORE_SOURCE_DIR}/tools/depends/native/$i/bin/$i")
set_target_properties($i::$i PROPERTIES FOLDER Tools)
EOF
done
fi
}
pre_build() {
if [ "$CROSS_BUILD" ]; then
for i in JsonSchemaBuilder TexturePacker; do
CC= LD= CXX= LDFLAGS= CFLAGS= CXXFLAGS= \
make -C tools/depends/native/$i
done
fi
}
post_build() {
# Rebuild for target
if [ "$CROSS_BUILD" ]; then
for i in JsonSchemaBuilder TexturePacker; do
make -C tools/depends/native/$i clean all \
CC="$CC" CXX="$CXX" LD="$LD" AR="$AR" RANLIB="$RANLIB" \
CPP="$CPP" AS="$AS" OBJDUMP="$OBJDUMP" \
CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"
done
fi
}
kodi-devel_package() {
short_desc+=" - development files"
depends="${sourcepkg}>=${version}_${revision}"
pkg_install() {
vmove usr/include
vmove usr/share/kodi/cmake
}
}