I am building ncurses from source (and then linking my application to it) as part of the build process for my application, and I have observed that the built binaries have the absolute path of the custom terminfo
hardcoded into them.
This absolute path does not make sense in the deployed environment, forcing the user to set TERMINFO
before the program is able to run.
Is there some configuration option to force ncurses to hardcode a path relative to the executable instead?
Alternately, is there a more "standard" way to deploy simple command line applications with custom terminfo libraries, if I wish to avoid heavyweight tools like Docker?
Here are the commands I use to download and build ncurses:
pushd lib
curl -L -o ncurses-6.3.tar.gz https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.3.tar.gz
tar xf ncurses-6.3.tar.gz
pushd ncurses-6.3
./configure --prefix=`pwd`/dist --enable-widec && make && make install
popd
popd
Here's a minimum program:
#include <curses.h>
int main(){
initscr();
}
Here's the command I use to compile it:
g++ -std=c++17 -o MWE MWE.cc -Ilib/ncurses-6.3/dist/include lib/ncurses-6.3/dist/lib/libncursesw_g.a
Here's how I found the hardcoded path:
strings MWE | grep ncurses
/Users/merlin2011/Code/MWE/lib/ncurses-6.3/dist/share/terminfo