Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Jan 2018 09:06:36 +0000 (UTC)
From:      Tobias Kortkamp <tobik@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r458517 - in head/multimedia/kodi-devel: . files
Message-ID:  <201801090906.w0996a17097293@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tobik
Date: Tue Jan  9 09:06:36 2018
New Revision: 458517
URL: https://svnweb.freebsd.org/changeset/ports/458517

Log:
  multimedia/kodi-devel: Add support for different platforms
  
  - Allow build on armv6 and armv7
  - Add options to build Kodi with Wayland, Xorg, GBM, and Raspberry Pi
    support
  - The WAYLAND option remains broken until it is also enabled by default
    in graphics/mesa-libs
  - Raspberry Pi support is very unstable and should be considered
    experimental at best

Added:
  head/multimedia/kodi-devel/files/patch-evdev   (contents, props changed)
  head/multimedia/kodi-devel/files/patch-rbpi   (contents, props changed)
  head/multimedia/kodi-devel/files/patch-wayland   (contents, props changed)
Modified:
  head/multimedia/kodi-devel/Makefile
  head/multimedia/kodi-devel/pkg-plist

Modified: head/multimedia/kodi-devel/Makefile
==============================================================================
--- head/multimedia/kodi-devel/Makefile	Tue Jan  9 09:00:50 2018	(r458516)
+++ head/multimedia/kodi-devel/Makefile	Tue Jan  9 09:06:36 2018	(r458517)
@@ -13,7 +13,7 @@ LICENSE=	GPLv2
 LICENSE_FILE=	${WRKSRC}/LICENSE.GPL
 
 BROKEN_FreeBSD_10=	does not build
-ONLY_FOR_ARCHS=	amd64 i386
+ONLY_FOR_ARCHS=	amd64 armv6 armv7 i386
 
 BUILD_DEPENDS=	rapidjson>=0:devel/rapidjson \
 		swig3.0:devel/swig30
@@ -25,7 +25,6 @@ LIB_DEPENDS=	libass.so:multimedia/libass \
 		libcdio.so:sysutils/libcdio \
 		libcrossguid.so:devel/libcrossguid \
 		libcurl.so:ftp/curl \
-		libdrm.so:graphics/libdrm \
 		libdvdnav.so:multimedia/libdvdnav \
 		libdvdread.so:multimedia/libdvdread \
 		libexpat.so:textproc/expat2 \
@@ -56,16 +55,13 @@ GH_ACCOUNT=	xbmc
 GH_PROJECT=	xbmc
 GH_TAGNAME=	bff1759626cb44be4a3f6dc0d6ebb5fe43a55a96
 USE_GNOME=	libxslt libxml2
-USE_GL=		egl gl glu
 USE_JAVA=	yes
 JAVA_BUILD=	yes
 USE_LDCONFIG=	yes
-USE_XORG=	x11 xext xrandr
 
 CONFLICTS_INSTALL=	kodi-[0-9]*
 
-CMAKE_ARGS=	-DCORE_PLATFORM_NAME=X11 \
-		-DLIBDVD_INCLUDE_DIRS="${LOCALBASE}/include" \
+CMAKE_ARGS=	-DLIBDVD_INCLUDE_DIRS="${LOCALBASE}/include" \
 		-DDVDREAD_LIBRARY="${LOCALBASE}/lib/libdvdread.so" \
 		-DDVDNAV_LIBRARY="${LOCALBASE}/lib/libdvdnav.so"
 CMAKE_OFF=	ENABLE_ALSA \
@@ -81,9 +77,18 @@ PLIST_SUB=	ARCH=${KODIARCH_${ARCH}} OPSYS=${OPSYS:tl}
 
 OPTIONS_DEFINE=	AVAHI CEC DBUS LIBBLURAY MYSQL NFS SMB SSH UPNP VAAPI	\
 		VDPAU WEBSERVER
-OPTIONS_DEFAULT=	SNDIO SSH UPNP VAAPI VDPAU WEBSERVER
+OPTIONS_DEFAULT=	SNDIO SSH UPNP VAAPI VDPAU WEBSERVER X11
+OPTIONS_SINGLE=	PLATFORM
+OPTIONS_SINGLE_PLATFORM=	GBM RPI WAYLAND X11
+OPTIONS_EXCLUDE_amd64=	RPI
+OPTIONS_EXCLUDE_i386=	RPI
 OPTIONS_SUB=	yes
 
+GBM_DESC=	GBM support (requires a kernel with evdev support)
+PLATFORM_DESC=	Platform
+RPI_DESC=	Raspberry Pi support
+WAYLAND_DESC=	Wayland support (broken)
+
 # Choosing one of SNDIO or PULSEAUDIO is mandatory right now if you
 # want audio output.  The OSS backend is currently not hooked into
 # Kodi's audio sink factory due to recent refactorings.
@@ -101,6 +106,8 @@ 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"
+
 LIBBLURAY_LIB_DEPENDS=	libbluray.so:multimedia/libbluray
 LIBBLURAY_CMAKE_BOOL=	ENABLE_BLURAY
 
@@ -113,6 +120,15 @@ NFS_CMAKE_BOOL=		ENABLE_NFS
 PULSEAUDIO_LIB_DEPENDS=	libpulse.so:audio/pulseaudio
 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"
+RPI_LIB_DEPENDS=	libbrcmEGL.so:misc/raspberrypi-userland
+RPI_LIB_DEPENDS_OFF=	libdrm.so:graphics/libdrm
+RPI_PREVENTS=		VAAPI VDPAU
+RPI_USE_OFF=		GL=egl,gl,glu
+
 SMB_USES=		samba:lib
 SMB_CMAKE_BOOL=		ENABLE_SMBCLIENT
 
@@ -138,15 +154,27 @@ VAAPI_CMAKE_BOOL=	ENABLE_VAAPI
 VDPAU_LIB_DEPENDS=	libvdpau.so:multimedia/libvdpau
 VDPAU_CMAKE_BOOL=	ENABLE_VDPAU
 
+WAYLAND_BROKEN=	Requires default WAYLAND in graphics/mesa-libs and missing graphics/waylandpp port
+WAYLAND_BUILD_DEPENDS=	wayland-protocols>=0:graphics/wayland-/protocols
+WAYLAND_LIB_DEPENDS=	libwayland-client++.so:graphics/waylandpp \
+			libxkbcommon.so:x11/libxkbcommon
+
 WEBSERVER_LIB_DEPENDS=	libmicrohttpd.so:www/libmicrohttpd
 WEBSERVER_CMAKE_BOOL=	ENABLE_MICROHTTPD
 
+X11_CMAKE_ON=		-DCORE_PLATFORM_NAME:STRING="x11"
+X11_USE=		XORG=x11,xext,xrandr
+
 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
 # (see CMAKE_ARGS).
 	@${REINPLACE_CMD} 's@KODI_DEPENDSBUILD@true@' \
 		${WRKSRC}/cmake/modules/FindLibDvd.cmake
+	@${CP} ${WRKSRC}/cmake/platform/linux/gbm.cmake \
+		${WRKSRC}/cmake/platform/linux/rbpi.cmake \
+		${WRKSRC}/cmake/platform/linux/wayland.cmake \
+		${WRKSRC}/cmake/platform/freebsd
 
 post-install:
 	${INSTALL_MAN} ${WRKSRC}/docs/manpages/kodi.bin.1 ${STAGEDIR}${MAN1PREFIX}/man/man1

Added: head/multimedia/kodi-devel/files/patch-evdev
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/kodi-devel/files/patch-evdev	Tue Jan  9 09:06:36 2018	(r458517)
@@ -0,0 +1,111 @@
+--- xbmc/platform/linux/input/LinuxInputDevices.cpp.orig	2017-12-17 12:10:14 UTC
++++ xbmc/platform/linux/input/LinuxInputDevices.cpp
+@@ -30,6 +30,9 @@
+ #include "system.h"
+ #if defined(HAS_LINUX_EVENTS)
+ 
++#ifdef TARGET_FREEBSD
++#include <dev/evdev/input.h>
++#else
+ #include <linux/version.h>
+ 
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+@@ -38,6 +41,7 @@ typedef unsigned long kernel_ulong_t;
+ #endif
+ 
+ #include <linux/input.h>
++#endif
+ 
+ #if defined(HAVE_LIBUDEV)
+ #include <libudev.h>
+@@ -77,8 +81,10 @@ typedef unsigned long kernel_ulong_t;
+ #define XBMC_BUTTON_WHEELDOWN 5
+ #endif
+ 
++#ifndef TARGET_FREEBSD
+ #include <linux/keyboard.h>
+ #include <linux/kd.h>
++#endif
+ 
+ #include <string.h>
+ #include <unistd.h>
+@@ -352,6 +358,7 @@ XBMCKey CLinuxInputDevice::TranslateKey(unsigned short
+ 
+ int CLinuxInputDevice::KeyboardGetSymbol(unsigned short value)
+ {
++#ifndef TARGET_FREEBSD
+   unsigned char type = KTYP(value);
+   unsigned char index = KVAL(value);
+ 
+@@ -409,12 +416,16 @@ int CLinuxInputDevice::KeyboardGetSymbol(unsigned shor
+     break;
+ */
+   }
+-
++#else
+   return XBMCK_UNKNOWN;
++#endif
+ }
+ 
+ unsigned short CLinuxInputDevice::KeyboardReadValue(unsigned char table, unsigned char index)
+ {
++#ifdef TARGET_FREEBSD
++  return 0;
++#else
+   struct kbentry entry;
+ 
+   entry.kb_table = table;
+@@ -429,6 +440,7 @@ unsigned short CLinuxInputDevice::KeyboardReadValue(un
+   }
+ 
+   return entry.kb_value;
++#endif
+ }
+ 
+ XBMCMod CLinuxInputDevice::UpdateModifiers(XBMC_Event& devt)
+@@ -1371,6 +1383,9 @@ driver_open_device_error:
+  */
+ bool CLinuxInputDevice::GetKeymapEntry(KeymapEntry& entry)
+ {
++#ifdef TARGET_FREEBSD
++  return false;
++#else
+   int code = entry.code;
+   unsigned short value;
+   //DFBInputDeviceKeyIdentifier identifier;
+@@ -1421,6 +1436,7 @@ bool CLinuxInputDevice::GetKeymapEntry(KeymapEntry& en
+   entry.altShift = value; //KeyboardGetSymbol(code, value, LI_KEYLEVEL_ALT_SHIFT);
+ 
+   return true;
++#endif
+ }
+ 
+ /*
+--- xbmc/windowing/wayland/InputProcessorPointer.cpp.orig	2017-12-17 12:10:14 UTC
++++ xbmc/windowing/wayland/InputProcessorPointer.cpp
+@@ -22,7 +22,11 @@
+ 
+ #include <cmath>
+ 
++#ifdef TARGET_FREEBSD
++#include <dev/evdev/input-event-codes.h>
++#else
+ #include <linux/input-event-codes.h>
++#endif
+ 
+ #include "input/MouseStat.h"
+ 
+--- xbmc/windowing/wayland/WindowDecorator.cpp.orig	2017-12-17 12:10:14 UTC
++++ xbmc/windowing/wayland/WindowDecorator.cpp
+@@ -25,7 +25,11 @@
+ #include <cmath>
+ #include <vector>
+ 
++#ifdef TARGET_FREEBSD
++#include <dev/evdev/input-event-codes.h>
++#else
+ #include <linux/input-event-codes.h>
++#endif
+ 
+ #include "threads/SingleLock.h"
+ #include "utils/EndianSwap.h"

Added: head/multimedia/kodi-devel/files/patch-rbpi
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/kodi-devel/files/patch-rbpi	Tue Jan  9 09:06:36 2018	(r458517)
@@ -0,0 +1,102 @@
+--- cmake/scripts/freebsd/ArchSetup.cmake.orig	2017-12-17 12:10:14 UTC
++++ cmake/scripts/freebsd/ArchSetup.cmake
+@@ -1,4 +1,7 @@
+ set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_FREEBSD)
++if(CORE_PLATFORM_NAME_LC STREQUAL rbpi)
++  list(APPEND ARCH_DEFINES -D_ARMEL -DTARGET_RASPBERRY_PI)
++endif()
+ set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_LARGEFILE64_SOURCE
+                    -D_FILE_OFFSET_BITS=64)
+ set(PLATFORM_DIR platform/linux)
+@@ -10,6 +13,15 @@ else()
+     set(ARCH x86_64-freebsd)
+   elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i.86")
+     set(ARCH x86-freebsd)
++  elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL armv6)
++    set(ARCH armv6-freebsd)
++    set(NEON True)
++  elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL armv7)
++    set(ARCH armv7-freebsd)
++    set(NEON True)
++  elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64)
++    set(ARCH aarch64-freebsd)
++    set(NEON True)
+   else()
+     message(WARNING "unknown CPU: ${CPU}")
+   endif()
+--- cmake/treedata/freebsd/subdirs.txt.orig	2018-01-05 00:21:32 UTC
++++ cmake/treedata/freebsd/subdirs.txt
+@@ -9,4 +9,6 @@ xbmc/storage/linux         storage/linux
+ xbmc/filesystem/posix      filesystem/posix
+ xbmc/utils/posix           utils_posix
+ xbmc/platform/posix        posix
++xbmc/cores/RetroPlayer/process/rbpi cores/RetroPlayer/process/rbpi
++xbmc/cores/VideoPlayer/Process/rbpi cores/VideoPlayer/Process/rbpi
+ xbmc/freebsd               freebsdsupport
+--- xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h.orig	2018-01-04 22:35:33 UTC
++++ xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h
+@@ -31,6 +31,7 @@
+ #include "cores/VideoSettings.h"
+ #include "cores/VideoPlayer/DVDStreamInfo.h"
+ #include "guilib/Geometry.h"
++#include "platform/linux/RBP.h"
+ #include "threads/Thread.h"
+ 
+ // worst case number of buffers. 12 for decoder. 8 for multi-threading in ffmpeg. NUM_BUFFERS for renderer.
+--- xbmc/windowing/rpi/WinSystemRpi.cpp.orig	2018-01-05 07:10:41 UTC
++++ xbmc/windowing/rpi/WinSystemRpi.cpp
+@@ -32,9 +32,16 @@
+ #include "settings/DisplaySettings.h"
+ #include "guilib/DispResource.h"
+ #include "utils/log.h"
++#include "utils/StringUtils.h"
+ #include "../WinEventsLinux.h"
+ #include "cores/AudioEngine/AESinkFactory.h"
+ #include "cores/AudioEngine/Sinks/AESinkPi.h"
++#ifdef HAS_PULSEAUDIO
++#include "cores/AudioEngine/Sinks/AESinkPULSE.h"
++#endif
++#ifdef HAS_SNDIO
++#include "cores/AudioEngine/Sinks/AESinkSNDIO.h"
++#endif
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglplatform.h>
+@@ -54,7 +61,36 @@ CWinSystemRpi::CWinSystemRpi()
+ 
+   m_winEvents.reset(new CWinEventsLinux());
+   AE::CAESinkFactory::ClearSinks();
+-  CAESinkPi::Register();
++
++  std::string envSink;
++  if (getenv("AE_SINK"))
++    envSink = getenv("AE_SINK");
++  if (StringUtils::EqualsNoCase(envSink, "PULSE"))
++  {
++#ifdef HAS_PULSEAUDIO
++    CAESinkPulseaudio::Register();
++#endif
++  }
++  else if (StringUtils::EqualsNoCase(envSink, "SNDIO"))
++  {
++#ifdef HAS_SNDIO
++    CAESinkSNDIO::Register();
++#endif
++  }
++  else if (StringUtils::EqualsNoCase(envSink, "PI"))
++  {
++    CAESinkPi::Register();
++  }
++  else
++  {
++#if defined(HAS_PULSEAUDIO)
++     CAESinkPulseaudio::Register();
++#elif defined(HAS_SNDIO)
++     CAESinkSNDIO::Register();
++#else
++     CAESinkPi::Register();
++#endif
++  }
+ }
+ 
+ CWinSystemRpi::~CWinSystemRpi()

Added: head/multimedia/kodi-devel/files/patch-wayland
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/kodi-devel/files/patch-wayland	Tue Jan  9 09:06:36 2018	(r458517)
@@ -0,0 +1,11 @@
+--- xbmc/windowing/wayland/WinSystemWayland.cpp.orig	2018-01-05 12:46:19 UTC
++++ xbmc/windowing/wayland/WinSystemWayland.cpp
+@@ -1308,7 +1308,7 @@ void CWinSystemWayland::PrepareFramePresentation()
+     };
+     feedback.on_presented() = [this,iter](std::uint32_t tvSecHi, std::uint32_t tvSecLo, std::uint32_t tvNsec, std::uint32_t refresh, std::uint32_t seqHi, std::uint32_t seqLo, wayland::presentation_feedback_kind flags)
+     {
+-      timespec tv = { .tv_sec = static_cast<std::time_t> ((static_cast<std::uint64_t>(tvSecHi) << 32) + tvSecLo), .tv_nsec = tvNsec };
++      timespec tv = { .tv_sec = static_cast<std::time_t> ((static_cast<std::uint64_t>(tvSecHi) << 32) + tvSecLo), .tv_nsec = static_cast<long>(tvNsec) };
+       std::int64_t latency{KODI::LINUX::TimespecDifference(iter->submissionTime, tv)};
+       std::uint64_t msc{(static_cast<std::uint64_t>(seqHi) << 32) + seqLo};
+       m_presentationFeedbackHandlers.Invoke(tv, refresh, m_syncOutputID, m_syncOutputRefreshRate, msc);

Modified: head/multimedia/kodi-devel/pkg-plist
==============================================================================
--- head/multimedia/kodi-devel/pkg-plist	Tue Jan  9 09:00:50 2018	(r458516)
+++ head/multimedia/kodi-devel/pkg-plist	Tue Jan  9 09:06:36 2018	(r458517)
@@ -66,8 +66,11 @@ include/kodi/xbmc_addon_types.h
 include/kodi/xbmc_epg_types.h
 include/kodi/xbmc_pvr_dll.h
 include/kodi/xbmc_pvr_types.h
-lib/kodi/kodi-x11
-lib/kodi/kodi-xrandr
+%%GBM%%lib/kodi/kodi-gbm
+%%RPI%%lib/kodi/kodi-rbpi
+%%WAYLAND%%lib/kodi/kodi-wayland
+%%X11%%lib/kodi/kodi-x11
+%%X11%%lib/kodi/kodi-xrandr
 lib/kodi/system/libcpluff-%%ARCH%%-%%OPSYS%%.so
 lib/kodi/system/players/VideoPlayer/libdvdnav-%%ARCH%%-%%OPSYS%%.so
 man/man1/kodi.1.gz



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801090906.w0996a17097293>