Comment 2 for bug 181639

Revision history for this message
JiHO (jiho) wrote :

Sorry, this is because none of us reacted to the bug report. I confirmed it so it will stay now.

Regarding your issue, this is indeed to be expected. /Applications/Inkscape.app/Contents/Resources/bin/inkscape is a shell script which runs inkscape and sets part of the environment (but not all) so it won't behave as an Inkscape executable (because it isn't) and it won't run smoothly (because the environment is not completely set, this is our fault). This is a problem to debug Inkscape in particular.

There's no real solution to this issue unfortunately. All OS X applications I know that provide a command line interface, do it by building a custom executable, statically linked to the app-specific libraries (i.e. all libraries for Inkscape, since it does not rely on OS X provided libraries). Then one can symlink this executable to /usr/local/bin. If we did this for Inkscape, the executable would be enormous and adding it to the app bundle will nearly double its size.

Once Inkscape is native (i.e. the executable in /Applications/Inkscape.app/Contents/MacOS/Inkscape is actually the inkscape binary), we may find a way to write a custom script that sets everything correctly and passed command line arguments to this binary. Before that, I guess that the launcher would need a major overhaul to run correctly. Volunteers are welcome ;)

So, now for the solutions, in the meantime:
- if you just want to run "inkscape whatever.svg" to open a document from the command line you can:
     . associate Inkscape to svg documents and run "open whatever.svg"
     . define an alias in .bashrc which says: alias inkscape="open -a '/Applications/Inkscape.app'" (NB: see this hint on how to make this work automatically for all apps http://www.macosxhints.com/article.php?story=2004032210304035)
- if you want to run Inkscape from the command line, as you would do on Linux, to batch convert svgs to pngs for exemple, I would advise you to install Inkscape from either Fink or MacPorts (I know MacPorts works and will be updated) and you will have a regular executable in /sw/bin or /opt/local/bin

Hope that helps,
JiHO