现实世界haskell - 第23章如何安装gtk和glade

时间:2015-06-01 09:25:49

标签: haskell glade cabal-install

我正在通过书籍现实世界的哈克尔,我到目前为止总是找到一种方法来调整代码片段以使它们运行但这次我被卡住了。

我必须安装gtk和glade绑定才能在第23章中运行GUI示例。

这就是我所做的:

~/prog/Haskell/realWorldHaskell/chapter23 $ cabal sanbox init
~/prog/Haskell/realWorldHaskell/chapter23 $ cabal install gtk2hs-buildtools
~/prog/Haskell/realWorldHaskell/chapter23 $ cabal install gtk

哪个有效,但当我这样做时:

~/prog/Haskell/realWorldHaskell/chapter23 $ cabal install glade

我明白了:

Resolving dependencies...
Notice: installing into a sandbox located at
/home/fayong/prog/Haskell/realWorldHaskell/chapter23/.cabal-sandbox
Configuring utf8-string-0.3.8...
Building utf8-string-0.3.8...
Installed utf8-string-0.3.8
Configuring cairo-0.12.5.3...
Configuring glib-0.12.5.4...
Failed to install cairo-0.12.5.3
Build log ( /home/fayong/prog/Haskell/realWorldHaskell/chapter23/.cabal-sandbox/logs/cairo-0.12.5.3.log ):
[1 of 2] Compiling SetupWrapper     ( /tmp/cairo-0.12.5.3-13890/cairo-0.12.5.3/SetupWrapper.hs, /tmp/cairo-0.12.5.3-13890/cairo-0.12.5.3/dist/dist-sandbox-96c39190/setup/SetupWrapper.o )
[2 of 2] Compiling Main             ( /tmp/cairo-0.12.5.3-13890/cairo-0.12.5.3/dist/dist-sandbox-96c39190/setup/setup.hs, /tmp/cairo-0.12.5.3-13890/cairo-0.12.5.3/dist/dist-sandbox-96c39190/setup/Main.o )
Linking /tmp/cairo-0.12.5.3-13890/cairo-0.12.5.3/dist/dist-sandbox-96c39190/setup/setup ...
[1 of 2] Compiling Gtk2HsSetup      ( Gtk2HsSetup.hs, dist/setup-wrapper/Gtk2HsSetup.o )

Gtk2HsSetup.hs:169:28:
    Couldn't match expected type `IO
                                    (Distribution.InstalledPackageInfo.InstalledPackageInfo_
                                       ModuleName)'
                with actual type `FilePath
                                  -> PackageDB
                                  -> IO Distribution.InstalledPackageInfo.InstalledPackageInfo'
    In the return type of a call of `generateRegistrationInfo'
    Probable cause: `generateRegistrationInfo' is applied to too few arguments
    In a stmt of a 'do' block:
      installedPkgInfoRaw <- generateRegistrationInfo
                               verbosity pkg lib lbi clbi inplace distPref
    In the expression:
      do { installedPkgInfoRaw <- generateRegistrationInfo
                                    verbosity pkg lib lbi clbi inplace distPref;
           dllsInScope <- getSearchPath >>= (filterM doesDirectoryExist)
                          >>= getDlls;
           let libs = fixLibs dllsInScope (extraLibraries installedPkgInfoRaw)
               installedPkgInfo = ...;
           case () of {
             _ | modeGenerateRegFile -> die "Generate Reg File not supported"
               | modeGenerateRegScript -> die "Generate Reg Script not supported"
               | otherwise
               -> registerPackage
                    verbosity installedPkgInfo pkg lbi inplace packageDbs } }

Gtk2HsSetup.hs:170:63:
    Couldn't match type `[Char]' with `Bool'
    Expected type: Bool
      Actual type: FilePath
    In the 7th argument of `generateRegistrationInfo', namely
      `distPref'
    In a stmt of a 'do' block:
      installedPkgInfoRaw <- generateRegistrationInfo
                               verbosity pkg lib lbi clbi inplace distPref
    In the expression:
      do { installedPkgInfoRaw <- generateRegistrationInfo
                                    verbosity pkg lib lbi clbi inplace distPref;
           dllsInScope <- getSearchPath >>= (filterM doesDirectoryExist)
                          >>= getDlls;
           let libs = fixLibs dllsInScope (extraLibraries installedPkgInfoRaw)
               installedPkgInfo = ...;
           case () of {
             _ | modeGenerateRegFile -> die "Generate Reg File not supported"
               | modeGenerateRegScript -> die "Generate Reg Script not supported"
               | otherwise
               -> registerPackage
                    verbosity installedPkgInfo pkg lbi inplace packageDbs } }
Failed to install glib-0.12.5.4
Build log ( /home/fayong/prog/Haskell/realWorldHaskell/chapter23/.cabal-sandbox/logs/glib-0.12.5.4.log ):
[1 of 2] Compiling SetupWrapper     ( /tmp/glib-0.12.5.4-13890/glib-0.12.5.4/SetupWrapper.hs, /tmp/glib-0.12.5.4-13890/glib-0.12.5.4/dist/dist-sandbox-96c39190/setup/SetupWrapper.o )
[2 of 2] Compiling Main             ( /tmp/glib-0.12.5.4-13890/glib-0.12.5.4/dist/dist-sandbox-96c39190/setup/setup.hs, /tmp/glib-0.12.5.4-13890/glib-0.12.5.4/dist/dist-sandbox-96c39190/setup/Main.o )
Linking /tmp/glib-0.12.5.4-13890/glib-0.12.5.4/dist/dist-sandbox-96c39190/setup/setup ...
[1 of 2] Compiling Gtk2HsSetup      ( Gtk2HsSetup.hs, dist/setup-wrapper/Gtk2HsSetup.o )

Gtk2HsSetup.hs:161:28:
    Couldn't match expected type `IO
                                    (Distribution.InstalledPackageInfo.InstalledPackageInfo_
                                       ModuleName)'
                with actual type `FilePath
                                  -> PackageDB
                                  -> IO Distribution.InstalledPackageInfo.InstalledPackageInfo'
    In the return type of a call of `generateRegistrationInfo'
    Probable cause: `generateRegistrationInfo' is applied to too few arguments
    In a stmt of a 'do' block:
      installedPkgInfoRaw <- generateRegistrationInfo
                               verbosity pkg lib lbi clbi inplace distPref
    In the expression:
      do { installedPkgInfoRaw <- generateRegistrationInfo
                                    verbosity pkg lib lbi clbi inplace distPref;
           dllsInScope <- getSearchPath >>= (filterM doesDirectoryExist)
                          >>= getDlls;
           let libs = fixLibs dllsInScope (extraLibraries installedPkgInfoRaw)
               installedPkgInfo = ...;
           case () of {
             _ | modeGenerateRegFile -> die "Generate Reg File not supported"
               | modeGenerateRegScript -> die "Generate Reg Script not supported"
               | otherwise
               -> registerPackage
                    verbosity installedPkgInfo pkg lbi inplace packageDbs } }

Gtk2HsSetup.hs:162:63:
    Couldn't match type `[Char]' with `Bool'
    Expected type: Bool
      Actual type: FilePath
    In the 7th argument of `generateRegistrationInfo', namely
      `distPref'
    In a stmt of a 'do' block:
      installedPkgInfoRaw <- generateRegistrationInfo
                               verbosity pkg lib lbi clbi inplace distPref
    In the expression:
      do { installedPkgInfoRaw <- generateRegistrationInfo
                                    verbosity pkg lib lbi clbi inplace distPref;
           dllsInScope <- getSearchPath >>= (filterM doesDirectoryExist)
                          >>= getDlls;
           let libs = fixLibs dllsInScope (extraLibraries installedPkgInfoRaw)
               installedPkgInfo = ...;
           case () of {
             _ | modeGenerateRegFile -> die "Generate Reg File not supported"
               | modeGenerateRegScript -> die "Generate Reg Script not supported"
               | otherwise
               -> registerPackage
                    verbosity installedPkgInfo pkg lbi inplace packageDbs } }
cabal: Error: some packages failed to install:
cairo-0.12.5.3 failed during the configure step. The exception was:
ExitFailure 1
gio-0.12.5.3 depends on glib-0.12.5.4 which failed to install.
glade-0.12.5.0 depends on glib-0.12.5.4 which failed to install.
glib-0.12.5.4 failed during the configure step. The exception was:
ExitFailure 1
gtk-0.12.5.7 depends on glib-0.12.5.4 which failed to install.
pango-0.12.5.3 depends on glib-0.12.5.4 which failed to install.

我做错了什么?我对haskell和cabal(以及一般的编程)都很陌生

我正在使用ghc 7.6.3和cabal 1.22.3.0

0 个答案:

没有答案