libvips / nip2

A spreadsheet-like GUI for libvips.
https://libvips.github.io/libvips/
GNU General Public License v2.0
362 stars 13 forks source link

Is it possible to make a static build of nip2? #100

Closed mhirsch closed 3 years ago

mhirsch commented 3 years ago

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!

jcupitt commented 3 years ago

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.

mhirsch commented 3 years ago

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.

jcupitt commented 3 years ago

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.