-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Static builds #1
Comments
My build script is crufty and terrible, and would likely just cause more confusion if I pasted it verbatim. Here's how it works, though:
Each package is configured with the following: export PKG_CONFIG_SYSROOT_DIR=${PWD}/install
./configure --enable-static=yes --enable-shared=no --host=x86_64-unknown-linux-gnu --cache-file=${PWD}/temp/config.cache --with-sysroot=${PWD}/install --sysconfdir=/etc Some of the packages need extra args to
I try to use the latest versions of everything, but sometimes it's hard to get it to build with old glibc. This set is known to work:
There's more fine print, but if you want to go this route, the above should get you started. Caveat emptor: I came up with this over a decade ago, and it's tuned to keep the static binaries running with decade-old runtimes. There may be better/simpler ways of doing it today. Feel free to ask if you're running into trouble, I'll answer as time allows. |
I would like to support static binaries, just like
chafa
. This means I need to statically linkglib
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:
hpjansson/chafa#41 (comment)
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
hpjansson/chafa#72 (comment)
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.ymlThe text was updated successfully, but these errors were encountered: