Meander Developer Notes
Compilation
Install Go — check the go.mod file for the most up-to-date information on versions, but the latest version will almost always work. Just don't install a version lower than the go.mod.
Now, clone the repository —
git clone https://source.lichendust.com/meanderBecause Meander vendors its dependencies, you can compile right away —
go build -ldflags "-s -w" -trimpath ./sourceThis command will build the smallest possible binary. With that, you're done. There should be a shiny executable in your repository, all ready to run.
Compiling for other machines
If you're building for an esoteric platform, like Plan9, Dragonfly, odd BSD flavours or even Android, you are strongly advised to compile Meander yourself. Only you know the specifics of your hardware or choice of emulator.
Go can compile for all of these targets and more, and you can verify the list of compatible systems and architectures with —
go tool dist listYou can compile Meander for a different operating system and/or architecture than your current machine by doing some version of this in most shells, where GOOS and GOARCH are a valid combination provided by dist list.
env GOOS="windows" GOARCH="arm64" go build -ldflags "-s -w" -trimpath -o "meander_xx" ./sourceDependencies
If you do need to update or pull a copy of the dependencies, you'll need a combination of these two commands —
go mod tidy
go mod vendorThe first fetches any changes you declare in go.mod, such as bumping a version number. In a vendored repository like Meander, you must then instruct Go to overwrite the vendor folder with the new library version(s) using the second command.
Great care has been taken to minimise the use of libraries in Meander for future-proofedness and maintainability. We currently only rely on —
gopdf— source, which is how Meander writes its PDF files.isatty— source, which is just used to detect whether we can use colours in terminal outputs.
All current versions of dependencies are vendored into this repository to defend against unexpected deletion. Each of these packages are redistributed under their original licenses as defined in each vendor subdirectory.