top logo
 

Necessitas Beta1 “breaks” qgis on android – don’t update

Hi all, it has been a while since my last post, and foremost QGIS on android release. I’m very sorry. I’ve been working hard on another project (inasafe.org) that toke up all my time since we just launched version 1.0.

So now to the real problem, necessitas (the android Qt port) has had a sweet update that adds a lot of nice things (like native look and feel) to Qt apps. The only problem is that it has a grave bug that makes the new shiny thing bad for QGIS. Basically there is no second level menu bars anymore. Yes exactly, every item like view>panels>gps can’t be selected. Basically all plugins, all panels and more can’t be selected with the new necessitas, So If QGIS is the only Qt app you have on your device, DON’T let ministro update it’s libraries.
I’ve of course already discussed with the maintainer of necessitas and he promised me to have this fixed in the next release. Meanwhile, I’m looking into making a temporary package that includes the old Qt libraries.
I’m sorry for the issue and really hope to solve this quickly but as everybody I need do do paid work as well to support my other developments, so if you can, give a nice poke to that donate button ;)

ciao


Creating non-versioned shared libraries for android

While porting QGIS to android using necessitas I encountered the problem of versioned libs. Android does not support versioned libs and it is not going to. In the first vesions I used rpl -R -e libqgis_core.so.1.9.90 "libqgis_core.so\x00\x00\x00\x00\x00\x00\x00" $APK_LIBS_DIRand similar hacks to remove the version from the libs. But it was rather hacky. Then I found this post by Tom Russo where he mentioned how he changed his build process to force non versioned libs. I wrote him with some questions and finally, thanks to his hints, I managed to create a fairly general patch for libtool to make it generate android compatible configure scripts. I sent the patch to libtool and we’ll see what they think.diff --git a/m4/libtool.m4 b/m4/libtool.m4
index a9e20cf..a5cc8eb 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -2642,8 +2642,17 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ case $host_os in
+ # This must be Linux Android ELF which has no support for versioned libs.
+ linux-android*)
+ library_names_spec='$libname${shared_ext}'
+ soname_spec='${libname}${shared_ext}'
+ ;;
+ *)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no

Now, the problem is that this patch fixes libtool.m4 which is the file that is used when a project manager creates a configure script. So it will take time until libtool includes the patch, your project manager updates the configure script and so on. But, no problem, mean while you can just look for something similar in your configure file (I was very lucky using “this must be linux ELF” as search criteria) and replace it accordingly and reconfigure passing –host=arm-linux-androideabi (as you probably already do if you are reading this). I managed to crosscompile expat, gdal, geos, gsl, proj, libiconv and libcharset without version.
QGIS uses libpq (postgres client) to connect to some services, but there is no hint in the configure script about soname_spec and library_names_spec, so I searched for SO_VERSION and found it set in Makefile.shlib and adapted it accordingly. Bottom line is that you need to search creatively for anything related to soname, SO_VERSION and similar.

QGIS uses as well QWT, which is QMAKE based, in this case to generate non versioned libs it’s enough to add CONFIG += plugin to the .pro or .pri file.

Finally, in CMAKE you need IF (NOT ANDROID)
SET_TARGET_PROPERTIES(qgis_core PROPERTIES
VERSION ${COMPLETE_VERSION}
SOVERSION ${COMPLETE_VERSION}
)
ENDIF (NOT ANDROID)
in your CMakeList.txt and call cmake with -DANDROID

Hope this helps and that more and more people port cool libs to android.
Ciao Marco


bottom

Powered by Django!