summaryrefslogtreecommitdiff
path: root/platform/linux/snap/README.md
blob: 0bc80972ad92183d673333409f03dfa746050067 (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:

```
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 my-snap-name_0.1_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 mysnap_latest_amd64.snap
```