Mac OS installer for Haskell platform

Duncan Coutts duncan at
Mon Jan 12 15:39:41 EST 2009

On Thu, 2008-11-27 at 15:47 -0500, Gregory Collins wrote:
> Hi Duncan,

Hi Greg,

Sorry, I've been terrible at keeping up with this.

The good news is we now have a project mailing list:

I very much encourage you to register.

> I took a look through the Mac documentation for their package installer.
> It looks like it should be pretty trivial to programmatically build a
> mac package based on a .cabal file, in a way very similar to what Don
> did with cabal2arch. I should hopefully have a proof-of-concept for this
> within a week.

Sounds great.

>  The logic is:
>    $ cabal configure --global --prefix=/Library/Frameworks/GHC.framework/Versions/yxx/usr

Does that mean we're installing the platform packages inside the GHC
framework? Is that a good idea?

>    $ cabal build
>    $ cabal haddock
>    $ cabal copy --inplace

It might be easier or cleaner to copy --destdir= to some image

>    $ cabal register --global --gen-script

Similarly you can specify an actual file --gen-pkg-config=

>    * compute a post-install script that symlinks any executables from
>      /Library/... to /usr/bin
>    * assemble the output from dist/install/ in the correct format for
>      OSX's PackageMaker (including pre-/post-install scripts)

Or if you use --destdir then it's wherever you pointed it to.

You can use the gen script if you like, but honestly I'm rather
suspicious of it. I would do it with --gen-pkg-config= which outputs the
file you pass to ghc-pkg register/update. Just a suggestion, it's up to
you of course.

>    * run PackageMaker with metadata extracted from the package's .cabal
>      file (name, version, etc)


> Once "cabal2macpkg" is done, creating the aggregate installer should be
> fairly straightforward (knock on wood..). I imagine that the toplevel
> package builder will:
>   * parse all of the dependencies out of the toplevel .cabal file
>   * download each of the source packages (I wish "cabal fetch" took an
>     "-o" argument)

Hmm. File a ticket if you like.

>   * for each package:
>     * unpack into a temporary directory
>     * run cabal2macpkg
>     * copy the resulting .pkg to a staging area
>   * finally, assemble all of the .pkg files (including GHC's) into an
>     aggregate HaskellPlatform-xx.yy.zz.mpkg

> Let me know if you see any snafus with this approach, or anything I've
> not considered -- I'm not super-familiar with how this stuff works
> yet.

Sounds ok.

> One issue on MacOS is that OSX installer packages don't allow for an
> "uninstall" option, so if we want to be good citizens we'll have to
> bundle an uninstall program along with the distribution --- although
> from what I can tell, if we're careful to leave everything inside
> /Library/Frameworks/GHC.framework, we can piggyback on the existing GHC
> uninstaller.

Ah, so perhaps that's one reason to do it. If it is separate then we
need to ghc-pkg unregister each package that we register and remove any
symlinks we made.

You could ask on the libraries list whether people think it's better to
put things in the GHC framework or not.


More information about the Haskell-platform mailing list