سؤال

I'm starting a new project that will hopefully use gtk2hs. However, I can not get this package to install on my fairly typical Linux box. Here is the failure :

[1 of 2] Compiling SetupWrapper     ( /tmp/cairo-0.12.4-4201/cairo-0.12.4/SetupWrapper.hs, /tmp/cairo-0.12.4-4201/cairo-0.12.4/dist/dist-sandbox-58b5f9c6/setup/SetupWrapper.o )

/tmp/cairo-0.12.4-4201/cairo-0.12.4/SetupWrapper.hs:94:45:
    Ambiguous occurrence `moreRecentFile'
    It could refer to either `SetupWrapper.moreRecentFile',
                             defined at /tmp/cairo-0.12.4-4201/cairo-0.12.4/SetupWrapper.hs:149:1
                          or `Distribution.Simple.Utils.moreRecentFile',
                             imported from `Distribution.Simple.Utils' at /tmp/cairo-0.12.4-4201/cairo-0.12.4/SetupWrapper.hs:8:1-32

/tmp/cairo-0.12.4-4201/cairo-0.12.4/SetupWrapper.hs:95:45:
    Ambiguous occurrence `moreRecentFile'
    It could refer to either `SetupWrapper.moreRecentFile',
                             defined at /tmp/cairo-0.12.4-4201/cairo-0.12.4/SetupWrapper.hs:149:1
                          or `Distribution.Simple.Utils.moreRecentFile',
                             imported from `Distribution.Simple.Utils' at /tmp/cairo-0.12.4-4201/cairo-0.12.4/SetupWrapper.hs:8:1-32
Failed to install cairo-0.12.4
[1 of 2] Compiling SetupWrapper     ( /tmp/glib-0.12.4-4201/glib-0.12.4/SetupWrapper.hs, /tmp/glib-0.12.4-4201/glib-0.12.4/dist/dist-sandbox-58b5f9c6/setup/SetupWrapper.o )

/tmp/glib-0.12.4-4201/glib-0.12.4/SetupWrapper.hs:94:45:
    Ambiguous occurrence `moreRecentFile'
    It could refer to either `SetupWrapper.moreRecentFile',
                             defined at /tmp/glib-0.12.4-4201/glib-0.12.4/SetupWrapper.hs:149:1
                          or `Distribution.Simple.Utils.moreRecentFile',
                             imported from `Distribution.Simple.Utils' at /tmp/glib-0.12.4-4201/glib-0.12.4/SetupWrapper.hs:8:1-32

/tmp/glib-0.12.4-4201/glib-0.12.4/SetupWrapper.hs:95:45:
    Ambiguous occurrence `moreRecentFile'
    It could refer to either `SetupWrapper.moreRecentFile',
                             defined at /tmp/glib-0.12.4-4201/glib-0.12.4/SetupWrapper.hs:149:1
                          or `Distribution.Simple.Utils.moreRecentFile',
                             imported from `Distribution.Simple.Utils' at /tmp/glib-0.12.4-4201/glib-0.12.4/SetupWrapper.hs:8:1-32
Failed to install glib-0.12.4

It seems to be related to recent cabal versions, since that used to work before. It seems to be a known bug (http://trac.haskell.org/gtk2hs/ticket/1292 , http://trac.haskell.org/gtk2hs/ticket/1291 and http://trac.haskell.org/gtk2hs/ticket/1289), however it has not moved for weeks. I am not sufficiently competent to suggest a good fix, so I would like your advice. This is very annoying since I am stuck on this important project, and it pains me to think that the main GUI lib of our language has been broken for many weeks now.

cabal-install version 1.18.0.2 using version 1.18.1.1 of the Cabal library / ghc 7.4.1

Thanks for your help

هل كانت مفيدة؟

المحلول

The correct solution for now is to build from darcs. Detailed instructions are given in the Getting the latest and greatest section of the installation instructions; the short version is:

darcs get --lazy http://code.haskell.org/gtk2hs
cd gtk2hs
sh bootstrap.sh

EDIT: The official 0.12.5 release of gtk2hs from December 2013 supports cabal 1.18, so the above darcs instructions are no longer needed. The full installation instructions are still available from the Gtk2Hs download page; the short version is:

cabal install gtk2hs-buildtools
cabal install gtk gtk3

نصائح أخرى

You can try with older Cabal version using cabal install --cabal-lib-version=1.16.0 gtk.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top