cabal: question on compiling build prerequisites

Peter Selinger selinger at mathstat.dal.ca
Sat Dec 7 14:17:58 UTC 2013


Thanks for your reply!

The preprocessor is essentially a 20-line Haskell program depending on
Prelude. It's similar to the kind of ad-hoc programs that one might
use within the "test" and "benchmark" targets.  So putting it in a
separate package would be overkill, I think.

I wonder if I can somehow run the compiler from a post-configure
hook. Hm. Looks like I would have to call
Distribution.Simple.Build.buildExe with some magic arguments, to
invoke the compiler. Maybe I will keep experimenting. If there's a
better solution, please let me know! 

Thanks, -- Peter

Henning Thielemann wrote:
> 
> 
> On Fri, 6 Dec 2013, Peter Selinger wrote:
> 
> > My current solution is to make the pre-processor a shell script,
> > rather than a Haskell program. But this is ugly and not portable
> > (won't work in Windows, for example).
> >
> > To clarify: my custom preprocessor is local to this package. It has no
> > independent value, so it would not make sense to publish it as a
> > separate package just so that I can add it to build-depends.
> >
> > Is there a known solution to this problem?
> 
> I have not tried this solution but I would guess that it is a good idea to 
> put the preprocessor in a separate package anyway, since it might have its 
> own build-depends.
> 



More information about the Libraries mailing list