stack is unable to resolve dependencies instaling wx

267 Views Asked by At

I am trying to get wx installed using stack. I don't have Haskell installed globally and use stack new <app> new-template to create a new project. Next, within the directory I run stack install wx and get an error message:

In the dependencies for wx-0.92.3.0:
    wxcore must match >=0.92, but the stack configuration has no specified
           version  (latest matching version is 0.92.3.0)

Following-up the recommended actions and rerunning stack install wx a couple of times, the extra-deps list looks like this:

- wxcore-0.92.3.0
- wxc-0.92.3.0
- wxdirect-0.92.3.0
- Cabal-1.24.2.0
- process-1.4.3.0
- base-4.10.1.0

at this point, stack complains:

In the dependencies for process-1.4.3.0:
    base-4.11.1.0 from stack configuration does not match >=4.4 && <4.11 
                  (latest matching version is 4.10.1.0)

and suggesting to add base-4.10.1.0 again, but which is already there.

Q: so, how should I install wx?

Is it really that hard to get wxHaskell going? Should I start using cabal instead of stack? I use the latest stack version 1.7.1 with lts-12.4 as the resolver. A similar question was posted back in 2015.

1

There are 1 best solutions below

0
On

The hint given by Stéphane Laurent works! On my Debian 9 (stretch) I used the following steps:

  1. Install the required libraries

    sudo apt-get install libwxgtk3.0-dev libwxgtk-webview3.0-dev libwxgtk-media3.0-dev
    
  2. Create a stack project with stack new <app> new-template and change to the <app> directory

  3. Make the following changes to the stack.yaml file:

    resolver: lts-8.16
    
    extra-deps:
    - wxdirect-0.92.3.0
    - wxc-0.92.3.0
    - wxcore-0.92.3.0
    - wx-0.92.3.0
    
  4. Run stack install wx and be patient!

  5. Add - wx to the list of dependencies in the package.yaml file