I’m trying to wrap an executable with makeWrapper
or wrapProgram
like:
wrapProgram $out/bin/the-exe <some_more_args>
My problem is that the program the-exe
acts differently depending on the value of $0
: there are different symlinks pointing to it, and depending on the symlink that is called, the value of $0
inside the-exe
is equal to the symlink name… But when i use wrapProgram this way, the value of $0
is always $out/bin/.the-exe-wrapped
, no matter what symlink I use to call the-exe
. Is there a way to change the value of $0
as seen inside the-exe
?
I know that makeWrapper has the option --argv0
, but when I do
echo $0
inside the-exe
, the value is always “$out/bin/.the-exe-wrapped” and not the value I passed to --argv0.