#### Beyond Linux® From Scratch (System V Edition) - Version r13.0-1233

### Chapter 17. Networking Libraries

- Prev

  cURL-8.21.0

- Next

  glib-networking-2.80.1

- Up
- Home

# GeoClue-2.8.2

## Introduction to GeoClue

GeoClue is a modular geoinformation service built on top of the D-Bus messaging system. The goal of the GeoClue project is to make creating location-aware applications as simple as possible.

### Note

Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.

### Package Information

- Download (HTTP): https://gitlab.freedesktop.org/geoclue/geoclue/-/archive/2.8.2/geoclue-2.8.2.tar.bz2

- Download MD5 sum: b40de9b467b79d0d4fad7b40dea21e04

- Download size: 116 KB

- Estimated disk space required: 7.3 MB

- Estimated build time: 0.1 SBU

### GeoClue Dependencies

#### Required

json-glib-1.10.8 and libsoup-3.6.6

#### Recommended

libnotify-0.8.8, ModemManager-1.24.2, and Vala-0.56.19

#### Optional

Avahi-0.8 and GTK-Doc-1.36.1

## Installation of GeoClue

Install GeoClue by running the following commands:

    mkdir build &&
    cd    build &&

    meson setup --prefix=/usr        \
                --buildtype=release  \
                -D gtk-doc=false     \
                -D nmea-source=false \
                ..                   &&
    ninja

This package does not come with a test suite.

Now, as the `root` user:

    ninja install

## Command Explanations

`--buildtype=release`: Specify a buildtype suitable for stable releases of the package, as the default may produce unoptimized binaries.

`-D nmea-source=false`: This switch disables the NMEA source. Remove it if you have installed the Avahi package and your local network has a NMEA server.

`-D 3g-source=false`: This switch disables the 3G backend. Use it if you have not installed the ModemManager package.

`-D modem-gps-source=false`: This switch disables the modem GPS backend. Use it if you have not installed the ModemManager package.

`-D cdma-source=false`: This switch disables the CDMA source backend. Use it if you have not installed the ModemManager package.

`-D demo-agent=false`: This switch disables the demo. Use it if you have not installed the libnotify package.

## Configuring GeoClue

### Config Files

`/etc/geoclue/conf.d/90-lfs-google.conf`

### Configuration Information

In March of 2024, Mozilla announced the shutdown of the Mozilla Location Service. Geoclue uses this service for determining a user's location when requested by other applications. The only supported alternative by upstream is to use Google's Geolocation Service.

To use Google's Geolocation Service, an API key must be used, and a configuration file must be created. This API key is only intended for use with LFS. Please do not use this API key if you are building for another distro or distributing binary copies. If you need an API key, you can request one at https://www.chromium.org/developers/how-tos/api-keys.

Create the configuration needed for using Google's Geolocation Service as the `root` user:

    cat > /etc/geoclue/conf.d/90-lfs-google.conf << "EOF"
    # Begin /etc/geoclue/conf.d/90-lfs-google.conf

    # This configuration applies for the WiFi source.
    [wifi]

    # Set the URL to Google's Geolocation Service.
    url=https://www.googleapis.com/geolocation/v1/geolocate?key=AIzaSyDxKL42zsPjbke5O8_rPVpVrLrJ8aeE9rQ

    # End /etc/geoclue/conf.d/90-lfs-google.conf
    EOF

If you do not wish to request your location from a Geolocation service, you can hardcode your location in `/etc/geolocation` using the format described in geoclue(5).

## Contents

Installed Programs: None
Installed Libraries: libgeoclue-2.so
Installed Directories: /etc/geoclue, /usr/include/libgeoclue-2.0, /usr/libexec/geoclue-2.0, and /usr/share/gtk-doc/html/{geoclue,libgeoclue}

- Prev

  cURL-8.21.0

- Next

  glib-networking-2.80.1

- Up
- Home