View Single Post
Old 11-16-2015, 10:38 AM   #14
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,400
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Linux also supports that, and even has a tool to easily change it called chrpath. However, I find that LD_LIBRARY_PATH works great. Just a couple of things you have to keep in mind about it:

1) When running subprocesses from outside your application bundle, remember to remove the directory you added from LD_LIBRARY_PATH in the environment the subprocess gets. For instance, when calling
Code:
QDesktopServices::openURL
see the sanitize_env_vars() function int he calibre source code.

2) Instead of writing a bash script to launch your executable, use a little C program instead, its faster and effectively shuts up the whining from distro maintainers See linux/launcher.c in the calibre source code for an example.

@KevinH: the problem in OS X is with application bundles installed with the DMG installer that have both a gui and command line tools. There is no way to install command line tools into the PATH at install time, since you can run no scripts at install time. And even on first run it cannot be done because the user account running the GUI typically does not have permission to write to the directories on PATH like /usr/bin

So that means you either have to use the OS X authorization API to run a helper program as root to install the command line utils or leave it up to the user.
kovidgoyal is offline   Reply With Quote