7

I am trying to install helm. When I try to install it, however I get this error:

$ cabal install helm
Resolving dependencies...
Configuring sdl2-1.1.0...
cabal: The pkg-config package 'sdl2' version >=2.0.3 is required but it could
not be found.
Failed to install sdl2-1.1.0
cabal: Error: some packages failed to install:
helm-0.6.1 depends on sdl2-1.1.0 which failed to install.
sdl2-1.1.0 failed during the configure step. The exception was:
ExitFailure 1

When I go to install sdl2 by itself, I get a similar message.

$ cabal install sdl2
Resolving dependencies...
Configuring sdl2-1.1.0...
cabal: The pkg-config package 'sdl2' version >=2.0.3 is required but it could
not be found.
Failed to install sdl2-1.1.0
cabal: Error: some packages failed to install:
sdl2-1.1.0 failed during the configure step. The exception was:
ExitFailure 1

I don't understand. According to Hackage, sdl2 is at version 1.1, but installing it requires version 2.0.3? I've tried this in and out of a sandbox. Results of ghc-pkg list are here if you think they're relevant: http://pastebin.com/tFrsfPFe

I'm on Ubuntu btw.

Help?

asg0451
  • 493
  • 4
  • 13
  • 5
    This is not refering to cabal/haskell packages (http://www.freedesktop.org/wiki/Software/pkg-config/) - have tried to install the sdl2 packages using apt-get/synaptic/similar? (I guess it should be libsdl2-dev or something) – Random Dev Sep 07 '14 at 19:34
  • 1
    I did install libsdl2-2.0 whatever, but did not install libsdl2-dev... I just did, but apt-get gave me version 2.0.2, not 2.0.3. I'm updating apt-get sources now. We shall see. Thanks! – asg0451 Sep 07 '14 at 23:42
  • 1
    If this don't work you can grab the 2.0.3 release here: http://libsdl.org/download-2.0.php – Random Dev Sep 08 '14 at 04:10

2 Answers2

4

Another thing which could happen (happened to me) for other installs is that the PKG_CONFIG_PATH variable might not point to the package config file (sdl2.pc, for me in the /usr/local/lib/pkgconfig directory). pkg-config uses some default directories ('/usr/lib/pkgconfig' and '/usr/share/pkgconfig'), but if the sdl.pc file isn't in one of these, you'll have to specify the directory in the environment variable. You can check this with echo $PKG_CONFIG_PATH

If it turns out you need to set the variable, just use export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig (or to whatever directory your sdl2.pc file lives in)

B. Elliott
  • 181
  • 1
  • 6
0

I ran into the same problem, and I just want to add my solution here for the record. The native sdl2 libraries need to be installed first by following the directions here: https://github.com/haskell-game/sdl2#building

Eric Zoerner
  • 761
  • 6
  • 9