Skip to content

Commit

Permalink
Fix flatpak (#26)
Browse files Browse the repository at this point in the history
* Fix flatpak manifest and related config

- add AppData description
- replace ~/.config with XDG_CONFIG_HOME
- add python dependencies: requests and pyxdg
- add necessary sandbox permissions: bluetooth and system-bus
- replace local dir build source by github URL + tag

* Add documentation on how to build and install flatpak app
  • Loading branch information
nlfx authored Apr 27, 2021
1 parent 4e30d8f commit c19f2f2
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 3 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,38 @@ echo "power on" | sudo bluetoothctl
```
Icons by svgrepo.com

## Building and installing Flatpak app

### Building and installing on target architecture

```
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install --user flathub org.gnome.Sdk//3.38 org.gnome.Platform//3.38
flatpak-builder --repo=repo --force-clean build-dir/ org.gnome.siglo.json
flatpak build-bundle ./repo/ siglo.flatpak org.gnome.siglo
flatpak install --user ./siglo.flatpak
```

### Cross-compiling for PinePhone

Example cross-compiling for PinePhone on an `x86_64` Fedora machine:

```
sudo dnf install qemu-system-arm qemu-user-static
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install --user flathub org.gnome.Sdk/aarch64/3.38 org.gnome.Platform/aarch64/3.38
flatpak-builder --arch=aarch64 --repo=repo --force-clean build-dir org.gnome.siglo.json
flatpak build-bundle --arch=aarch64 ./repo/ siglo.flatpak org.gnome.siglo
```

Transfer the `siglo.flatpak` file on the PinePhone and install it with the following command:

```
sudo flatpak install ./siglo.flatpak
```

##
If this project helped you, you can buy me a cup of coffee :)
<br/><br/>
Expand Down
3 changes: 3 additions & 0 deletions data/org.gnome.siglo.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
<metadata_license>CC0-1.0</metadata_license>
<project_license>LicenseRef-proprietary</project_license>
<description>
<p>
GTK app to sync InfiniTime watch with PinePhone
</p>
</description>
</component>
29 changes: 28 additions & 1 deletion org.gnome.siglo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
"sdk" : "org.gnome.Sdk",
"command" : "siglo",
"finish-args" : [
"--allow=bluetooth",
"--share=network",
"--share=ipc",
"--socket=fallback-x11",
"--socket=system-bus",
"--socket=wayland"
],
"cleanup" : [
Expand Down Expand Up @@ -46,14 +48,39 @@
"pip3 install --prefix=/app --no-cache-dir dbus-python"
]
},
{
"name": "python3-requests",
"buildsystem": "simple",
"build-options": {
"build-args": [
"--share=network"
]
},
"build-commands": [
"pip3 install --prefix=/app --no-cache-dir requests"
]
},
{
"name": "python3-pyxdg",
"buildsystem": "simple",
"build-options": {
"build-args": [
"--share=network"
]
},
"build-commands": [
"pip3 install --prefix=/app --no-cache-dir pyxdg"
]
},
{
"name" : "siglo",
"builddir" : true,
"buildsystem" : "meson",
"sources" : [
{
"type" : "git",
"url" : "file:///home/malex/Projects/siglo"
"url" : "https://github.com/alexr4535/siglo",
"tag" : "v0.6.2"
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions src/config.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import configparser
import xdg.BaseDirectory
from pathlib import Path


class config:
# Class constants
default_config = {"mode": "singleton", "deploy_type": "quick"}
home_dir = str(Path.home())
config_dir = home_dir + "/.config/siglo"
config_dir = xdg.BaseDirectory.xdg_config_home
config_file = config_dir + "/siglo.ini"

def load_defaults(self):
Expand Down

0 comments on commit c19f2f2

Please sign in to comment.