Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ncurses/curses is not listed as dependency #15

Closed
fmthoma opened this issue May 28, 2016 · 4 comments
Closed

ncurses/curses is not listed as dependency #15

fmthoma opened this issue May 28, 2016 · 4 comments

Comments

@fmthoma
Copy link

fmthoma commented May 28, 2016

Although (n)curses.h is obviously a dependency, it is not listed in the cabal file. This might be the reason why stack/nix builds break for some people including me.

This can be resolved by adding

nix:
  packages: [ncurses]

in the stack.yaml of projects using terminfo.

However, I would assume that a

pkgconfig-depends: ncurses

(or libncurses?) in your terminfo.cabal would just solve this problem for everyone.

@judah
Copy link
Collaborator

judah commented May 28, 2016

Thanks for the suggestion. The problem is that the relevant library is available by different names in different systems. On some it's ncurses, for some it's curses, some it's tinfo, etc...for an example of how tricky this is, see: https://ghc.haskell.org/trac/ghc/ticket/7281

Currently we solve this issue using Build-type: Configure in the .cabal file (and then checking which library is installed in the configure script. Is there a way for stack/nix to run the ./configure script in order to figure out which package to use?

@fmthoma
Copy link
Author

fmthoma commented May 30, 2016

Okay, point taken :-)

Unfortunately, NixOS won't even provide the ncurses dependency unless it is explicitly listed, which is why the build script fails. On the other hand, since the name of the library is stable in NixOS, there won't be any guessing necessary.

I guess adding a default.nix file in the project root will do the trick for this specific case. I will have a look into it and maybe come up with a pull request one of the next days.

@fmthoma
Copy link
Author

fmthoma commented Jun 5, 2016

FYI: NixOS/nixpkgs#15995

@judah
Copy link
Collaborator

judah commented Jul 27, 2018

Closing since it looks like the nixpkgs ghc now provides ncurses automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants