17 Jan

Creating Cocoa app bundles from fink programs

Wednesday January 17th 2007, 3:20 pm
Tags: ,

With MacOSX the Finder and the BSD/fink subsystem have a different understanding what an application really is. If you want to launch for example “gv” from Firefox to view postscript files, it is not enough to select /sw/bin/gv in the Firefox open dialog. What you have to do, is to create an .app bundle from a fink shell script. Platypus makes that quite easy:

  • Installl and launch Platypus
  • Set intepreter to /bin/sh
  • Click on the “New” button below the “Script Path”.
  • Click on “Edit” and write something like:
#!/bin/sh
shift 1
export DISPLAY=:0.0
. /sw/bin/init.sh
exec /sw/bin/gv "$@"

It’s important that you write it, not only copy it from here. Copy&paste creates ^M (DOS like?) line ending such that the script is not runnable afterwards.

  • Select “Is droppable”
  • Change the “App Name” to something sensible, e.g. “gv”
  • Click on “Create”
  • Store the gv.app in ~/Applications.

Now you can open a postscript file in Firefox and select the new gv.app in the “Open with” dialog. Voila: “shell applications” in your Mac programs.

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit

No Comments »

No comments yet.

 

RSS feed for comments on this post. TrackBack Website

Leave a comment

(required)

(required)

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>