How can I tell cabal to specify a dependency for one of my software dependencies?

This is actually the next question: How can I tell Cabal which dependency to use? .

The haskell-src-meta package has two dependencies:

 template-haskell >=2.7 && <2.9, template-haskell >=2.4 && <2.7 

and template-haskell 2.7 will not work on my system. I know the solution to this is:

 cabal install --constraint="template-haskell == 2.5.0.0" haskell-src-meta 

However, now I want to write my own cabal file for the software I wrote that has these dependencies. This seems to be insufficient:

 Build-depends: template-haskell-2.5.0.0 

Instead, I really want to say that haskell-src-meta is a build dependency, but then let it know that it should install this dependency with the same constraint above. Is there any way to do this?

+4
source share
1 answer

Perhaps the โ€œsetโ€ constraint is what you want.

 cabal install --constraint "template-haskell installed" my-custom-package 
+1
source

Source: https://habr.com/ru/post/1401063/


All Articles