Bundle Fractal for macOS
I've started to bundle Fractal for macOS (MR incoming), and here is (roughly) what needs to be done. I already done most of the "hard" things, it is just not pushed yet.
-
configure meson to install the binary in an .app
bundle (--prefix /path/to/Fractal.app/Contents --bindir MacOS
) -
have an .icns
version of the icon -
have an Info.plist
with the app informations (app name/version/description, copyright stuff, …) -
find all dependencies ( gtk
,cairo
,pango
, …) and:-
copy them inside the bundle ( Fractal.app/Contents/Framework/
) -
fix the library search path of both the fractal binary and the libraries to link to the bundled dylib
s -
do that recursivly
-
-
copy everything GTK/gdk/whatever might need (Adwaita, macOS theme (keybindings), glib compiled schemas, gdk things… might not be complete) -
inject somehow environment variables -
GDK_PIXBUF_MODULE_FILE=/path/to/Fractal.app/Contents/Resources/whatever/loaders.cache
for the pixbuf loaders cache, generated bygdk-pixbuf-query-loaders
-
GTK_IM_MODULE_FILE=/path/to/Fractal.app/Contents/Resources/whatever/gtk.immodules
for the GTK input method modules list, generated bygtk-query-immodules-3.0
-
XDG_DATA_DIRS=/path/to/Fractal.app/Contents/Resources/whatever
for things like the theme, icons, glib's schemas, … -
XDG_CONFIG_DIRS=/path/to/Fractal.app/Contents/Resources/whatever
for the GTK settings (saying at least to use Adwaita) - maybe more? I might have missed something
-
-
sign the binaries (or else it won't launch without disabling security stuff on the mac), which means the wrapper that injects the environment variables has to be a binary (you can't sign a shell script) -
fix things like HiDPI not working properly -
have it built in CI (needs a runner running macOS) -
open a lot of issues in GTK because it is pretty much broken (but usable) on macOS -
build a DMG as an "installer" -
reduce the app bundle by striping resources we don't need (we don't need the whole Adwaita theme for example) -
provide alternatives for things depending on Dbus1 and Freedesktop things (like libsecret, opening files/URLs, …)
-
We can't depend on Dbus for anything critical. If a feature isn't available because Dbus and/or some services aren't running, it might be OK, but having a feature displayed but not working is worst.
↩