diff options
4 files changed, 85 insertions, 32 deletions
diff --git a/multimedia/kodi-devel/Makefile b/multimedia/kodi-devel/Makefile index 1a9fc80548aa..a33a21a34d5c 100644 --- a/multimedia/kodi-devel/Makefile +++ b/multimedia/kodi-devel/Makefile @@ -3,8 +3,9 @@ PORTNAME= kodi DISTVERSION= 18.0rc5.2 DISTVERSIONSUFFIX= -Leia +PORTREVISION= 1 CATEGORIES= multimedia -PKGNAMESUFFIX?= -devel +PKGNAMESUFFIX= -devel MAINTAINER= tobik@FreeBSD.org COMMENT= Award winning media center application @@ -45,6 +46,7 @@ LIB_DEPENDS= libass.so:multimedia/libass \ libtinyxml.so:textproc/tinyxml \ libudev.so:devel/libudev-devd \ libuuid.so:misc/e2fsprogs-libuuid +RUN_DEPENDS= xkeyboard-config>=2.24:x11/xkeyboard-config # Building libcpluff.a requires autoreconf and gmake. Using ninja # leads to dependency problems where libcpluff.a is not yet finished @@ -76,12 +78,13 @@ KODIARCH_i386= x86 KODIARCH_amd64= x86_64 PLIST_SUB= ARCH=${KODIARCH_${ARCH}:U${ARCH}} OPSYS=${OPSYS:tl} +PORTDATA= * OPTIONS_DEFINE= AVAHI CEC DBUS LIBBLURAY MYSQL NFS SMB SSE UPNP VAAPI VDPAU WEBSERVER -OPTIONS_DEFAULT= LIBBLURAY UPNP VAAPI VDPAU WEBSERVER X11 +OPTIONS_DEFAULT= GBM LIBBLURAY UPNP VAAPI VDPAU WEBSERVER WAYLAND X11 OPTIONS_DEFAULT_amd64= SSE -OPTIONS_SINGLE= PLATFORM -OPTIONS_SINGLE_PLATFORM= GBM RPI WAYLAND X11 +OPTIONS_MULTI= PLATFORM +OPTIONS_MULTI_PLATFORM= GBM RPI WAYLAND X11 OPTIONS_EXCLUDE_amd64= RPI OPTIONS_EXCLUDE_armv6= SSE OPTIONS_EXCLUDE_armv7= SSE @@ -105,7 +108,7 @@ CEC_CMAKE_BOOL= ENABLE_CEC DBUS_LIB_DEPENDS= libdbus-1.so:devel/dbus DBUS_CMAKE_BOOL= ENABLE_DBUS -GBM_CMAKE_ON= -DCORE_PLATFORM_NAME:STRING="gbm" \ +KODI_GBM_ARGS= -DCORE_PLATFORM_NAME:STRING="gbm" \ -DGBM_RENDER_SYSTEM:STRING="gl" GBM_CFLAGS= -I${LOCALBASE}/include/libepoll-shim GBM_LDFLAGS= -L${LOCALBASE}/lib -lepoll-shim -lpthread -lrt @@ -113,6 +116,7 @@ GBM_BUILD_DEPENDS= evdev-proto>0:devel/evdev-proto GBM_LIB_DEPENDS= libepoll-shim.so:devel/libepoll-shim \ libinput.so:x11/libinput \ libxkbcommon.so:x11/libxkbcommon +GBM_VARS= KODI_PLATFORMS+=GBM LIBBLURAY_LIB_DEPENDS= libbluray.so:multimedia/libbluray LIBBLURAY_CMAKE_BOOL= ENABLE_BLURAY @@ -129,12 +133,13 @@ PULSEAUDIO_CMAKE_BOOL= ENABLE_PULSEAUDIO # For RPI, disable VAAPI in multimedia/ffmpeg too, so that mesa-libs # is *not* installed via libva in the build environment. Both # mesa-libs and raspberrypi-userland conflict with each other. -RPI_CMAKE_ON= -DCORE_PLATFORM_NAME:STRING="rbpi" +KODI_RBPI_ARGS= -DCORE_PLATFORM_NAME:STRING="rbpi" RPI_LIB_DEPENDS= libbrcmEGL.so:misc/raspberrypi-userland RPI_LIB_DEPENDS_OFF= libdrm.so:graphics/libdrm -RPI_PREVENTS= VAAPI VDPAU +RPI_PREVENTS= GBM VAAPI VDPAU WAYLAND X11 RPI_USES_OFF= gl RPI_USE_OFF= GL=egl,gl,glu +RPI_VARS= KODI_PLATFORMS+=RBPI SMB_USES= samba:lib SMB_CMAKE_BOOL= ENABLE_SMBCLIENT @@ -163,7 +168,7 @@ VAAPI_LIB_DEPENDS= libva.so:multimedia/libva VDPAU_CMAKE_BOOL= ENABLE_VDPAU VDPAU_LIB_DEPENDS= libvdpau.so:multimedia/libvdpau -WAYLAND_CMAKE_ON= -DCORE_PLATFORM_NAME:STRING="wayland" \ +KODI_WAYLAND_ARGS= -DCORE_PLATFORM_NAME:STRING="wayland" \ -DWAYLAND_RENDER_SYSTEM:STRING="gl" WAYLAND_BUILD_DEPENDS= evdev-proto>0:devel/evdev-proto \ wayland-protocols>=0:graphics/wayland-protocols @@ -171,19 +176,18 @@ WAYLAND_LIB_DEPENDS= libinput.so:x11/libinput \ libwayland-client++.so:graphics/waylandpp \ libwayland-client.so:graphics/wayland \ libxkbcommon.so:x11/libxkbcommon +WAYLAND_VARS= KODI_PLATFORMS+=WAYLAND WEBSERVER_LIB_DEPENDS= libmicrohttpd.so:www/libmicrohttpd WEBSERVER_CMAKE_BOOL= ENABLE_MICROHTTPD -X11_CMAKE_ON= -DCORE_PLATFORM_NAME:STRING="x11" +KODI_X11_ARGS= -DCORE_PLATFORM_NAME:STRING="x11" +KODI_X11_BINS= kodi-x11 kodi-xrandr X11_USE= XORG=x11,xext,xrandr +X11_VARS= KODI_PLATFORMS+=X11 .include <bsd.port.options.mk> -.if ${SLAVE_PORT} == no -PORTDATA= * -.endif - post-patch: # Do not try to download dvdnav/dvdread during the build, instead # we'll manually point the build to the system's libdvd{nav,read}.so @@ -194,9 +198,42 @@ post-patch: # upstream devs do not sync them @${CP} ${WRKSRC}/system/settings/linux.xml \ ${WRKSRC}/system/settings/freebsd.xml - -.if ${SLAVE_PORT} == no -post-install: +# Make sure Kodi can find keyboard layouts from xkeyboard-config + @${REINPLACE_CMD} 's,/usr/share/X11/xkb/rules/,${LOCALBASE}/share/X11/xkb/rules/,g' \ + ${WRKSRC}/xbmc/platform/linux/input/LibInputSettings.cpp + +do-configure: +.for platform in ${KODI_PLATFORMS:O} + @${ECHO_MSG} "===> Performing out-of-source build for ${platform}" + ${MKDIR} ${CONFIGURE_WRKSRC}/${platform} + @cd ${CONFIGURE_WRKSRC}/${platform} && ${SETENV} ${CONFIGURE_ENV} \ + ${CMAKE_BIN} ${CMAKE_ARGS} ${KODI_${platform}_ARGS} \ + ${CMAKE_SOURCE_PATH} +.endfor + +do-build: +# build in reverse to avoid touching some source files in later +# builds and triggering rebuilds/relinks in the first platform +# install phase. +.for platform in ${KODI_PLATFORMS:O:[-1..1]} + @${ECHO_MSG} "===> Building for ${platform}" + @${DO_MAKE_BUILD} -C ${BUILD_WRKSRC}/${platform} ${ALL_TARGET} +.endfor + +do-install: +# Do a full install for the first platform including shared data files... +.for platform in ${KODI_PLATFORMS:O:[1]} + @${ECHO_MSG} "===> Installing for ${platform}" + @cd ${INSTALL_WRKSRC}/${platform} && ${SETENV} ${MAKE_ENV} ${FAKEROOT} \ + ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET} +.endfor +# ... followed by only the other platform binaries +.for platform in ${KODI_PLATFORMS:O:[2..-1]} + @${ECHO_MSG} "===> Installing for ${platform}" + cd ${INSTALL_WRKSRC}/${platform} && \ + ${INSTALL_PROGRAM} ${KODI_${platform}_BINS:Ukodi-${platform:tl}} \ + ${STAGEDIR}${PREFIX}/lib/kodi +.endfor ${INSTALL_MAN} ${WRKSRC}/docs/manpages/kodi.bin.1 ${STAGEDIR}${MAN1PREFIX}/man/man1 @cd ${STAGEDIR}${MAN1PREFIX}/man/man1 && ${LN} -sf kodi.bin.1.gz kodi.1.gz @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/TexturePacker @@ -205,6 +242,5 @@ post-install: @${RM} -r ${STAGEDIR}${DOCSDIR} # No firewalld on FreeBSD... @${RM} -r ${STAGEDIR}${PREFIX}/lib/firewalld -.endif .include <bsd.port.mk> diff --git a/multimedia/kodi-devel/files/patch-tools_Linux_kodi.sh.in b/multimedia/kodi-devel/files/patch-tools_Linux_kodi.sh.in new file mode 100644 index 000000000000..a4636bdcde91 --- /dev/null +++ b/multimedia/kodi-devel/files/patch-tools_Linux_kodi.sh.in @@ -0,0 +1,18 @@ +Export XKB_DEFAULT_RULES=evdev when using Wayland or GBM to avoid +surprises and make sure all keys work. Default rules are set to +'xorg' in x11/libxkbcommon which is problematic. + +--- tools/Linux/kodi.sh.in.orig 2019-01-17 22:53:57 UTC ++++ tools/Linux/kodi.sh.in +@@ -83,6 +83,11 @@ if [ ! -x ${KODI_BINARY} ]; then + exit 2 + fi + ++if [ "${KODI_BINARY##*-}" == "gbm" ] || [ "${KODI_BINARY##*-}" == "wayland" ]; then ++ : ${XKB_DEFAULT_RULES:=evdev} ++ export XKB_DEFAULT_RULES ++fi ++ + APPORT_CORE="/var/crash/$(echo -n ${KODI_BINARY}|tr / _).$(id -u).crash" + + migrate_home() diff --git a/multimedia/kodi-devel/files/patch-xbmc_platform_linux_input_LibInputHandler.cpp b/multimedia/kodi-devel/files/patch-xbmc_platform_linux_input_LibInputHandler.cpp new file mode 100644 index 000000000000..35dc81ffcd5b --- /dev/null +++ b/multimedia/kodi-devel/files/patch-xbmc_platform_linux_input_LibInputHandler.cpp @@ -0,0 +1,14 @@ +epoll_create1() from libepoll-shim always fails with 0 and only +supports EPOLL_CLOEXEC, so let's use that... + +--- xbmc/platform/linux/input/LibInputHandler.cpp.orig 2019-01-17 23:22:57 UTC ++++ xbmc/platform/linux/input/LibInputHandler.cpp +@@ -115,7 +115,7 @@ void CLibInputHandler::Start() + + void CLibInputHandler::Process() + { +- int epollFd = epoll_create1(0); ++ int epollFd = epoll_create1(EPOLL_CLOEXEC); + if (epollFd < 0) + { + CLog::Log(LOGERROR, "CLibInputHandler::%s - failed to create epoll file descriptor: %s", __FUNCTION__, strerror(-errno)); diff --git a/multimedia/kodi-devel/files/patch-xbmc_platform_linux_storage_LinuxStorageProvider.cpp b/multimedia/kodi-devel/files/patch-xbmc_platform_linux_storage_LinuxStorageProvider.cpp deleted file mode 100644 index 69a78c2003e8..000000000000 --- a/multimedia/kodi-devel/files/patch-xbmc_platform_linux_storage_LinuxStorageProvider.cpp +++ /dev/null @@ -1,15 +0,0 @@ -xbmc/platform/linux/storage/LinuxStorageProvider.cpp:73:19: error: use of undeclared identifier 'getenv' - share.strPath = getenv("HOME"); - ^ - ---- xbmc/platform/linux/storage/LinuxStorageProvider.cpp.orig 2018-07-23 03:59:13 UTC -+++ xbmc/platform/linux/storage/LinuxStorageProvider.cpp -@@ -27,6 +27,8 @@ - #endif - #include "PosixMountProvider.h" - -+#include <cstdlib> -+ - IStorageProvider* IStorageProvider::CreateInstance() - { - return new CLinuxStorageProvider(); |