Skip to content

Commit 49bacb8

Browse files
authored
Merge pull request #688 from nb923/main
Update packaging.md with flatpak packaging instructions
2 parents a7237bf + e88fba7 commit 49bacb8

File tree

1 file changed

+78
-1
lines changed

1 file changed

+78
-1
lines changed

doc/dev_guide/packaging.md

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,84 @@ git push
7878

7979
## FlatHub (Flatpak)
8080

81-
TODO Instructions
81+
Steps to generate .flatpak package of API Dash:
82+
83+
1. Clone and build API Dash:
84+
85+
Follow the [How to run API Dash locally](setup_run.md) guide.
86+
87+
Stay in the root folder of the project directory.
88+
89+
2. Install Required Packages (Debian/Ubuntu):
90+
91+
```bash
92+
sudo apt install flatpak
93+
flatpak install -y flathub org.flatpak.Builder
94+
flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo
95+
```
96+
97+
*if using another linux distro, download flatpak and follow the rest of the steps.
98+
99+
3. Build API Dash project:
100+
101+
```bash
102+
flutter build linux --release
103+
```
104+
105+
4. Create flatpak manifest file:
106+
107+
```bash
108+
touch apidash-flatpak.yaml
109+
```
110+
in this file, add:
111+
112+
```yaml
113+
app-id: io.github.foss42.apidash
114+
runtime: org.freedesktop.Platform
115+
runtime-version: "23.08"
116+
sdk: org.freedesktop.Sdk
117+
118+
command: /app/bundle/apidash
119+
finish-args:
120+
- --share=ipc
121+
- --socket=fallback-x11
122+
- --socket=wayland
123+
- --device=dri
124+
- --socket=pulseaudio
125+
- --share=network
126+
- --filesystem=home
127+
modules:
128+
- name: apidash
129+
buildsystem: simple
130+
build-commands:
131+
- cp -a build/linux/x64/release/bundle /app/bundle
132+
sources:
133+
- type: dir
134+
path: .
135+
```
136+
137+
5. Create the .flatpak file:
138+
139+
```bash
140+
flatpak run org.flatpak.Builder --force-clean --sandbox --user --install --install-deps-from=flathub --ccache --mirror-screenshots-url=https://dl.flathub.org/media/ --repo=repo builddir apidash-flatpak.yaml
141+
142+
flatpak build-bundle repo apidash.flatpak io.github.foss42.apidash
143+
```
144+
145+
The apidash.flatpak file should be the project root folder.
146+
147+
To test it:
148+
149+
```bash
150+
flatpak install --user apidash.flatpak
151+
152+
flatpak run io.github.foss42.apidash
153+
```
154+
To uninstall it:
155+
156+
```bash
157+
flatpak uninstall io.github.foss42.apidash
158+
```
82159

83160
## Homebrew
84161

0 commit comments

Comments
 (0)