Utilise pkgconf `Provides` field
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
Arch Linux recently replaced its `sdl2` package with an `sdl2-compat` package, which means that there's no longer a `/usr/lib/pkgconfig/sdl2.pc`. However, `/usr/lib/pkgconfig/sdl2_compat.pc` contains the line `Provides: sdl2 = 2.32.50`, which is supposed to indicate to tools that it should be used when `sdl2` is queried. For example, `pkgconf --libs sdl2` and `pkgconf --modversion sdl2` still work.
Unfortunately, this isn't enough for Cabal (3.12.1.0):
```console
$ cabal get sdl2
Unpacking to sdl2-2.5.5.0/
$ cd sdl2-2.5.5.0/
$ cabal build
Resolving dependencies...
Error: [Cabal-7107]
Could not resolve dependencies:
[__0] trying: sdl2-2.5.5.0 (user goal)
[__1] trying: sdl2:+recent-ish
[__2] rejecting: sdl2:+pkgconfig (conflict: pkg-config package sdl2>=2.0.10, not found in the pkg-config database)
[__2] rejecting: sdl2:-pkgconfig (manual flag can only be changed explicitly)
[__2] fail (backjumping, conflict set: sdl2, sdl2:pkgconfig, sdl2:recent-ish)
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: sdl2, sdl2:pkgconfig, sdl2:recent-ish
```
In this particular case, I hope to [fix things upstream](https://gitlab.archlinux.org/archlinux/packaging/packages/sdl2-compat/-/issues/3) so that no change in Cabal is necessary. But it's something that will probably come up again.
Contributor guide
Research direction
Reproduce the reported `cabal build` failure for the `sdl2` package with Cabal 3.12.1.0 and the Arch Linux `sdl2_compat.pc` file. Start by tracing Cabal's pkg-config dependency lookup; done when the `Provides: sdl2 = 2.32.50` entry satisfies the declared `sdl2 >= 2.0.10` requirement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100