4
votes

I'm learning Haskell these days. And I a interesting project in Github : https://github.com/tmishima/Hinecraft I clone it , and I want to build it myself and run it. But I encounter with stack-build problems like that

Resolver 'lts-13.0' does not have all the packages to match your requirements.
FTGL not found
    - Hinecraft requires -any
GLUtil not found
    - Hinecraft requires -any
OpenGLRaw version 3.3.1.0 found
    - Hinecraft requires <=2.3.0.0

It looks like these dependencies can not be found in stack , what should I do now ? Should I download these dependencies manually and build them locally? Thanks for help.

the .cabal dependencies code

build-depends:       
                 base , GLFW-b , OpenGL , mtl
                 , bytestring , array , vector , directory
                 , process , OpenGLRaw <= 2.3.0.0 , cereal , FTGL
                 , time , containers , GLUtil , linear , text
                 , sqlite-simple
1

1 Answers

3
votes

Those dependencies are not included in the package set of stackage (you can check it in https://www.stackage.org/lts-13.0). However, they are in the hackage repository (f.e. http://hackage.haskell.org/packages/search?terms=GLUtil) and you can make stack using them adding a extra-deps section in the stack.yaml config file:

resolver: lts-13.0
extra-deps:
  - FTGL-2.1
  - GLUtil-0.10.3
  - OpenGLRaw-2.3.0.0

I've not tested the build, maybe it could fail cause dependencies are not compatible.

I've tried building the package and the above configuration doesn't work. The actual cabal file doesn't have the OpenGLRaw <= 2.3.0.0 constraint, maybe did you add the constraint for some reason?

If not so you could try build it removing the constraint from cabal file and with this stack.yaml, that uses the default OpenGLRaw-3.3.1.0:

resolver: lts-13.0
extra-deps:
  - FTGL-2.1
  - GLUtil-0.10.3

As the package needs an older version of OpenGLRaw (2.3.0.0), i've managed to define a config file that uses that version, using lts-6.35:

resolver: lts-6.35
extra-deps:
 - FTGL-2.1
 - GLURaw-1.4.0.2
 - GLUtil-0.8.8
 - hpp-0.3.1.0
 - OpenGL-2.13.0.0
 - OpenGLRaw-2.3.0.0

Hope it helps!

As a side note, i have to mention that cabal is able to build the package with the original constraint, with not further configuration (although it picks different versions of libs).