cabal 経由で gtk をインストールしようとしていますが、ビルド時に次のタイプのエラーが発生します。
[ 22 of 209] Compiling Graphics.UI.Gtk.Embedding.Plug ( dist/build/Graphics/UI/Gtk/Embedding/Plug.hs, dist/build/Graphics/UI/Gtk/Embedding/Plug.o )
Graphics/UI/Gtk/Embedding/Plug.chs:120:6: error:
Couldn't match expected type ‘Ptr ()’
with actual type ‘Maybe DrawWindow’
In the first argument of ‘gtk_plug_new’, namely
‘(fromNativeWindowId (fromMaybe nativeWindowIdNone socketId))’
In the second argument of ‘($)’, namely
‘gtk_plug_new
(fromNativeWindowId (fromMaybe nativeWindowIdNone socketId))’
Graphics/UI/Gtk/Embedding/Plug.chs:137:6: error:
Couldn't match expected type ‘Ptr ()’
with actual type ‘Maybe DrawWindow’
In the second argument of ‘\ (Display arg1) arg2
-> withForeignPtr arg1
$ \ argPtr1 -> gtk_plug_new_for_display argPtr1 arg2’, namely
‘(fromNativeWindowId (fromMaybe nativeWindowIdNone socketId))’
In the second argument of ‘($)’, namely
‘(\ (Display arg1) arg2
-> withForeignPtr arg1
$ \ argPtr1 -> gtk_plug_new_for_display argPtr1 arg2)
display
(fromNativeWindowId (fromMaybe nativeWindowIdNone socketId))’
Graphics/UI/Gtk/Embedding/Plug.chs:151:3: error:
Couldn't match type ‘Ptr ()’ with ‘Maybe DrawWindow’
Expected type: IO (Maybe DrawWindow)
Actual type: IO (Ptr ())
In the second argument of ‘($)’, namely
‘(\ (Plug arg1)
-> withForeignPtr arg1 $ \ argPtr1 -> gtk_plug_get_id argPtr1)
(toPlug self)’
In the expression:
liftM toNativeWindowId
$ (\ (Plug arg1)
-> withForeignPtr arg1 $ \ argPtr1 -> gtk_plug_get_id argPtr1)
(toPlug self)
Failed to install gtk-0.13.9
cabal: Error: some packages failed to install:
gtk-0.13.9 failed during the building phase. The exception was:
ExitFailure 1
このパッケージをインストールするには、「gtk2hsC2hs」が必要です。タイプ エラーは.chsファイルにあり、おそらく gtk2hsC2hs ツールから生成されます。これは gtk2hsC2hs の既知の問題ですか? 他の誰かがこのパッケージをビルドできましたか? 解決策を知っている人はいますか?
Mac OS X Yosemite (10.10.4) を使用しています。
$ gtk2hsC2hs --version
C->Haskell Compiler, version 0.13.13 (gtk2hs branch) "Bin IO", 27 May 2012
$ cabal --version
cabal-install version 1.22.6.0
using version 1.22.4.0 of the Cabal library
を実行したcabal updateので、すべてのパッケージが最新のようです。また、ハックから入手できる古いバージョンをいくつかビルドしようとしましたが、同じエラーが発生します。
編集
生成されたファイルのエラーはすべて、gtk2hsC2hs によって生成される FFI インポートを処理しているようです。ファイルの下部に、私は取得しています
foreign import ccall unsafe "gtk_plug_new"
gtk_plug_new :: ((Ptr ()) -> (IO (Ptr Widget)))
と一貫して混同しているようPtr()ですMaybe DrawWindow。では、生成された型がPtr()間違っているのでしょうか、それとも使い方が間違っているのでしょうか?