haskell-game / dear-imgui.hs

Haskell bindings to Dear ImGui, an immediate mode GUI toolkit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build 'Hello World' example on Windows with Stack

mpilgrem opened this issue · comments

This is not an issue as such, but to record for the benefit of other users that I was able to build the 'Hello World' example on Windows 11 with EDIT: a modified version of Stack 2.15.1 the master branch version of Stack (post-Stack 2.15.1), as follows:

A Stack configuration:

snapshot: lts-22.11 # GHC 9.6.4
extra-deps:
# Release v2.2.0
- git: https://github.com/haskell-game/dear-imgui.hs.git
  commit: bab4d769eaacba2de5da342e853f18746db0e12c
- megaparsec-9.2.2@sha256:c306a135ec25d91d252032c6128f03598a00e87ea12fcf5fc4878fdffc75c768,3219
flags:
  dear-imgui:
    sdl: true
    opengl3: true

A package.yaml:

name: imGuiHelloWorld
version: 0.1.0.0
dependencies:
- base >= 4.7 && < 5
- dear-imgui
- gl
- managed
- sdl2
executables:
  imguiHelloWorld:
    main: Main.hs
    source-dirs: app
    ghc-options:
    - -threaded
    - -rtsopts
    - -with-rtsopts=-N

I needed also needed to install with stack exec -- pacman (SDL versions after 2.24.1-1 do not work):

-S mingw-w64-x86_64-pkgconf
-U mingw-w64-x86_64-SDL2-2.24.1-1-any.pkg.tar.zst # From archive at https://repo.msys2.org/mingw/mingw64/
-S mingw-w64-x86_64-glew

EDIT: Stack 2.15.1/pantry-9.3.2 does not appear to handle an extra-dep with submodules. That is being investigated at commercialhaskell/stack#5536. That has been fixed in the master branch version of Stack (if you are not using GHCup to manage versions of Stack, stack upgrade --source-only --git).