Skip to main content
edited tags
Link
Gilles 'SO- stop being evil'
  • 865.3k
  • 205
  • 1.8k
  • 2.3k
Source Link
Anko
  • 4.7k
  • 2
  • 34
  • 59

How do I add a program with a directory of dependencies to $PATH?

I want to add a program to my $PATH, but its code is split into various files that it imports at run-time from a lib/ in its root directory.

projectRootDirectory
├ programBinary
└ lib
  ├ someLibrary
  └ someLibrary2

How do I add such a program to my $PATH without it complaining about missing dependencies?


I'd normally get the binary into /usr/local/bin by

  • copying

     cp /path/to/programBinary /usr/local/bin
    
  • or symlinking

     cd /usr/local/bin
     ln -s /path/to/programBinary programBinary
    

but both make it fail to find its dependencies.

I can't move the whole directory into /usr/local/bin because some of the required files are executables too, which I don't want cluttering my $PATH.

How should I be doing this?