This gist contains my personal messy note to get the toolchain for cross compiling golang gui app built with Allen's rapid GUI framework.
- Drop Makefile and Dockerfile into a folder
- Run
docker build . -t giubuild
- Copy any example (https://github.com/AllenDang/giu/tree/master/examples) code into main.go
- Get into interactive shell of cointainer so we can build the app
docker run --rm -it -v
pwd:/app giubuild bash
- Inside docker container:
cd /app
and thengo mod init example
. You probably want to target the latest version of the giu library so modify go.mod file torequire github.com/AllenDang/giu latest
.- Use
vend
to download dependencies to vendor folder instead ofgo mod vendor
. Reason for using vend is because many header files/non-go files are ignored when using official "go mod vendor". This cause compiler to fail. - Finally, if all goes well, run
make
. This should take a while but once finished, you should have nix, mac and windows version of the example app in bin folder.
- Recompiling take a lot quicker!