libvips/nip2

Is it possible to make a static build of nip2?

mhirsch opened this issue · 3 comments

I'm interested in running nip2 in a server environment, where it would be useful to have a static build of the binary. Using the flags available in the generated configure script doesn't seem to get me there -- I tried --enable-static=yes --enable-shared=no but I think that's aimed at libraries, and doesn't seem to generate a static build. Adding CFLAGS="-static" CPPFLAGS="-static" breaks the compiler tests in the configure script. Is this something that's possible in the current build environment?

Thanks!

Hi @mhirsch,

A fully static build would be very difficult.

Would something like containerising with docker or flatpak work? Or perhaps building to a private prefix and then running with a wrapper script? nip2 is a relocatable package, so you can untar the binary anywhere and run it from that directory.

Thanks very much for weighing in on this. My current solution is to run it in a docker, but I was curious if there's a path to run it inside a short-lived google cloud function. How far reaching would it be to be able to compile a 'headless' version of nip2, that removes the x11 dependency? We've found it really useful to prototype rapidly in nip2, but then perhaps have been a little lazy about converting it to a vips library program rather than just running the nip2 sheet in batch mode.

If you run nip2 in batch mode, it won't try to connect to the display, so it should work on a server. I hope!

I used to run it like that way back, though perhaps headless mode has bitrotted.