So, with that sentiment, I'm moving on and am now going to try and install the libraries directly to see if I can get localization working separately from GTG. I've been advised that I need GeoClue2 to get location information, Champlain in GIR to show locations on a map, and GTK3 in GIR to show a map on a window. So I'm going to break it down and tackle the problem piece-wise.
First step: get GeoClue2 working.
-
Building the source: After digging around, I came across this, which looked a lot more promising. I also found this experimental deb release here, which is useful for those who don't want to deal with sources.
[Note: I also came across this repo as well. But this is specifically for geocoding and is something different than GeoClue2.] So I pulled the source. To avoid getting the same install errors I did, first installed the gtk-doc package:
Now you should have all the pre-reqs for running GeoClue2:git clone git://anongit.freedesktop.org/geoclue sudo yum install glib-devel gtk-doc json-glib-devel sudo yum install intltool itstool libxml2-devel libtool libsoup-devel sudo yum install gobject-introspection-devel
A couple of things to note here. First, if you don't use the./autoget.sh --prefix=/usr ./configure --prefix=/usr make sudo make install
--prefix=/usr
flags, then the dbus files get put in/usr/local/share
instead of/usr/share
. Second, you have to use root credentials to do the install because you're installing dubs services. -
Now that everything compiles nicely, you can try out the demo by going to the
demo
folder and running./where-am-i
. You may get an error message like this:
If you do, it's because you didn't use theCRITICAL **: Failed to connect to GeoClue2 service: Error calling StartServiceByName for org.freedesktop.GeoClue2: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Launch helper exited with unknown return code 253
--prefix=/usr
flag I mentioned before. So go back, do amake clean
and repeat the build process.
If you're sure you did add the flags, then it's possible that the install still went incorrectly. On my Fedora machine, it added the /usr prefix in front of a /etc install, which led to things being installed under /etc instead of /usr/etc. You can change the script, or just hack it for now (like I did) and move the necessary files:
Now you should be able to run the GeoClue2 demo:sudo mv /usr/etc/system.d/org.freedesktop.GeoClue2.* /etc/dbus-1/system.d/
And you'll see output that looks like this:cd demo ./where-am-i
Latitude: 40.440601 Longitude: -79.995903 Accuracy (in meters): 15000.000000 Description: Pittsburgh, Pennsylvania, United States
-
Note if you want to get things installed on Ubuntu, I had to first install these packages:
The rest of the install process (including thesudo apt-get install intltool itstool libxml2-utils sudo apt-get install libgeocode-glib-dev libjson-glib-dev libsoup2.4-dev sudo apt-get install libgirepository1.0-dev
--prefix=/usr
flags I mentioned before) is the same.
For 'fun', I also tried this process on a Debian machine and ended up having a much harder time getting things to just work. So I decided to ditch that and just stick with Fedora (or Ubuntu) for now.