Building/installing OS X application bundles for GUIs - cabal-macosx

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/

On Wed, Feb 24, 2010 at 12:54:51 +0000, Andy Gimblett wrote:
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.
Just to give some background to this: I won't claim this is the right place, but the GenI setup script (distant/fond ancestor of cabal-macosx) copies the app bundle to wherever Cabal normally wants to put binaries, and then dumps out a shell script for people who still want a command line interface to their GUI app. So you get ~/.cabal/bin/geni.app # application bundle ~/.cabal/bin/geni # shell script that calls geni.app/Contents/MacOS/geni Again, not sure if that's the right thing to do, but it works for setups where you still expect cabal install GenI to work the same way as, say cabal install darcs, would. -- Eric Kow http://www.nltg.brighton.ac.uk/home/Eric.Kow PGP Key ID: 08AC04F9
participants (2)
-
Andy Gimblett
-
Eric Kow