2

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.

Lemoi
  • 149
  • 9
  • wxHaskell is not part of the current stack release; And you shouldn't try to use a different version from `base` (or `Cabal` and `process` for that matter) other than what's in the resolver. You can try to reconfigure with `--resolver lts-9.21`. LTS 9.21 had base 4.10, so that might work as long as you remove everything not wx-releated from your extra deps – Cubic Jul 31 '18 at 10:00
  • LTS 9.21 gives the same problem. Guess it's time to start using cabal. – Lemoi Jul 31 '18 at 10:29
  • 2
    For me this works with `lts-8.16` and `extra-deps: - wxdirect-0.92.3.0 - wxc-0.92.3.0 - wxcore-0.92.3.0 - wx-0.92.3.0`. Don't you have a constraint on `base` in the cabal file? Good luck, I remember I had a hard time to make it work... – Stéphane Laurent Jul 31 '18 at 12:25

1 Answers1

1

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
Lemoi
  • 149
  • 9