-
Notifications
You must be signed in to change notification settings - Fork 2
Description
I would like to support static binaries, just like chafa
. This means I need to statically link glib
during compilation. I've had trouble doing that, both on my machine and cloud images.
A few people have talked about linking glib statically (see below). I haven't found a reproducible static build script unfortunately.
I think I need to use a decent/recent glib version, maybe find the important .c files, maybe write a few lines of patches, and definitely fiddle a lot with GitHub Actions.
Here's the resources I've found so far:
... it'd be possible to drop in a cut-down GLib similarly to what pkg-config does: https://gitlab.freedesktop.org/pkg-config/pkg-config/
Someone built chafa with emscripten and vendored glib: https://github.com/oakes/chafa. The same person also built chafa/glib with a Nim script: https://github.com/ansiwave/ansiwave/blob/master/src/ansiwavepkg/chafa.nim
... cross compile from WSL2, or use MSYS2. Either of them will provide a Unix-style development environment ... I'd suggest going with MSYS2, since they have prebuilt packages for zlib, glib and freetype, which saves some time building it from scratch. Either way, the build process should be pretty much the same as with Linux.
The author cross-compiles with MXE, which is an older alternative to MSYS2/Docker/modern cross-platform build tools. Script not shared unfortunately. Probably not worth pursuing MXE
hpjansson/chafa#72 (comment)
The build script for chafa.py
looks suspiciously easy: https://github.com/GuardKenzie/chafa.py/blob/main/.github/workflows/build_wheels.yml