Skip to content

Commit

Permalink
doc: add flatpak draft post
Browse files Browse the repository at this point in the history
  • Loading branch information
vjousse committed Oct 8, 2024
1 parent d9f3599 commit 681047d
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 9 deletions.
31 changes: 31 additions & 0 deletions content/en/2024-10-08-packaging-tauriv2-flatpak-snapcraft.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: Packaging a Tauri v2 app on Linux for flatpak/flathub and snapcraft with rust, npm and elm
slug: packaging-tauri-v2-flatpak-snapcraft-elm
date: "2024-10-18 09:36:00+00:00"
tags: flatpak, snapcraft, tauri, rust, elm, linux
category:
link:
description:
type: text
status: draft
---

I’m developing a [Pomodoro technique](https://en.wikipedia.org/wiki/Pomodoro_Technique) app/tracker called [Pomodorolm](https://github.com/vjousse/pomodorolm) using [Rust](https://www.rust-lang.org/), [Tauri (v2)](https://v2.tauri.app/) and [Elm](https://elm-lang.org/). And a few weeks ago I decided to package it on Linux for [Flathub](https://flathub.org/apps/org.jousse.vincent.Pomodorolm) and [Snapcraft](https://snapcraft.io/pomodorolm) and to be honest, it was quite a challenge. So, I will sum-up in this post how to overcome the difficulties I've encountered including:

- Going through the [**flathub review process**](https://github.com/flathub/flathub/pull/5562)
- Enabling **offline builds** (even for Elm)
- **Building the entire app from source** instead of using the method [documented on the official Tauri website](https://v2.tauri.app/fr/distribute/flatpak/) using the `.deb` package
- Enforcing **`/app` prefix** instead of `/usr`
- Providing a valid `metainfo.xml` file
- Enabling **dynamic tray icon** generation support
- Embedding **app/Tauri resources** (like **audio** and **json** files)
- Managing **playing sound for snapcraft** with **alsa** and **pulseaudio**
- Handling **version numbers** all over the place

<!-- TEASER_END -->

## TL;DR

You can find the **flatpak build files** on the [Flathub repository of Pomodorolm](https://github.com/flathub/org.jousse.vincent.Pomodorolm), and the **`snapcraft.yml` file** on the [Github of Pomodorolm](https://github.com/vjousse/pomodorolm/blob/main/snapcraft.yaml).

## Flatpak offline builds
22 changes: 13 additions & 9 deletions static/css/emmett.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ ul {

ol li,
ul li {
padding-bottom: 1rem;
padding-bottom: 0.5rem;
}

ul li ul {
padding-top: 0.5rem;
}

ul li p {
Expand Down Expand Up @@ -173,36 +177,36 @@ nav > ul li:not(:first-child):before {
font-style: italic;
}

.list ul {
.list > ul {
padding-left: 1rem;
}

.list ul li {
.list > ul li {
padding-bottom: 3rem;
padding-left: 0.3rem;
}

.list ul li > a {
.list > ul li > a {
font-size: 1.2rem;
font-weight: 700;
}

.list ul li .post-info {
.list > ul li .post-info {
padding-top: 1rem;
padding-bottom: 1rem;
}

.list ul li {
.list > ul li {
list-style-type: "» ";
}

.list ul li::marker {
.list > ul li::marker {
font-weight: 700;
font-size: 1.4rem;
color: var(--accent);
}

.list ul li:hover::marker {
.list > ul li:hover::marker {
content: "# ";
font-weight: 700;
color: var(--link);
Expand All @@ -221,7 +225,7 @@ address {
}

div.post-excerpt ul li {
padding-bottom: 0;
padding-bottom: 0.5rem;
}

div.post-excerpt ul li::marker {
Expand Down

0 comments on commit 681047d

Please sign in to comment.