This how-to guide will cover how to create a custom package for unicornpkg.
This guide assumes you have a working executable file or a working library, along with a working install of libunicorn and unicorntool.
- Create a file named
yourpackage.lua
. In most cases, name this the same name as your program. - Copy-and-paste the below boilerplate code into
yourpackage.lua
:
local package = {}
package.name = "yourpackage"
package.instdat = {}
package.instdat.filemaps = {}
package.instdat.filemaps["YOUR_PASTE_ID"] = "/bin/yourpackage.lua"
package.pkgType = "com.pastebin"
package.unicornSpec = "v1.0.0"
return package
If you need a custom folder (for a module, for example), add a fs.makeDir
call before the package
table is defined.
- Test your package with
unicorntool
. See the how-to guide for installing a raw package to make sure your package works. - Share it! Open a PR on the main unicornpkg repository, or add it to a GitHub release with the
.unicornpkg.lua
extension.