Package: makelove
makeloveA packaging tool forlövegamesFeaturesBuild fused win32 and win64 löve binaries (including handling of .exe metadata and icon, but only on Windows or with Wine!)BuildAppImagesusing the AppImages fromlove-appimages(This is feature is only supported on Linux and WSL2. WSL does not support AppImages for a lack of FUSE support)Mac Buildslove.jsbuilds (which does not support Lua modules from shared libraries or LuaJIT-specific features, like FFI)Proper handling of shared libraries (both Lua modules and FFI)!Packaging of those binaries in archives, including extra filesVersioned buildsControl and customization along the way:Configure which targets to buildWhich files to include in the .love with a list of include/exclude patternsWhich löve binaries or AppImage to use as the baseWhich artifacts to generate or keeppre- and postbuild hooks that are able to change the configuration on the fly. For example you can decide dynamically which files to include in the .love (e.g. through parsing asset lists), inject build metadata or just to upload your build automatically afterwards (e.g. via butler toitch.io))QuickstartTo use makelove you need to install Python 3.7 or later and then execute (probably justpipon Windows):pip3 install makeloveThen navigate to the directory containing themain.luaof your game (your game directory) and execute:makelove --initand enter the values you are prompted for. This will create a makelove.toml in your working directory.NOTE: Please have a look atmakelove_full.tomlfor a reference of the possible configuration parametersIt is also possible to execute makelove without any configuration file (makelove will try to guess every configuration parameter), butmakelove --initdoes not take long to execute and will probably give you way better results.If you want to do unversioned builds, it's simply enough to invoke makelove:makeloveIf you wish to version your builds, you should pass a version the first time you build:makelove --version-name 0.1For all subsequent builds the version number will simply be bumped unless you specify a version explicitly and an invocation of makelove without arguments is enough.There are a number of arguments you can specify to customize the build (e.g. to specify a configuration file explicitly, disable hooks, produce more verbose output or check the config file), so make sure to have a look at the help text of makelove:makelove --helpConfigurationAll possible configuration values are shown and explained inmakelove_full.toml(You should look at this!) (not a valid makelove configuration).If you wish to do some extravagant things, have a look athow_to_x.md, which may list what you are trying to do. If there is anything that you want to do, but can't please let me know and I will try to add whatever is needed, if the change is reasonable.Versioned & Unversioned BuildsUnversioned BuildsWith unversioned builds there is only one build directory (the one specified inbuild_directory) and in that directory exists a subdirectory for each target.Whenever a target is built again, the love file will be rebuilt (unless--resumeis passed) and the target will be overwritten.VersionedFor versioned builds on the other hand a new directory (with the version name) is created for each build (the old ones are kept).You can also build a version + target pair that was already built. If you attempt to rebuild a target, makelove will error, unless you specify--force, which will overwrite that target instead. The löve file will not be rebuilt (even with--force) as it defines the version itself. If you wish to replace the löve file, you can just delete the version directory and rebuild the version completely.If a versioned built has been made, a build log is created/updated (inbuild_directory/.makelove-buildlog) that contains a history of the builds (targets built, timestamp, success).GitHub ActionsYou can find an example YAML file that will run makelove in a GitHub Action here:build.yml.Since Linux is the only platform that can make builds for every platform, an Action might be useful to get those, even if you do not have a Linux machine easily at your disposal.The file does need some adaptions in regards to where makelove should be executed and the build directory, but otherwise it should be fairly copy-pastable.Do read the comments in that file first though!Also note that this is not meant for versioned builds, since those need an extra manual input (the version). In case you need them, consider taking the version from a file in the repository.HooksHooks are simply commands that are executed at specific points in the build. After all preparations are done and before the first filesystem operations are executed, the prebuild hook is executed. The postbuild hook is executed after every other step of the build is done.The configuration as it is currently will be written to a temporary file, which will also be read back after the hook was executed. Through this mechanism hooks are capable of modifying the configuration.The commands will be executed with additional environment variables:Environment variableDescriptionMAKELOVE_TEMP_CONFIGThe path to the temporary configuration fileMAKELOVE_VERSIONThe version being built. Also in the command{version}is being replaced with this. An empty string for unversioned builds.MAKELOVE_TARGETSThe targets being built.MAKELOVE_BUILD_DIRECTORYThe build directory. For versioned builds this is the version's build directory. In the command{build_directory}is being replaced with this.An example of how to use the parameter replacement in the commands is inmakelove_full.toml.