[OS X] launch Inkscape with a login shell

Bug #383456 reported by su_v on 2009-06-04
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

The Inkscape.app launch script inherits the minimal shell environment of launchd. Current system and user configuration files are not read.


1) bash sh-bang with --login option in script and openDoc (diff attached)

from the bash reference manual:
"When Bash is invoked as (...) a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable."

Changing the sh-bang line of Resources/script and Resources/openDoc to
 #!/bin/bash --login
gets the current system (x11, macports, fink) and user (local) environment to inkscape.

Additional PATH settings in Resources/bin/inkscape then can be reduced to specially needed Frameworks(?).

Empirical testing - I don't have C/C++ coding skills - showed that this does not work when the LauncherApp/ScriptExec uses NSTask (Platypus 4.2), but works with execve() (inkscape/packaging/macosx/ScriptExec/main.c in ExecuteScript()).

2) bash login shell wrapper added to current ScriptExec

If the bash login shell implemented as sh-bang doesn't work e.g. for older platforms (Tiger, PPC?), maybe adding an explicit interpreter with --login argument to execve() in ScriptExec/main.c is more portable? This is similar to the way MacVim starts vim with a login shell.

Other applications that use a (bash) login shell:
  X11.app <http://cgit.freedesktop.org/xorg/xserver/tree/hw/xquartz/bundle/X11.sh>
  MacVim <http://repo.or.cz/w/MacVim.git?a=blob;f=src/MacVim/MMAppController.m> (line 2001-2102)

3) new ScriptExec based on Platypus 4.2

Platypus 4.2 <http://www.sveinbjorn.org/platypus> offers (gui) configuration of interpreter+arguments+script+path of a launcherApp; implemented as NSTask. The code for the ScriptExec binary has been rewritten in Objective-C and Cocoa, implementation of openDoc/Drag&Drop changed. Interpreter+arguments can now be configured/changed with Resources/AppSettings.plist without recompiling ScriptExec.

Inkscape specific fc-cache and X11 related functions in ScriptExec would have to be rewritten. Resources/script stays unchanged or could be combined with openDoc and bin/inkscape.

su_v (suv-lp) wrote :
Changed in inkscape:
assignee: nobody → Michael Wybrow (mjwybrow)
jazzynico (jazzynico) on 2011-03-24
Changed in inkscape:
importance: Undecided → Wishlist
su_v (suv-lp) on 2011-03-24
tags: added: packaging
su_v (suv-lp) wrote :


Changed in inkscape:
assignee: Michael Wybrow (mjwybrow) → nobody
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers