moly
moly copied to clipboard
Initial setup to build platform bundles
This adds a maintenance makefile that can build Linux Flatpaks with Moxin. I am working on similar targets for Windows Apps and macOS bundles.
Note that there are some difficulties involved:
-
Makepad hard-codes the absolute path to the source directory in its binaries. This is used to locate resources at runtime. This obviously will not work when distributing applications. Hence, this makefile collects resources and bundles them as part of the application. Currently, only resources of
moxin
andmakepad_widgets
are collected. This list is hard-coded, but can be extended easily. -
We have to tell makepad about the location of the resources at runtime. This will require knowledge of the packaging format. Currently, this PR hard-codes the path so it works for Flatpaks, but this will certainly break other platforms / builds. We likely want feature-flags for each bundle we support, so our code can choose suitable locations.
-
We have to bundle wasmedge, since we cannot rely on it to be installed. The build currently downloads it from github and simply copies it into the flatpak. Not sure whether we can find better ways to do this.
This is a draft, but you can certainly test it right now. Simply checkout this branch and run make flatpak-build
followed by make flatpak-run
.