@@ -24,3 +24,88 @@ without a GUI.
2424[ ![ Screenshot] ( images/shot2.png )] ( images/shot2.png )
2525
2626https://github.com/user-attachments/assets/6f7bdee1-183c-4554-9701-e0c30e75d58a
27+
28+ ## flatpak
29+
30+ Add the ` flathub ` repo:
31+
32+ ``` shell
33+ flatpak remote-add --if-not-exists \
34+ flathub https://flathub.org/repo/flathub.flatpakrepo
35+ ```
36+
37+ Install the gtk4 SDK and runtime:
38+
39+ ``` shell
40+ flatpak install org.gnome.Sdk//47
41+ flatpak install org.gnome.Platform//47
42+ ```
43+
44+ Allow file. Recent security changes to git will cause submodule checkout
45+ to fail inside flatpak. If you get errors like `fatal: transport 'file'
46+ not allowed`, re-enable file transport with:
47+
48+ ``` shell
49+ git config --global protocol.file.allow always
50+ ```
51+
52+ Build and try running it:
53+
54+ ``` shell
55+ flatpak-builder --force-clean --user --install build-dir org.libvips.nip4.json
56+ flatpak run org.libvips.nip4 ~ /pics/k2.jpg
57+ ```
58+
59+ Force a complete redownload and rebuild (should only rarely be necessary) with:
60+
61+ ``` shell
62+ rm -rf .flatpak-builder
63+ ```
64+
65+ Check the files that are in the flatpak you built with:
66+
67+ ``` shell
68+ ls build-dir/files
69+ ```
70+
71+ Uninstall with:
72+
73+ ``` shell
74+ flatpak uninstall nip4
75+ ```
76+
77+ ## Notes on flatpak build process
78+
79+ - niftiio is annoying to build, skip it.
80+
81+ - x265 is annoying to build, skip it
82+
83+ - we skip imagemagick as well, too huge
84+
85+ ## Packaging for flathub
86+
87+ Install the appdata checker:
88+
89+ ``` shell
90+ flatpak install flathub org.freedesktop.appstream-glib
91+ flatpak run org.freedesktop.appstream-glib validate org.libvips.nip4.metainfo.xml
92+ ```
93+
94+ Also:
95+
96+ ``` shell
97+ desktop-file-validate org.libvips.nip4.desktop
98+ ```
99+
100+ ## Uploading to flathub
101+
102+ Make a PR on:
103+
104+ https://github.com/flathub/org.libvips.nip4
105+
106+ then check the build status here:
107+
108+ https://flathub.org/builds/#/apps/org.libvips.nip4
109+
110+ On success, merge to master.
111+
0 commit comments