forked from mirrors/nixpkgs
Merge pull request #46196 from oxij/pkgs/kodi-with-plugins
kodi: implement `kodiWithPlugins`, add more plugins
This commit is contained in:
commit
d2ab091dd3
|
@ -1,83 +0,0 @@
|
|||
{ stdenv, fetchFromGitHub
|
||||
, cmake, kodiPlain, libcec_platform, tinyxml }:
|
||||
|
||||
rec {
|
||||
|
||||
pluginDir = "/share/kodi/addons";
|
||||
|
||||
kodi-platform = stdenv.mkDerivation rec {
|
||||
project = "kodi-platform";
|
||||
version = "17.1";
|
||||
name = "${project}-${version}";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "xbmc";
|
||||
repo = project;
|
||||
rev = "c8188d82678fec6b784597db69a68e74ff4986b5";
|
||||
sha256 = "1r3gs3c6zczmm66qcxh9mr306clwb3p7ykzb70r3jv5jqggiz199";
|
||||
};
|
||||
|
||||
buildInputs = [ cmake kodiPlain libcec_platform tinyxml ];
|
||||
|
||||
};
|
||||
|
||||
mkKodiAPIPlugin = { plugin, namespace, version, src, meta, sourceDir ? null, ... }:
|
||||
stdenv.lib.makeOverridable stdenv.mkDerivation rec {
|
||||
|
||||
inherit src meta sourceDir;
|
||||
|
||||
name = "kodi-plugin-${plugin}-${version}";
|
||||
|
||||
passthru = {
|
||||
kodiPlugin = pluginDir;
|
||||
namespace = namespace;
|
||||
};
|
||||
|
||||
dontStrip = true;
|
||||
|
||||
installPhase = ''
|
||||
${if isNull sourceDir then "" else "cd $src/$sourceDir"}
|
||||
d=$out${pluginDir}/${namespace}
|
||||
mkdir -p $d
|
||||
sauce="."
|
||||
[ -d ${namespace} ] && sauce=${namespace}
|
||||
cp -R "$sauce/"* $d
|
||||
'';
|
||||
|
||||
};
|
||||
|
||||
mkKodiPlugin = mkKodiAPIPlugin;
|
||||
|
||||
mkKodiABIPlugin = { plugin, namespace, version, src, meta
|
||||
, extraBuildInputs ? [], sourceDir ? null, ... }:
|
||||
stdenv.lib.makeOverridable stdenv.mkDerivation rec {
|
||||
|
||||
inherit src meta sourceDir;
|
||||
|
||||
name = "kodi-plugin-${plugin}-${version}";
|
||||
|
||||
passthru = {
|
||||
kodiPlugin = pluginDir;
|
||||
namespace = namespace;
|
||||
};
|
||||
|
||||
dontStrip = true;
|
||||
|
||||
buildInputs = [ cmake kodiPlain kodi-platform libcec_platform ]
|
||||
++ extraBuildInputs;
|
||||
|
||||
# disables check ensuring install prefix is that of kodi
|
||||
cmakeFlags = [
|
||||
"-DOVERRIDE_PATHS=1"
|
||||
];
|
||||
|
||||
# kodi checks for plugin .so libs existance in the addon folder (share/...)
|
||||
# and the non-wrapped kodi lib/... folder before even trying to dlopen
|
||||
# them. Symlinking .so, as setting LD_LIBRARY_PATH is of no use
|
||||
installPhase = let n = namespace; in ''
|
||||
make install
|
||||
ln -s $out/lib/addons/${n}/${n}.so.${version} $out/${pluginDir}/${n}/${n}.so.${version}
|
||||
'';
|
||||
|
||||
};
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{ stdenv, lib, fetchFromGitHub, autoconf, automake, libtool, makeWrapper
|
||||
, pkgconfig, cmake, gnumake, yasm, python2
|
||||
, pkgconfig, cmake, gnumake, yasm, python2Packages
|
||||
, libgcrypt, libgpgerror, libunistring
|
||||
, boost, avahi, lame, autoreconfHook
|
||||
, gettext, pcre-cpp, yajl, fribidi, which
|
||||
|
@ -119,7 +119,7 @@ in stdenv.mkDerivation rec {
|
|||
|
||||
buildInputs = [
|
||||
gnutls libidn libtasn1 nasm p11-kit
|
||||
libxml2 yasm python2
|
||||
libxml2 yasm python2Packages.python
|
||||
boost libmicrohttpd
|
||||
gettext pcre-cpp yajl fribidi libva libdrm
|
||||
openssl gperf tinyxml2 taglib libssh swig jre
|
||||
|
@ -187,7 +187,7 @@ in stdenv.mkDerivation rec {
|
|||
postInstall = ''
|
||||
for p in $(ls $out/bin/) ; do
|
||||
wrapProgram $out/bin/$p \
|
||||
--prefix PATH ":" "${lib.makeBinPath [ python2 glxinfo xdpyinfo ]}" \
|
||||
--prefix PATH ":" "${lib.makeBinPath [ python2Packages.python glxinfo xdpyinfo ]}" \
|
||||
--prefix LD_LIBRARY_PATH ":" "${lib.makeLibraryPath
|
||||
([ curl systemd libmad libvdpau libcec libcec_platform rtmpdump libass ] ++ lib.optional nfsSupport libnfs)}"
|
||||
done
|
||||
|
@ -200,6 +200,10 @@ in stdenv.mkDerivation rec {
|
|||
|
||||
installCheckPhase = "$out/bin/kodi --version";
|
||||
|
||||
passthru = {
|
||||
pythonPackages = python2Packages;
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Media center";
|
||||
homepage = https://kodi.tv/;
|
||||
|
|
|
@ -1,9 +1,90 @@
|
|||
{ stdenv, callPackage, fetchurl, fetchFromGitHub, unzip
|
||||
, cmake, kodiPlain, libcec_platform, tinyxml
|
||||
, steam, libusb, pcre-cpp, jsoncpp, libhdhomerun, zlib }:
|
||||
|
||||
with (callPackage ./commons.nix {});
|
||||
with stdenv.lib;
|
||||
|
||||
rec {
|
||||
let self = rec {
|
||||
|
||||
pluginDir = "/share/kodi/addons";
|
||||
|
||||
kodi = kodiPlain;
|
||||
|
||||
# Convert derivation to a kodi module. Stolen from ../../../top-level/python-packages.nix
|
||||
toKodiPlugin = drv: drv.overrideAttrs(oldAttrs: {
|
||||
# Use passthru in order to prevent rebuilds when possible.
|
||||
passthru = (oldAttrs.passthru or {})// {
|
||||
kodiPluginFor = kodi;
|
||||
requiredKodiPlugins = requiredKodiPlugins drv.propagatedBuildInputs;
|
||||
};
|
||||
});
|
||||
|
||||
# Check whether a derivation provides a Kodi plugin.
|
||||
hasKodiPlugin = drv: drv ? kodiPluginFor && drv.kodiPluginFor == kodi;
|
||||
|
||||
# Get list of required Kodi plugins given a list of derivations.
|
||||
requiredKodiPlugins = drvs: let
|
||||
modules = filter hasKodiPlugin drvs;
|
||||
in unique (modules ++ concatLists (catAttrs "requiredKodiPlugins" modules));
|
||||
|
||||
kodiWithPlugins = func: callPackage ./wrapper.nix {
|
||||
inherit kodi;
|
||||
plugins = requiredKodiPlugins (func self);
|
||||
};
|
||||
|
||||
kodi-platform = stdenv.mkDerivation rec {
|
||||
project = "kodi-platform";
|
||||
version = "17.1";
|
||||
name = "${project}-${version}";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "xbmc";
|
||||
repo = project;
|
||||
rev = "c8188d82678fec6b784597db69a68e74ff4986b5";
|
||||
sha256 = "1r3gs3c6zczmm66qcxh9mr306clwb3p7ykzb70r3jv5jqggiz199";
|
||||
};
|
||||
|
||||
buildInputs = [ cmake kodiPlain libcec_platform tinyxml ];
|
||||
};
|
||||
|
||||
mkKodiPlugin = { plugin, namespace, version, sourceDir ? null, ... }@args:
|
||||
toKodiPlugin (stdenv.mkDerivation (rec {
|
||||
name = "kodi-plugin-${plugin}-${version}";
|
||||
|
||||
dontStrip = true;
|
||||
|
||||
installPhase = ''
|
||||
${if isNull sourceDir then "" else "cd $src/$sourceDir"}
|
||||
d=$out${pluginDir}/${namespace}
|
||||
mkdir -p $d
|
||||
sauce="."
|
||||
[ -d ${namespace} ] && sauce=${namespace}
|
||||
cp -R "$sauce/"* $d
|
||||
'';
|
||||
} // args));
|
||||
|
||||
mkKodiABIPlugin = { plugin, namespace, version, extraBuildInputs ? [], ... }@args:
|
||||
toKodiPlugin (stdenv.mkDerivation (rec {
|
||||
name = "kodi-plugin-${plugin}-${version}";
|
||||
|
||||
dontStrip = true;
|
||||
|
||||
buildInputs = [ cmake kodiPlain kodi-platform libcec_platform ]
|
||||
++ extraBuildInputs;
|
||||
|
||||
# disables check ensuring install prefix is that of kodi
|
||||
cmakeFlags = [
|
||||
"-DOVERRIDE_PATHS=1"
|
||||
];
|
||||
|
||||
# kodi checks for plugin .so libs existance in the addon folder (share/...)
|
||||
# and the non-wrapped kodi lib/... folder before even trying to dlopen
|
||||
# them. Symlinking .so, as setting LD_LIBRARY_PATH is of no use
|
||||
installPhase = let n = namespace; in ''
|
||||
make install
|
||||
ln -s $out/lib/addons/${n}/${n}.so.${version} $out${pluginDir}/${n}/${n}.so.${version}
|
||||
'';
|
||||
} // args));
|
||||
|
||||
advanced-launcher = mkKodiPlugin rec {
|
||||
|
||||
|
@ -18,7 +99,7 @@ rec {
|
|||
sha256 = "142vvgs37asq5m54xqhjzqvgmb0xlirvm0kz6lxaqynp0vvgrkx2";
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = {
|
||||
homepage = https://forum.kodi.tv/showthread.php?tid=85724;
|
||||
description = "A program launcher for Kodi";
|
||||
longDescription = ''
|
||||
|
@ -48,7 +129,7 @@ rec {
|
|||
sha256 = "1sv9z77jj6bam6llcnd9b3dgkbvhwad2m1v541rv3acrackms2z2";
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = {
|
||||
homepage = https://forum.kodi.tv/showthread.php?tid=287826;
|
||||
description = "A program launcher for Kodi";
|
||||
longDescription = ''
|
||||
|
@ -75,7 +156,7 @@ rec {
|
|||
sha256 = "0sbc0w0fwbp7rbmbgb6a1kglhnn5g85hijcbbvf5x6jdq9v3f1qb";
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = {
|
||||
description = "Add support for different gaming controllers.";
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [ edwtjo ];
|
||||
|
@ -99,7 +180,7 @@ rec {
|
|||
// (mkController "ps")
|
||||
// (mkController "snes");
|
||||
|
||||
exodus = (mkKodiPlugin rec {
|
||||
exodus = mkKodiPlugin rec {
|
||||
|
||||
plugin = "exodus";
|
||||
namespace = "plugin.video.exodus";
|
||||
|
@ -110,13 +191,14 @@ rec {
|
|||
sha256 = "1zyay7cinljxmpzngzlrr4pnk2a7z9wwfdcsk6a4p416iglyggdj";
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
buildInputs = [ unzip ];
|
||||
|
||||
meta = {
|
||||
description = "A streaming plugin for Kodi";
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [ edwtjo ];
|
||||
};
|
||||
|
||||
}).override { buildInputs = [ unzip ]; };
|
||||
};
|
||||
|
||||
hyper-launcher = let
|
||||
pname = "hyper-launcher";
|
||||
|
@ -128,7 +210,7 @@ rec {
|
|||
rev = "f958ba93fe85b9c9025b1745d89c2db2e7dd9bf6";
|
||||
sha256 = "1dvff24fbas25k5kvca4ssks9l1g5rfa3hl8lqxczkaqi3pp41j5";
|
||||
};
|
||||
meta = with stdenv.lib; {
|
||||
meta = {
|
||||
homepage = https://forum.kodi.tv/showthread.php?tid=258159;
|
||||
description = "A ROM launcher for Kodi that uses HyperSpin assets.";
|
||||
maintainers = with maintainers; [ edwtjo ];
|
||||
|
@ -159,7 +241,7 @@ rec {
|
|||
sha256 = "18m61v8z9fbh4imvzhh4g9629r9df49g2yk9ycaczirg131dhfbh";
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = {
|
||||
description = "Binary addon for raw joystick input.";
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [ edwtjo ];
|
||||
|
@ -183,7 +265,7 @@ rec {
|
|||
sha256 = "0klk1jpjc243ak306k94mag4b4s17w68v69yb8lzzydszqkaqa7x";
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = {
|
||||
homepage = https://forum.kodi.tv/showthread.php?tid=67110;
|
||||
description = "Watch content from SVT Play";
|
||||
longDescription = ''
|
||||
|
@ -212,7 +294,7 @@ rec {
|
|||
|
||||
extraBuildInputs = [ libusb ];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = {
|
||||
description = "Binary addon for steam controller.";
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [ edwtjo ];
|
||||
|
@ -220,7 +302,7 @@ rec {
|
|||
|
||||
};
|
||||
|
||||
steam-launcher = (mkKodiPlugin rec {
|
||||
steam-launcher = mkKodiPlugin rec {
|
||||
|
||||
plugin = "steam-launcher";
|
||||
namespace = "script.steam.launcher";
|
||||
|
@ -233,7 +315,9 @@ rec {
|
|||
sha256 = "001a7zs3a4jfzj8ylxv2klc33mipmqsd5aqax7q81fbgwdlndvbm";
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
propagatedBuildInputs = [ steam ];
|
||||
|
||||
meta = {
|
||||
homepage = https://forum.kodi.tv/showthread.php?tid=157499;
|
||||
description = "Launch Steam in Big Picture Mode from Kodi";
|
||||
longDescription = ''
|
||||
|
@ -245,8 +329,6 @@ rec {
|
|||
'';
|
||||
maintainers = with maintainers; [ edwtjo ];
|
||||
};
|
||||
}).override {
|
||||
propagatedBuildinputs = [ steam ];
|
||||
};
|
||||
|
||||
pdfreader = mkKodiPlugin rec {
|
||||
|
@ -262,7 +344,7 @@ rec {
|
|||
sha256 = "1iv7d030z3xvlflvp4p5v3riqnwg9g0yvzxszy63v1a6x5kpjkqa";
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = {
|
||||
homepage = https://forum.kodi.tv/showthread.php?tid=187421;
|
||||
description = "A comic book reader";
|
||||
maintainers = with maintainers; [ edwtjo ];
|
||||
|
@ -282,7 +364,7 @@ rec {
|
|||
sha256 = "0pmlgqr4kd0gvckz77mj6v42kcx6lb23anm8jnf2fbn877snnijx";
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = {
|
||||
homepage = https://github.com/kodi-pvr/pvr.hts;
|
||||
description = "Kodi's Tvheadend HTSP client addon";
|
||||
platforms = platforms.all;
|
||||
|
@ -304,7 +386,7 @@ rec {
|
|||
sha256 = "0dvdv0vk2q12nj0i5h51iaypy3i7jfsxjyxwwpxfy82y8260ragy";
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = {
|
||||
homepage = https://github.com/kodi-pvr/pvr.hdhomerun;
|
||||
description = "Kodi's HDHomeRun PVR client addon";
|
||||
platforms = platforms.all;
|
||||
|
@ -328,7 +410,7 @@ rec {
|
|||
sha256 = "1f1im2gachrxnr3z96h5cg2c13vapgkvkdwvrbl4hxlnyp1a6jyz";
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = {
|
||||
homepage = https://github.com/kodi-pvr/pvr.iptvsimple;
|
||||
description = "Kodi's IPTV Simple client addon";
|
||||
platforms = platforms.all;
|
||||
|
@ -352,7 +434,7 @@ rec {
|
|||
sha256 = "1b3fm02annsq58pcfc985glrmh21rmqksdj3q8wn6gyza06jdf3v";
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = {
|
||||
homepage = https://github.com/osmc/skin.osmc;
|
||||
description = "The default skin for OSMC";
|
||||
platforms = platforms.all;
|
||||
|
@ -360,4 +442,5 @@ rec {
|
|||
license = licenses.cc-by-nc-sa-30;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
}; in self
|
||||
|
|
|
@ -1,54 +1,25 @@
|
|||
{ stdenv, lib, makeWrapper, kodi, plugins }:
|
||||
{ stdenv, lib, makeWrapper, buildEnv, kodi, plugins }:
|
||||
|
||||
let
|
||||
buildEnv {
|
||||
name = "kodi-with-plugins-${(builtins.parseDrvName kodi.name).version}";
|
||||
|
||||
p = builtins.parseDrvName kodi.name;
|
||||
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
|
||||
name = "kodi-" + p.version;
|
||||
version = p.version;
|
||||
paths = [ kodi ] ++ plugins;
|
||||
pathsToLink = [ "/share" ];
|
||||
|
||||
buildInputs = [ makeWrapper ];
|
||||
|
||||
buildCommand = ''
|
||||
mkdir -p $out/share/kodi/addons
|
||||
${stdenv.lib.concatMapStrings
|
||||
(plugin: "ln -s ${plugin.out
|
||||
+ plugin.kodiPlugin
|
||||
+ "/" + plugin.namespace
|
||||
} $out/share/kodi/addons/.;") plugins}
|
||||
$(for plugin in ${kodi}/share/kodi/addons/*
|
||||
postBuild = ''
|
||||
mkdir $out/bin
|
||||
for exe in kodi{,-standalone}
|
||||
do
|
||||
$(ln -s $plugin/ $out/share/kodi/addons/.)
|
||||
done)
|
||||
$(for share in ${kodi}/share/kodi/*
|
||||
do
|
||||
$(ln -s $share $out/share/kodi/.)
|
||||
done)
|
||||
$(for passthrough in icons xsessions applications
|
||||
do
|
||||
ln -s ${kodi}/share/$passthrough $out/share/
|
||||
done)
|
||||
$(for exe in kodi{,-standalone}
|
||||
do
|
||||
makeWrapper ${kodi}/bin/$exe $out/bin/$exe \
|
||||
--prefix KODI_HOME : $out/share/kodi;
|
||||
done)
|
||||
makeWrapper ${kodi}/bin/$exe $out/bin/$exe \
|
||||
--prefix PYTHONPATH : ${kodi.pythonPackages.makePythonPath plugins} \
|
||||
--prefix KODI_HOME : $out/share/kodi
|
||||
done
|
||||
'';
|
||||
|
||||
preferLocalBuild = true;
|
||||
|
||||
meta = with kodi.meta; {
|
||||
inherit license homepage;
|
||||
description = description
|
||||
+ " (with plugins: "
|
||||
+ lib.concatStrings (lib.intersperse ", " (map (x: ""+x.name) plugins))
|
||||
+ ")";
|
||||
|
||||
platforms = stdenv.lib.platforms.linux;
|
||||
meta = kodi.meta // {
|
||||
description = kodi.meta.description
|
||||
+ " (with plugins: ${lib.concatMapStringsSep ", " (x: x.name) plugins})";
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue