<div dir="ltr">Thanks Dag, I&#39;ll give it a spin. Btw, I&#39;ve successfully solved my problem with the following Setup.hs, I&#39;m posting it here in case someone will find this useful in the future:<div><br></div><div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">#!/usr/bin/env runhaskell<br>import Distribution.Simple<br>
import Distribution.PackageDescription<br>import Distribution.Package<br>import Distribution.Simple<br>import Distribution.Simple.LocalBuildInfo<br>import Distribution.Simple.Setup<br>import Distribution.Verbosity<br>import Distribution.Simple.Utils<br>
import Paths_myproject<br>main :: IO ()<br>main = defaultMainWithHooks myHooks<br>  where myHooks = simpleUserHooks { preBuild = copyResources }<br>copyResources :: Args <br>                     -&gt; BuildFlags<br>                     -&gt; IO HookedBuildInfo<br>
copyResources args flags = do<br>  installDir &lt;- getDataDir<br>  installDirectoryContents verbose &quot;resources&quot; (installDir ++ &quot;/resources&quot;)<br>  return emptyHookedBuildInfo</blockquote></div><div><br>
</div><div>where &quot;myproject&quot; should be the name of your project, as in myproject.cabal.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 16 August 2013 13:11, Dag Odenhall <span dir="ltr">&lt;<a href="mailto:dag.odenhall@gmail.com" target="_blank">dag.odenhall@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><p style="margin:1.2em 0px!important">You want <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px 3px 3px 3px;display:inline">extra-source-files</code>.  They&#39;ll be included in the tarball, and cabal always builds from the root of the package, so you can safely use relative paths.</p>



</div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="im">On Fri, Aug 16, 2013 at 11:58 AM, Alfredo Di Napoli <span dir="ltr">&lt;<a href="mailto:alfredo.dinapoli@gmail.com" target="_blank">alfredo.dinapoli@gmail.com</a>&gt;</span> wrote:<br>


</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hello guys,<div><br></div><div>I&#39;m pretty sure the answer is &quot;no&quot;, 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):</div>



<div><br></div><div><a href="http://stackoverflow.com/questions/15731170/cabal-how-to-add-text-file-as-a-build-dependency" target="_blank">http://stackoverflow.com/questions/15731170/cabal-how-to-add-text-file-as-a-build-dependency</a><br>



</div><div><br></div><div>As someone states, &quot;data-files&quot; in for run-time, whereas I need to tell cabal &quot;please copy these files in place before trying to compile&quot;, so at compile-time.</div><div><br></div>



<div>Does something similar exist?</div><div><br></div><div>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 &quot;cabal install&quot; the usual way. Can you come up with a better way?</div>



<div><br></div><div>Thanks in advance!</div><span><font color="#888888"><div><br></div><div>Alfredo</div></font></span></div>
<br></div></div><div class="im">_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></div></blockquote></div><br></div>
</blockquote></div><br></div>