Skip to content

Use configureCabalFlags from cabal2nix #69

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jcpetruzza
Copy link

The function configureCabalFlags uses a list of packages that should be called with certain flags when passing them to cabal2nix.

For example, for hslua, it specifies that it is to used the "system" version of lua (the one provided by nix) and not the version of lua that comes embedded in the package. Notice that cabal2nix assumes assumes this flag in newer versions of its postProcess method, and if the flag is not given, it will fail attempting to replace package "lua" by "lua_5_3". In any case, a derivation for hslua that doesn't include lua_5_3 as a dependency would be incomplete.

This PR also contains two minor changes (they could be moved to a different PR if needed):

  • Make stackage2nix work with more recent versions of cabal2nix, which introduced a couple of api-breaking changes.
  • Make it easier to build with stack --nix.

The function `configureCabalFlags` has a list of packages
that should be called with certain flags when passing them
to `cabal2nix`.

For example, for `hslua`, it specifies that it is to used the "system"
version of lua (the one provided by nix) and not the version of lua
that comes embedded in the package. Notice that cabal2nix assumes
assumes this flag in newer versions of its `postProcess` method, and
if the flag is not given, it will fail attempting to replace package
"lua" by "lua_5_3".
Adds a `nix` section in the stack.yaml, as an `opt-in`, so it
shouldn't break previous behaviour.
@jcpetruzza
Copy link
Author

I see the checks failed, but as far I can see, this is unrelated to my changes

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

Successfully merging this pull request may close these issues.

1 participant