Merge pull request #58400 from minijackson/kodi-wayland

kodi: add Wayland support
This commit is contained in:
worldofpeace 2019-04-14 20:35:47 -04:00 committed by GitHub
commit 5d8f4a1e02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 51 additions and 7 deletions

View File

@ -13,7 +13,7 @@
, libmpeg2, libsamplerate, libmad , libmpeg2, libsamplerate, libmad
, libogg, libvorbis, flac, libxslt , libogg, libvorbis, flac, libxslt
, lzo, libcdio, libmodplug, libass, libbluray , lzo, libcdio, libmodplug, libass, libbluray
, sqlite, mysql, nasm, gnutls, libva, libdrm, wayland , sqlite, mysql, nasm, gnutls, libva, libdrm
, curl, bzip2, zip, unzip, glxinfo, xdpyinfo , curl, bzip2, zip, unzip, glxinfo, xdpyinfo
, libcec, libcec_platform, dcadec, libuuid , libcec, libcec_platform, dcadec, libuuid
, libcrossguid, libmicrohttpd , libcrossguid, libmicrohttpd
@ -28,6 +28,8 @@
, udevSupport ? true, udev ? null , udevSupport ? true, udev ? null
, usbSupport ? false, libusb ? null , usbSupport ? false, libusb ? null
, vdpauSupport ? true, libvdpau ? null , vdpauSupport ? true, libvdpau ? null
, useWayland ? false, wayland ? null, wayland-protocols ? null
, waylandpp ? null, libxkbcommon ? null
}: }:
assert dbusSupport -> dbus != null; assert dbusSupport -> dbus != null;
@ -38,6 +40,7 @@ assert sambaSupport -> samba != null;
assert udevSupport -> udev != null; assert udevSupport -> udev != null;
assert usbSupport -> libusb != null && ! udevSupport; # libusb won't be used if udev is avaliable assert usbSupport -> libusb != null && ! udevSupport; # libusb won't be used if udev is avaliable
assert vdpauSupport -> libvdpau != null; assert vdpauSupport -> libvdpau != null;
assert useWayland -> wayland != null && wayland-protocols != null && waylandpp != null && libxkbcommon != null;
# TODO for Kodi 18.0 # TODO for Kodi 18.0
# - check if dbus support PR has been merged and add dbus as a buildInput # - check if dbus support PR has been merged and add dbus as a buildInput
@ -110,7 +113,7 @@ let
}; };
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
name = "kodi-${kodiVersion}"; name = "kodi-${lib.optionalString useWayland "wayland-"}${kodiVersion}";
src = kodi_src; src = kodi_src;
@ -123,7 +126,7 @@ in stdenv.mkDerivation rec {
libX11 xorgproto libXt libXmu libXext libX11 xorgproto libXt libXmu libXext
libXinerama libXrandr libXtst libXfixes libXinerama libXrandr libXtst libXfixes
alsaLib libGLU_combined glew fontconfig freetype ftgl alsaLib libGLU_combined glew fontconfig freetype ftgl
libjpeg jasper libpng libtiff wayland libjpeg jasper libpng libtiff
libmpeg2 libsamplerate libmad libmpeg2 libsamplerate libmad
libogg libvorbis flac libxslt systemd libogg libvorbis flac libxslt systemd
lzo libcdio libmodplug libass libbluray lzo libcdio libmodplug libass libbluray
@ -144,7 +147,12 @@ in stdenv.mkDerivation rec {
++ lib.optional sambaSupport samba ++ lib.optional sambaSupport samba
++ lib.optional udevSupport udev ++ lib.optional udevSupport udev
++ lib.optional usbSupport libusb ++ lib.optional usbSupport libusb
++ lib.optional vdpauSupport libvdpau; ++ lib.optional vdpauSupport libvdpau
++ lib.optional useWayland [
wayland waylandpp
# Not sure why ".dev" is needed here, but CMake doesn't find libxkbcommon otherwise
libxkbcommon.dev
];
nativeBuildInputs = [ nativeBuildInputs = [
cmake cmake
@ -153,7 +161,7 @@ in stdenv.mkDerivation rec {
which which
pkgconfig gnumake pkgconfig gnumake
autoconf automake libtool # still needed for some components. Check if that is the case with 18.0 autoconf automake libtool # still needed for some components. Check if that is the case with 18.0
]; ] ++ lib.optional useWayland [ wayland-protocols ];
cmakeFlags = [ cmakeFlags = [
"-Dlibdvdcss_URL=${libdvdcss.src}" "-Dlibdvdcss_URL=${libdvdcss.src}"
@ -164,6 +172,9 @@ in stdenv.mkDerivation rec {
"-DENABLE_INTERNAL_CROSSGUID=OFF" "-DENABLE_INTERNAL_CROSSGUID=OFF"
"-DENABLE_OPTICAL=ON" "-DENABLE_OPTICAL=ON"
"-DLIRC_DEVICE=/run/lirc/lircd" "-DLIRC_DEVICE=/run/lirc/lircd"
] ++ lib.optional useWayland [
"-DCORE_PLATFORM_NAME=wayland"
"-DWAYLAND_RENDER_SYSTEM=gl"
]; ];
enableParallelBuilding = true; enableParallelBuilding = true;

View File

@ -1,7 +1,9 @@
{ stdenv, lib, makeWrapper, buildEnv, kodi, plugins }: { stdenv, lib, makeWrapper, buildEnv, kodi, plugins }:
buildEnv { let
name = "kodi-with-plugins-${(builtins.parseDrvName kodi.name).version}"; drvName = builtins.parseDrvName kodi.name;
in buildEnv {
name = "${drvName.name}-with-plugins-${drvName.version}";
paths = [ kodi ] ++ plugins; paths = [ kodi ] ++ plugins;
pathsToLink = [ "/share" ]; pathsToLink = [ "/share" ];

View File

@ -0,0 +1,23 @@
{ stdenv, fetchFromGitHub, cmake, pkgconfig, pugixml, wayland, libGL }:
stdenv.mkDerivation rec {
pname = "waylandpp";
version = "0.2.5";
src = fetchFromGitHub {
owner = "NilsBrause";
repo = pname;
rev = version;
sha256 = "16h57hzd688664qcyznzhjp3hxipdkzgv46x82yhkww24av8b55n";
};
nativeBuildInputs = [ cmake pkgconfig ];
buildInputs = [ pugixml wayland libGL ];
meta = with stdenv.lib; {
description = "Wayland C++ binding";
homepage = https://github.com/NilsBrause/waylandpp/;
license = with licenses; [ bsd2 hpnd ];
maintainers = with maintainers; [ minijackson ];
};
}

View File

@ -13264,6 +13264,8 @@ in
wayland-protocols = callPackage ../development/libraries/wayland/protocols.nix { }; wayland-protocols = callPackage ../development/libraries/wayland/protocols.nix { };
waylandpp = callPackage ../development/libraries/waylandpp { };
wcslib = callPackage ../development/libraries/wcslib { }; wcslib = callPackage ../development/libraries/wcslib { };
webkitgtk = callPackage ../development/libraries/webkitgtk { webkitgtk = callPackage ../development/libraries/webkitgtk {
@ -20524,12 +20526,18 @@ in
kodiPlain = callPackage ../applications/video/kodi { }; kodiPlain = callPackage ../applications/video/kodi { };
kodiPlainWayland = callPackage ../applications/video/kodi { useWayland = true; };
kodiPlugins = recurseIntoAttrs (callPackage ../applications/video/kodi/plugins.nix {}); kodiPlugins = recurseIntoAttrs (callPackage ../applications/video/kodi/plugins.nix {});
kodi = wrapKodi { kodi = wrapKodi {
kodi = kodiPlain; kodi = kodiPlain;
}; };
kodi-wayland = wrapKodi {
kodi = kodiPlainWayland;
};
kodi-cli = callPackage ../tools/misc/kodi-cli { }; kodi-cli = callPackage ../tools/misc/kodi-cli { };
kodi-retroarch-advanced-launchers = kodi-retroarch-advanced-launchers =