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

How to add pkgconfig packages without forking haskell.nix #1664

Closed
ramirez7 opened this issue Sep 13, 2022 · 3 comments · Fixed by #1667
Closed

How to add pkgconfig packages without forking haskell.nix #1664

ramirez7 opened this issue Sep 13, 2022 · 3 comments · Fixed by #1667

Comments

@ramirez7
Copy link
Contributor

ramirez7 commented Sep 13, 2022

This is caused by #1641 (@hamishmack)

The cabalPkgConfigWrapper works fine for packages in nixpkgs and manually mapped in pkgconf-nixpkgs-map.nix, but if a user adds their own pkgconfig-based packages via overlay, it will fail to find them. This is a regression from the previous behavior (which relied on a cabal bug).

I have an example in this PR (examples/sdl-gpu-minimal): https://gitlab.com/macaroni.dev/macaroni.nix/-/merge_requests/12

This is the error I get (as expected - SDL_FontCache is a C library I packaged myself):

Resolving dependencies...
Error: cabal: Could not resolve dependencies:
[__0] next goal: sdl-gpu (user goal)
[__0] rejecting: sdl-gpu-0.1.0.0 (conflict: pkg-config package
SDL_FontCache-any, not found in the pkg-config database)
[__0] fail (backjumping, conflict set: sdl-gpu)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: sdl-gpu

Exposing a way for the user to inject their own packages to the mapping in their cabalProject call would be a nice fix. I can take a stab at that.

@ramirez7
Copy link
Contributor Author

ramirez7 commented Sep 13, 2022

#1667 This accomplishes this nicely.

Sadly, pkgconfig-depends in general is broken for cross-compilation #1666, so I can't test it against my mingwW64 examples. (It isn't broken but I did need to make changes to fix it).

@exarkun
Copy link

exarkun commented Sep 15, 2022

#1641 also broke my overlay-based pkg-config. I read the documentation to see if there were changes to pkg-config-support and I didn't see anything - I suppose because the option newly introduced here isn't documented yet. I didn't find this ticket until I bisected haskell.nix to find the revision that introduced the regression, then followed the outlinks to various tickets, including this one.

@ramirez7
Copy link
Contributor Author

Yeah sorry about that. My fix got merged without accompanying docs. But there is a PR up for them now if you'd like to give any feedback as to whether they would have helped you! #1670

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 a pull request may close this issue.

2 participants