[Haskell-cafe] Re: [Haskell] GHC 6.10 and OpenGL

Claus Reinke claus.reinke at talk21.com
Sun Nov 23 07:30:00 EST 2008

>> >> It's sad to see the OpenGL binding being dropped from GHC binary
>> >> installers starting from 6.10. Though this issue has been brought up
>> >> and discussed before, I'm sure a lot of people who based their work on
>> >> OpenGL would share the same sympathy.
>> >
>> >     $ cabal install OpenGL
>> Nice except that:
>> 1. The command cabal requires cabal-install package to be installed, is it
>> already bundled with all GHC 6.10.1 distributions?
> It will be bundled in the Haskell platform installer (as will OpenGL).

When is that going to be available? It would be nice to know that 
this unfortunate gap period will end within a few weeks or so, especially
since interest in Haskell OpenGL has been picking up again lately.

> In the mean time here's a binary:
> http://haskell.org/~duncan/cabal/cabal.exe

The last time I tried bootstrapping from that, I didn't get very far,
nor have there been any suggestions on what to do about it:

>> 2. It still wouldn't work for the OpenGL package on Windows, because
>> the configure scripts require a Unix-style built environment
>> (MinGW/MinSys or Cygwin).
> Yes, building it requires mingw/msys, but with it cabal install opengl
> really does work (I've tried it).

The problem is that this places an additional barrier on distribution:
Haskell OpenGL authors cannot simply distribute their Haskell code,
because many other Haskellers will not be able to get it to work:

if they are on Windows:

- they need to install cabal-install (before the cabal.exe, which doesn't
    seem to be advertized, that involved further dependency recursion
    http://ghcmutterings.wordpress.com/2008/11/10/bootstrapping-cabal-install/ )
- they need to install MinGW/MSys
- then they can do cabal install OpenGL

- there still seem to be additional issues with Glut (I haven't got 
    around to trying it since it these things were dropped from
    extralibs, but the install instructions sound too complicated;
    patches to support freeglut should go into the glut package,
    manual copying around shouldn't be needed; but none of 
    that seems to be a cabal issue)

A working cabal.exe, easily found from the cabal home page,
would be a good start, but several packages suffer from the
"needs MinGW/MSys before cabal-install will work" issue.

Since there are known-to-work versions of the MinGW/MSys
installers, perhaps a cabal package wrapper for these installers 
could be constructed?

- this would make the build dependency explicit, and would
    allow to record known-to-work versions via cabal dependencies
- cabal could check for presence of MinGW/MSys and 
    record the result in its package database
- whenever other packages depend on MinGW/MSys, and
    these cannot be found, cabal could either download and run 
    the installers from the commandline (assuming that is supported), 
    or produce output *with precise instructions, urls, and version 
    numbers* for manual installation (perhaps the preferred option)

Then we could simply say "here is the Haskell package, use
cabal (url) to build", and windows users would follow the url
to download cabal.exe, and cabal.exe would tell them what
they need to do to get MinGW/MSys, just as it takes care of
other dependencies, and then things would "just work".


More information about the Haskell-Cafe mailing list