Andriy Drozdyuk
Andriy Drozdyuk

Reputation: 61121

Generate cabal file with dependencies on foreign libs

Is it possible to automatically generate cabal file for a given haskell project, that will create appropriate Build-depends dependencies for all the libs that the project uses?

Upvotes: 8

Views: 677

Answers (2)

Brent Yorgey
Brent Yorgey

Reputation: 2063

Yes! In fact, the 'cabal init' command does this in the HEAD version of cabal-install. It's true that it's not possible to get it exactly right in all cases, but it just makes the best guesses it can and then lets you fix the generated build-depends list as necessary.

Upvotes: 10

Thomas M. DuBuisson
Thomas M. DuBuisson

Reputation: 64740

No, because some modules are provided by more than one package and it isn't practical (or even possible, really) for cabal to decide which one you want to use.

You can search for which package is provided by which module, or just run cabal-install several times until you've covered all the deps.

Upvotes: 3

Related Questions