[Haskell-cafe] Alternative dependencies in Cabal file
daniel.is.fischer at web.de
Wed Mar 17 08:23:47 EDT 2010
Am Mittwoch 17 März 2010 12:11:53 schrieb Matthias Reisner:
> for a package I need to ensure the user uses a certain package
> configuration. So how would I rewrite the following pseudo-cabal
> Build-Depends: packageA < X, packageB < Y
> packageA >= X && < X', packageB >= Y && < Y'
> packageA >= X', packageB >= Y'
> Build-Depends: ... common dependencies ...
> where neither A nor B is the base package. Maybe I have to use if/else
> blocks, but I don't know what conditions to use then.
Read http://www.haskell.org/ghc/docs/latest/html/Cabal/authors.html for a
general description of what you can do, I'd try something like in
description: ancient packages A and B
description: shiny new A and B
build-depends: packageA >= X', packageB >= Y'
else if flag(oldAB)
build-depends: packageA < X, packageB < Y
build-depends: packageA >= X && < X', packageB >= Y && < Y'
If I remember correctly, that tries first to build against the new A and B,
that failing, it sets flag newAB to false and tries again, first with the
not-so-ancient A and B, hopefully (but I'm not sure about the order in
which flags are toggled if the defaults don't give a successful install
More information about the Haskell-Cafe