1 { stdenv, toKodiAddon, addonDir, cmake, kodi, kodi-platform, libcec_platform }:
2 { name ? "${attrs.pname}-${attrs.version}"
5 , extraNativeBuildInputs ? []
6 , extraBuildInputs ? []
7 , extraRuntimeDependencies ? []
9 , extraInstallPhase ? "", ... } @ attrs:
10 toKodiAddon (stdenv.mkDerivation ({
11 name = "kodi-" + name;
15 nativeBuildInputs = [ cmake ] ++ extraNativeBuildInputs;
16 buildInputs = [ kodi kodi-platform libcec_platform ] ++ extraBuildInputs;
18 inherit extraRuntimeDependencies;
20 # disables check ensuring install prefix is that of kodi
25 # kodi checks for addon .so libs existance in the addon folder (share/...)
26 # and the non-wrapped kodi lib/... folder before even trying to dlopen
27 # them. Symlinking .so, as setting LD_LIBRARY_PATH is of no use
28 installPhase = let n = namespace; in ''
33 [[ -f $out/lib/addons/${n}/${n}.so ]] && ln -s $out/lib/addons/${n}/${n}.so $out${addonDir}/${n}/${n}.so || true
34 [[ -f $out/lib/addons/${n}/${n}.so.${version} ]] && ln -s $out/lib/addons/${n}/${n}.so.${version} $out${addonDir}/${n}/${n}.so.${version} || true