GrayR
GrayR

Reputation: 1385

Cabal package install fail

I am trying to install haskell HGL package on windows environment. This is what I get:

e:\Study\haskell>cabal install HGL
Resolving dependencies...
Configuring HGL-3.2.0.0...
Building HGL-3.2.0.0...
Preprocessing library HGL-3.2.0.0...

Graphics\HGL\Key.hs:57:8:
   Could not find module `Graphics.Win32'
   It is a member of the hidden package `Win32-2.3.0.0'.
   Perhaps you need to add `Win32' to the build-depends in your .cabal file.
   Use -v to see a list of the files searched for.
Failed to install HGL-3.2.0.0
cabal: Error: some packages failed to install:
HGL-3.2.0.0 failed during the building phase. The exception was:
ExitFailure 1

Because I am all new to Haskell, and googling didn't help me much, please give advise how can I fix this.

UPDATE

Providing output of commands requested in comments:

e:\Study\haskell\SOE\src\soe>ghc-pkg list
C:/Program Files/Haskell Platform/2013.2.0.0\lib\package.conf.d:
    Cabal-1.16.0
    GLURaw-1.3.0.0
    GLUT-2.4.0.0
    HTTP-4000.2.8
    HUnit-1.2.5.2
    OpenGL-2.8.0.0
    OpenGLRaw-1.3.0.0
    QuickCheck-2.6
    Win32-2.3.0.0
    array-0.4.0.1
    async-2.0.1.4
    attoparsec-0.10.4.0
    base-4.6.0.1
    bin-package-db-0.0.0.0
    binary-0.5.1.1
    bytestring-0.10.0.2
    case-insensitive-1.0.0.1
    cgi-3001.1.7.5
    containers-0.5.0.0
    deepseq-1.3.0.1
    directory-1.2.0.1
    fgl-5.4.2.4
    filepath-1.3.0.1
    (ghc-7.6.3)
    ghc-prim-0.3.0.0
    hashable-1.1.2.5
    haskell-platform-2013.2.0.0
    haskell-src-1.0.1.5
    (haskell2010-1.1.1.0)
    (haskell98-2.0.0.2)
    hoopl-3.9.0.0
    hpc-0.6.0.0
    html-1.0.1.2
    integer-gmp-0.5.0.0
    mtl-2.1.2
    network-2.4.1.2
    old-locale-1.0.0.5
    old-time-1.1.0.1
    parallel-3.2.0.3
    parsec-3.1.3
    pretty-1.1.1.0
    primitive-0.5.0.1
    process-1.1.0.2
    random-1.0.1.1
    regex-base-0.93.2
    regex-compat-0.95.1
    regex-posix-0.95.2
    rts-1.0
    split-0.2.2
    stm-2.4.2
    syb-0.4.0
    template-haskell-2.8.0.0
    text-0.11.3.1
    time-1.4.0.1
    transformers-0.3.0.0
    unordered-containers-0.2.3.0
    vector-0.10.0.1
    xhtml-3000.2.1
    zlib-0.5.4.1

C:\Users\Sergey\AppData\Roaming\ghc\i386-mingw32-7.6.3\package.con
    aeson-0.6.2.1
    base-unicode-symbols-0.2.2.4
    blaze-builder-0.3.3.0
    cmdargs-0.10.5
    convertible-1.0.11.1
    cpphs-1.17.1
    data-default-0.5.3
    data-default-class-0.0.1
    data-default-instances-base-0.0.1
    data-default-instances-containers-0.0.1
    data-default-instances-dlist-0.0.1
    data-default-instances-old-locale-0.0.1
    dlist-0.6
    ghc-mod-3.1.4
    ghc-paths-0.1.0.9
    ghc-syb-utils-0.2.1.2
    haddock-2.13.2.1
    haskell-src-exts-1.14.0
    hlint-1.8.55
    hscolour-1.20.3
    io-choice-0.0.5
    lifted-base-0.2.1.1
    monad-control-0.3.2.2
    monad-loops-0.4.2
    setenv-0.1.1
    tar-0.4.0.1
    transformers-base-0.4.1
    uniplate-1.6.12


e:\Study\haskell\SOE\src\soe>cabal install Win32-2.3.0.0
Resolving dependencies...
All the requested packages are already installed:
Win32-2.3.0.0
Use --reinstall if you want to reinstall anyway.


e:\Study\haskell\expression\HGL-3.2.0.2>cabal install HGL-3.2.0.2
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: HGL-3.2.0.2
trying: HGL-3.2.0.2:+split-base
rejecting: Win32-2.3.0.0/installed-6e9... (conflict: Win32 =>
base==4.6.0.1/installed-f0c..., HGL-3.2.0.2:split-base => base>=3 && <4)
trying: Win32-2.2.2.0
rejecting: base-4.6.0.1/installed-f0c... (conflict: HGL-3.2.0.2:split-base =>
base>=3 && <4)
rejecting: base-4.6.0.1, 4.6.0.0, 4.5.1.0, 4.5.0.0, 4.4.1.0, 4.4.0.0, 4.3.1.0,
4.3.0.0, 4.2.0.2, 4.2.0.1, 4.2.0.0, 4.1.0.0, 4.0.0.0, 3.0.3.2, 3.0.3.1 (global
constraint requires installed instance)

Upvotes: 3

Views: 2571

Answers (2)

user2407038
user2407038

Reputation: 14578

If you look at the documentation for HGL, it states the dependencies as:

base (<2), Win32 or
base (<2), X11 or
array, base (==3.*), Win32 or
array, base (==3.*), X11

You have base-4.6.0.1. You don't meet the requirements for the package to install.

The real question is, why you are trying to install a package last updated in 2009? If you need a simple graphics library, use gloss. If you need more powerful graphics, use OpenGL, which comes with the Haskell Platform.

Upvotes: 3

Robin Green
Robin Green

Reputation: 33033

The version you are trying to install doesn't build on Windows due to a bug in the .cabal file.

If you managed to do

cabal install HGL-3.2.0.2

it would probably work, but there's probably some incompatibility reason why it's not picking that version to install automatically. Maybe an incompatibility with another package you've already installed.

Upvotes: 1

Related Questions