@@ -60,43 +60,69 @@ flatpak install flathub org.gnome.Platform//46 org.gnome.Sdk//46
60
60
61
61
** 3. [ Build the .deb of your tauri-app] ( https://v2.tauri.app/reference/config/#bundleconfig ) **
62
62
63
- ** 4. Create the manifest**
63
+ ** 4. [ Create an AppStream MetaInfo file] ( https://www.freedesktop.org/software/appstream/metainfocreator/#/guiapp ) **
64
+
65
+ ** 5. Create the flatpak manifest**
64
66
65
67
``` yaml
66
- id : org.your.id
68
+ # flatpak-builder.yaml
69
+ id : <identifier>
67
70
68
71
runtime : org.gnome.Platform
69
72
runtime-version : ' 46'
70
73
sdk : org.gnome.Sdk
71
74
72
- command : tauri-app
75
+ command : <main_binary_name>
73
76
finish-args :
74
77
- --socket=wayland # Permission needed to show the window
75
78
- --socket=fallback-x11 # Permission needed to show the window
76
79
- --device=dri # OpenGL, not necessary for all projects
77
80
- --share=ipc
78
81
- --talk-name=org.kde.StatusNotifierWatcher # Optional: needed only if your app uses the tray icon
79
82
- --filesystem=xdg-run/tray-icon:create # Optional: needed only if your app uses the tray icon - see an alternative way below
83
+ # - --env=WEBKIT_DISABLE_COMPOSITING_MODE=1 # Optional: may solve some issues with black webviews on Wayland
80
84
81
85
modules :
82
86
- name : binary
83
87
buildsystem : simple
88
+
84
89
sources :
90
+ # A reference to the previously generated flatpak metainfo file
91
+ - type : file
92
+ path : flatpak.metainfo.xml
93
+ # If you use GitHub releases, you can target an existing remote file
85
94
- type : file
86
95
url : https://github.com/your_username/your_repository/releases/download/v1.0.1/yourapp_1.0.1_amd64.deb
87
96
sha256 : 08305b5521e2cf0622e084f2b8f7f31f8a989fc7f407a7050fa3649facd61469 # This is required if you are using a remote source
88
- only-arches : [x86_64] # This source is only used on x86_64 Computers
89
- # This path points to the binary file which was created in the .deb bundle.
90
- # Tauri also creates a folder which corresponds to the content of the unpacked .deb.
97
+ only-arches : [x86_64] # This source is only used on x86_64 Computers
98
+ # You can also use a local file for testing
99
+ # - type: file
100
+ # path: yourapp_1.0.1_amd64.deb
91
101
build-commands :
92
- - ar -x *.deb
93
- - tar -xf data.tar.gz
94
- - ' install -Dm755 usr/bin/tauri-app /app/bin/tauri-app'
95
- - install -Dm644 usr/share/applications/yourapp.desktop /app/share/applications/org.your.id.desktop
96
- - install -Dm644 usr/share/icons/hicolor/128x128/apps/yourapp.png /app/share/icons/hicolor/128x128/apps/org.your.id.png
97
- - install -Dm644 usr/share/icons/hicolor/32x32/apps/yourapp.png /app/share/icons/hicolor/32x32/apps/org.your.id.png
98
- - install -Dm644 usr/share/icons/hicolor/256x256@2/apps/yourapp.png /app/share/icons/hicolor/256x256@2/apps/org.your.id.png
99
- - install -Dm644 org.your.id.metainfo.xml /app/share/metainfo/org.your.id.rosary.metainfo.xml
102
+ - set -e
103
+
104
+ # Extract the deb package
105
+ - mkdir deb-extract
106
+ - ar -x *.deb --output deb-extract
107
+ - tar -C deb-extract -xf deb-extract/data.tar.gz
108
+
109
+ # Copy binary
110
+ - ' install -Dm755 deb-extract/usr/bin/<executable_name> /app/bin/<executable_name>'
111
+
112
+ # If you bundle files with additional resources, you should copy them:
113
+ - mkdir -p /app/lib/<product_name>
114
+ - cp -r deb-extract/usr/lib/<product_name>/. /app/lib/<product_name>
115
+ - find /app/lib/<product_name> -type f -exec chmod 644 {} \;
116
+
117
+ # Copy desktop file + ensure the right icon is set
118
+ - sed -i 's/^Icon=.*/Icon=<identifier>/' deb-extract/usr/share/applications/<product_name>.desktop
119
+ - install -Dm644 deb-extract/usr/share/applications/<product_name>.desktop /app/share/applications/<identifier>.desktop
120
+
121
+ # Copy icons
122
+ - install -Dm644 deb-extract/usr/share/icons/hicolor/128x128/apps/<main_binary_name>.png /app/share/icons/hicolor/128x128/apps/<identifier>.png
123
+ - install -Dm644 deb-extract/usr/share/icons/hicolor/32x32/apps/<main_binary_name>.png /app/share/icons/hicolor/32x32/apps/<identifier>.png
124
+ - install -Dm644 deb-extract/usr/share/icons/hicolor/256x256@2/apps/<main_binary_name>.png /app/share/icons/hicolor/256x256@2/apps/<identifier>.png
125
+ - install -Dm644 flatpak.metainfo.xml /app/share/metainfo/<identifier>.metainfo.xml
100
126
` ` `
101
127
102
128
The Gnome 46 runtime includes all dependencies of the standard Tauri app with their correct versions.
@@ -119,10 +145,10 @@ TrayIconBuilder::new()
119
145
``` shell
120
146
121
147
# Install the flatpak
122
- flatpak -y --user install < local repo name > < your flatpak id >
148
+ flatpak-builder --force-clean --user --disable-cache --repo flatpak- repo flatpak flatpak-builder.yaml
123
149
124
150
# Run it
125
- flatpak run < your flatpak id>
151
+ flatpak run < your flatpak id> # or via your desktop environment
126
152
127
153
# Update it
128
154
flatpak -y --user update < your flatpak id>
0 commit comments