GTK2HS无法安装最近的cabal版本

时间:2013-10-24 15:45:45

标签: haskell gtk cabal gtk2hs

我正在开始一个有希望使用gtk2hs的新项目。但是,我无法在我相当典型的Linux机器上安装此软件包。这是失败:

[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

它似乎与最近的cabal版本有关,因为以前曾经工作过。它似乎是一个已知的错误(http://trac.haskell.org/gtk2hs/ticket/1292http://trac.haskell.org/gtk2hs/ticket/1291http://trac.haskell.org/gtk2hs/ticket/1289),但它已经移动数周。我没有足够的能力建议一个好的解决方案,所以我希望你的建议。这是非常烦人的,因为我被困在这个重要的项目上,我很难想到我们语言的主要GUI库已经被打破了好几个星期。

cabal-install version 1.18.0.2使用Cabal库的版本1.18.1.1 / ghc 7.4.1

感谢您的帮助

2 个答案:

答案 0 :(得分:3)

现在正确的解决方案是从darcs构建。详细说明在安装说明的Getting the latest and greatest部分中给出;简短版本是:

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

编辑: 2013年12月gtk2hs的官方0.12.5版本支持cabal 1.18,因此不再需要上述darcs指令。完整的安装说明仍可从Gtk2Hs download page获得;简短版本是:

cabal install gtk2hs-buildtools
cabal install gtk gtk3

答案 1 :(得分:2)

您可以使用Cabal尝试较旧的cabal install --cabal-lib-version=1.16.0 gtk版本。