[Haskell-cafe] Cabal and using a throw-away package database during distro package building

Albert Y. C. Lai trebla at vex.net
Fri Nov 5 17:15:16 EDT 2010


On 10-11-05 06:43 AM, Magnus Therning wrote:
>      runhaskell Setup register   --gen-script
>      runhaskell Setup unregister --gen-script
[...]
> Except
> that the generated register/unregister scripts now also point to
> my-temp-db, and there seems to be no way to prevent this.  I solved it
> for now by using sed, but I'd love to leave sed out, if at all
> possible.

Stealing from the scripts of Haskell Platform (source tarball): Don't 
use register --gen-script, use this instead:

runhaskell Setup register --gen-pkg-config=NAME

(You choose a suitable filename for NAME. If you omit =NAME, the default 
filename is "packagename-version.conf". Do play and customize.)

Registration script is just:

ghc-pkg update NAME
or
ghc-pkg register NAME

(add options and full pathname of ghc-pkg as you see fit)

Also don't bother with unregister --gen-script, the unregister script is 
just:

ghc-pkg unregister packagename-version

(add options and full pathname of ghc-pkg as you see fit)

Haskell Platform build scripts are in exactly the same shoe as yours, 
i.e., dilemma between interdependent packages and containment. (It wants 
to register absolutely nothing if some packages fail to build.) You may 
like to look into it for inspirations. Except for how to unregister and 
uninstall. Who wants to get rid of Haskell Platform, haha!


More information about the Haskell-Cafe mailing list