[Haskell-cafe] Building/installing OS X application bundles for GUIs - cabal-macosx

Andy Gimblett haskell at gimbo.org.uk
Wed Feb 24 07:54:51 EST 2010


Hi all,

Last week I quietly released v0.1.0 of cabal-macosx, providing support  
for building OSX application bundles (e.g. and in particular for GUIs  
created using wxHaskell and gtk2hs - hence all the cross-posting):

http://hackage.haskell.org/package/cabal-macosx

I'm now soliciting input on how to handle the install stage, leading  
(I hope) to a loudly-announcable release soon. :-)

The current package provides a post-build hook which creates an  
application bundle at dist/build/foo.app (for example).  It seems to  
work well.  See the source repository for examples.

However, running "runghc Setup install" copies the bare executable at  
dist/build/foo/foo (rather than the foo.app bundle) to the install  
location, which is no good.  So I need to put in some install  
infrastructure to copy the .app, not the bare executable, to the right  
place.

That raises the question: what is the right place?  It seems to me  
that the defaults are not the right defaults for this case.  --global  
should probably go to /Applications, and --user should perhaps go to ~/ 
Applications (though I'm less sure about that).  Of course, end-users  
can explicitly set this on a per-install basis, but it seems that for  
bundles we'd want to override the default.

Thus I'm currently asking:

* What do people think about the default installation question?

* Can anyone advise me on the right way to handle this (installing  
the .app, and overriding the default locations) with Cabal?  I'm  
hoping I can just tweak part of the LocalBuildInfo and let the default  
machinery then handle the work, but at present it's not clear to me  
how to do that, and rather than spend ages trying to figure it out,  
perhaps someone who knows can help me out?  I'm hoping I'm not going  
to have to completely override the install machinery - that would feel  
somewhat self-defeating.

Many thanks,

-Andy

--
Andy Gimblett
http://gimbo.org.uk/



More information about the Haskell-Cafe mailing list