2015-10-21, 02:50
Hi
I wanted to ask some questions about add-on packaging in Kodi, particularly with the strict delineation between Kodi as a core application and the addons (binary) that ship with it.
With language files, we (OSMC) like to ship them in advance. I know that Kodi can dynamically download them on demand, but we would like to provide proper internationalisation without depending on an active network connection. I could not find a way of downloading these files easily from mirrors.kodi.tv. Can a symlink to languagename-latest.zip be provided? Or better yet, languagename-KODIVERSION.zip (where KODIVERSION is Isengard / Jarvis, etc?) At the moment I have this hacky way of pulling language files from a Kodi mirror that supports Apache based directory listing:
mirrors.kodi.tv does not always correctly resolve, and does not always return mirrors that use the same directory listing format. As a result, we found a good mirror (Leaseweb) and pinned it at that. But we wish there was a simpler solution.. The reason for 'scraping', is that I don't wish to maintain a list of language versions and a list of all languages.
Another enquiry I have is about binary addons when Kodi is mid release cycle. For example, OSMC is now about to support Apple TV. There was an issue with audiodecoder.lame on i686. This was fixed upstream in Kodi's binary addons repository. I took to patching the addon reference in Isengard tree, but I quickly realised that although this was fixed, another commit, presumably for Jarvis was introduced. 'addon.xml' had been renamed to 'addon.xml.in'. audiodecoder.lame is not branched, so I had to fork it, and revert this commit: https://github.com/samnazarko/audioencod...e037997d75. So my question is: how should we handle these addons post-Kodi release? I see that *some* addons are branched to Isengard and master, and some are not. Are there plans to unify this? We can work on this downstream if we must -- is there a nice way to apply a patch post-download to the source? Not too familiar with the new cmake depends system.
My final question: why are Git URLs used in the addon's depends file? This means a git clone is used for each addon. This can fail under QEMU environments (pthreads...). I fix this with:
And we call it for each addon. But I am more curious as to why a clone is used versus the downloading of a tarball. I am not sure of your cloning parameters (depth for example), but bandwidth can be saved with a ZIP. Would you accept a PR to use ZIPs instead? ZIPs via GitHub allow the same parameters you currently use -- namely, specifying a git revision.
Thanks,
Sam
I wanted to ask some questions about add-on packaging in Kodi, particularly with the strict delineation between Kodi as a core application and the addons (binary) that ship with it.
With language files, we (OSMC) like to ship them in advance. I know that Kodi can dynamically download them on demand, but we would like to provide proper internationalisation without depending on an active network connection. I could not find a way of downloading these files easily from mirrors.kodi.tv. Can a symlink to languagename-latest.zip be provided? Or better yet, languagename-KODIVERSION.zip (where KODIVERSION is Isengard / Jarvis, etc?) At the moment I have this hacky way of pulling language files from a Kodi mirror that supports Apache based directory listing:
Code:
languages=$(wget ${base_url} -O- | grep resource.language. | sed -e 's/<a/\n<a/g' | sed -e 's/<a .*href=['"'"'"]//' -e 's/["'"'"'].*$//' -e '/^$/ d' | sed '/tr/d' | sed 's/resource.language.//' | tr -d /)
if [ $? != 0 ]; then echo "Can't get list of languages" && exit 1; fi
for language in ${languages}
do
echo "Downloading language file for ${language}"
language_file=$(wget ${base_url}/resource.language.${language} -O- | grep -o '<a .*href=.*>' | sed -e 's/<a/\n<a/g' | sed -e 's/<a .*href=['"'"'"]//' -e 's/["'"'"'].*$//' -e '/^$/ d' | tail -n 1)
if [ $? != 0 ]; then echo "Can't determine language file" && exit 1; fi
wget ${base_url}/resource.language.${language}/${language_file}
if [ $? != 0 ]; then echo "Couldn't download language file ${language_file}" && exit 1; fi
unzip ${language_file}
rm ${language_file}
done
mirrors.kodi.tv does not always correctly resolve, and does not always return mirrors that use the same directory listing format. As a result, we found a good mirror (Leaseweb) and pinned it at that. But we wish there was a simpler solution.. The reason for 'scraping', is that I don't wish to maintain a list of language versions and a list of all languages.
Another enquiry I have is about binary addons when Kodi is mid release cycle. For example, OSMC is now about to support Apple TV. There was an issue with audiodecoder.lame on i686. This was fixed upstream in Kodi's binary addons repository. I took to patching the addon reference in Isengard tree, but I quickly realised that although this was fixed, another commit, presumably for Jarvis was introduced. 'addon.xml' had been renamed to 'addon.xml.in'. audiodecoder.lame is not branched, so I had to fork it, and revert this commit: https://github.com/samnazarko/audioencod...e037997d75. So my question is: how should we handle these addons post-Kodi release? I see that *some* addons are branched to Isengard and master, and some are not. Are there plans to unify this? We can work on this downstream if we must -- is there a nice way to apply a patch post-download to the source? Not too familiar with the new cmake depends system.
My final question: why are Git URLs used in the addon's depends file? This means a git clone is used for each addon. This can fail under QEMU environments (pthreads...). I fix this with:
Code:
git_to_archive()
{
file_contents=$(cat $1)
if grep -q github.com $1
then
PKG_NAME=$(echo $file_contents | cut -f 1 -d " ")
GIT_REPO=$(echo $file_contents | cut -f 2 -d " ")
GIT_REV=$(echo $file_contents | cut -f 3 -d " ")
GIT_URL=$(echo ${GIT_REPO}/archive/${GIT_REV}.zip)
echo "${PKG_NAME} ${GIT_URL}" > $1
fi
}
And we call it for each addon. But I am more curious as to why a clone is used versus the downloading of a tarball. I am not sure of your cloning parameters (depth for example), but bandwidth can be saved with a ZIP. Would you accept a PR to use ZIPs instead? ZIPs via GitHub allow the same parameters you currently use -- namely, specifying a git revision.
Thanks,
Sam