diff options
author | Jan Malakhovski <oxij@oxij.org> | 2018-09-06 19:40:21 +0000 |
---|---|---|
committer | Jan Malakhovski <oxij@oxij.org> | 2018-09-06 19:55:55 +0000 |
commit | e883b86c0e894328eb7cb88f287c1c52047d51f1 (patch) | |
tree | 9fad47745948758a1d24f177bf9544186b4b7749 | |
parent | 1d64f70bd75277bd5a69bc9f89c06ece24ed0877 (diff) | |
download | nixlib-e883b86c0e894328eb7cb88f287c1c52047d51f1.tar nixlib-e883b86c0e894328eb7cb88f287c1c52047d51f1.tar.gz nixlib-e883b86c0e894328eb7cb88f287c1c52047d51f1.tar.bz2 nixlib-e883b86c0e894328eb7cb88f287c1c52047d51f1.tar.lz nixlib-e883b86c0e894328eb7cb88f287c1c52047d51f1.tar.xz nixlib-e883b86c0e894328eb7cb88f287c1c52047d51f1.tar.zst nixlib-e883b86c0e894328eb7cb88f287c1c52047d51f1.zip |
kodiPlugins: inline commons.nix
-rw-r--r-- | pkgs/applications/video/kodi/commons.nix | 83 | ||||
-rw-r--r-- | pkgs/applications/video/kodi/plugins.nix | 78 |
2 files changed, 76 insertions, 85 deletions
diff --git a/pkgs/applications/video/kodi/commons.nix b/pkgs/applications/video/kodi/commons.nix deleted file mode 100644 index eff9b7871069..000000000000 --- a/pkgs/applications/video/kodi/commons.nix +++ /dev/null @@ -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} - ''; - - }; -} diff --git a/pkgs/applications/video/kodi/plugins.nix b/pkgs/applications/video/kodi/plugins.nix index 2ba23e72a2ed..e2e4dd28f8f5 100644 --- a/pkgs/applications/video/kodi/plugins.nix +++ b/pkgs/applications/video/kodi/plugins.nix @@ -1,10 +1,84 @@ { stdenv, callPackage, fetchurl, fetchFromGitHub, unzip +, cmake, kodiPlain, libcec_platform, tinyxml , steam, libusb, pcre-cpp, jsoncpp, libhdhomerun, zlib }: -with (callPackage ./commons.nix {}); - 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 ]; + }; + + mkKodiPlugin = { 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 + ''; + + }; + + 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} + ''; + + }; + advanced-launcher = mkKodiPlugin rec { plugin = "advanced-launcher"; |