2016-07-17, 10:54
I am currently looking into a relatively young distribution called Void Linux (http://www.voidlinux.eu/) which I intend to use to run kodi on. Since that computer I want to use for that uses a several year old Atom processor, I can only use the i686 version of Void for that. There's no working version of kodi for that architecture in the Void repository yet so I looked into what would be necessary to make kodi work there. One issue (segfault in TexturePacker) was relatively easily solved by disabling static builds of that component.
Now I'm able to build a binary package of kodi however it fails to start when one of the kodi scripts (kodi or kodi-standalone) is called since it fails to find the global userdata directory. I was able to track the issue down to the fact that the configure script is called with --libdir=/usr/lib32. This is technically correct since the libdir is named like that on the i686 architecture in Void. When the resulting binary which resides in /usr/lib32/kodi/kodi.bin is started, it looks for the userdata in /usr/lib/kodi/userdata, fails to find it (it would be in /usr/share/kodi/userdata) and exits.
If I execute the configure script with --libdir=/usr/lib which is possible since that is a symlink to /usr/lib32 but not a proper solution for the issue in my opinion, the resulting binary also looks in /usr/lib/kodi/userdata, fails to find it there, then continues to look in /usr/share/kodi/userdata, finds it and starts up just fine. I looked into the code in xbmc/Util.cpp and xbmc/Application.cpp but could not determine myself what causes the issue.
Of course manually setting the KODI_HOME environment variable and exporting it also leads to the binary finding the proper userdata directory but that's another workaround. If possible, I would rather get to the bottom of the issue and find a fix that leads to the binary finding the correct directory even if it was not compiled with --libdir=/usr/lib.
Now I'm able to build a binary package of kodi however it fails to start when one of the kodi scripts (kodi or kodi-standalone) is called since it fails to find the global userdata directory. I was able to track the issue down to the fact that the configure script is called with --libdir=/usr/lib32. This is technically correct since the libdir is named like that on the i686 architecture in Void. When the resulting binary which resides in /usr/lib32/kodi/kodi.bin is started, it looks for the userdata in /usr/lib/kodi/userdata, fails to find it (it would be in /usr/share/kodi/userdata) and exits.
If I execute the configure script with --libdir=/usr/lib which is possible since that is a symlink to /usr/lib32 but not a proper solution for the issue in my opinion, the resulting binary also looks in /usr/lib/kodi/userdata, fails to find it there, then continues to look in /usr/share/kodi/userdata, finds it and starts up just fine. I looked into the code in xbmc/Util.cpp and xbmc/Application.cpp but could not determine myself what causes the issue.
Of course manually setting the KODI_HOME environment variable and exporting it also leads to the binary finding the proper userdata directory but that's another workaround. If possible, I would rather get to the bottom of the issue and find a fix that leads to the binary finding the correct directory even if it was not compiled with --libdir=/usr/lib.