[Haskell-cafe] Does exist something like "data-files" in Cabal, which works at compile time?

Daniel Díaz Casanueva dhelta.diaz at gmail.com
Fri Aug 16 12:13:35 CEST 2013


What I have always done to solve this is to create a custom Setup.hs.
Something like:

Setup.hs
-------------
import Distribution.Simple

main :: IO ()
main = doThisBeforeInstall >> defaultMain
-------------

Then you specify in your .cabal file that the Build-Type is Custom.

Best regards,
Daniel Díaz.


On Fri, Aug 16, 2013 at 11:58 AM, Alfredo Di Napoli <
alfredo.dinapoli at gmail.com> wrote:

> Hello guys,
>
> I'm pretty sure the answer is "no", but I was hoping to get some extra
> insight / best practices. The problem can be summarised by this SO question
> (not the OP, but I have the same problem):
>
>
> http://stackoverflow.com/questions/15731170/cabal-how-to-add-text-file-as-a-build-dependency
>
> As someone states, "data-files" in for run-time, whereas I need to tell
> cabal "please copy these files in place before trying to compile", so at
> compile-time.
>
> Does something similar exist?
>
> I think the best solution, unless someone prove me wrong, is to create a
> small startup script which copies the files for me (I *think* yesod is
> using something similar, namely a script called EmbeddedFiles.hs) and then
> triggers "cabal install" the usual way. Can you come up with a better way?
>
> Thanks in advance!
>
> Alfredo
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130816/c40cb4c6/attachment.htm>


More information about the Haskell-Cafe mailing list