summaryrefslogtreecommitdiff
path: root/platform/linux/snap/README.md
blob: 7683713f47855430e059889c7a52a2eb5966135b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Mapbox GL Native snap for Linux

The `snapcraft.yaml` file in this folder helps build a [snap](https://www.snapcraft.io) package for the Linux demo app (`mbgl-glfw`).

`mbgl-glfw` is a simple map application and test suite for Linux, based on Mapbox GL Native and GLFW. Keyboard shortcuts for testing functionality are logged to the console when the test app is started.

Please note that to run the app you need to set up a `MAPBOX_ACCESS_TOKEN` environment variable with a valid Mapbox access token.

## Install it from the snap store

Builds are available in the `dev` channel of the snap store:

```
sudo snap install mapbox-demo
```

## Building the snap package from source

First increase the default memory available to snapcraft. The default is 2G and won't be enough to build the binary:

```
export SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY=16G
```

After that, run `snapcraft` to build the package. If you're planning to update the Snap Store with this build, make sure you update the version string in `snapcraft.yaml` with the right date:

```
snapcraft --debug
```

(the `--debug` flag will automatically open a shell within the snap's virtual environment if something goes wrong.)

## Installing the snap package

You can install the snap package locally with:

```
sudo snap install mapbox-demo_20190420-master_amd64.snap --dangerous --devmode
```

## Publishing it to the Snap Store

Authenticate the snapcraft command using the Mapbox Snapcraft developer account credentials:

```
snapcraft login
```

Upload the snap and release it into the edge channel:

```
snapcraft push --release=edge mapbox-demo_20190420-master_amd64.snap
```