[Haskell-cafe] Stack project, dependency with build flags
Michael Snoyman
michael at snoyman.com
Wed Sep 5 16:46:26 UTC 2018
IIUC, you can set additional flags in your stack.yaml file:
flags:
ncurses:
flagname: true # or false
On Wed, Sep 5, 2018 at 7:35 PM John Z. <johnz at pleasantnightmare.com> wrote:
> Hi everyone,
> I'll try with tl:dr; first:
> I have a project with a dependency that -on my system- needs a build
> flag, in order to correctly link against its native dependencies.
> What is a proper way to set up a project like this?
>
> A longer explanation:
> My project uses `ncurses` library and I'm running Arch. There seems
> to be some religious opinion going around about the layout of
> ncurses headers in /usr/include, and -naturally- Arch and `ncurses`
> disagree. Fortunately, author of `ncurses` included a build flag to
> allow (easy) build on systems which follow the 'wrong' layout.
>
> Thing is, I couldn't figure out how to add this configuration to the
> .cabal of my own project, so for now, I'm stuck with a Makefile that
> invokes `stack` commands with `--flag ncurses:force-narrow-library`.
> I looked in the manual and there doesn't seem to be a way to handle
> this aside the commandline argument.
>
> So this got me thinking - is there a different way projects like
> these are supposed to be organized? For example, am I supposed to
> check out `ncurses` as a submodule of my project, then replicate
> this build flag on my own project and 'pass it down' somehow?
>
> Any tips are highly appreciated; I'm really not proficient with
> organizing stack projects properly.
>
> Cheers!
>
>
>
> --
> "That gum you like is going to come back in style."
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20180905/a5961f87/attachment.html>
More information about the Haskell-Cafe
mailing list