2015-08-13 27 views
20

Sto cercando di installare gtk via cabala, però, sto ottenendo i seguenti errori del tipo se costruirloCabal install gtk mancanza

[ 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 

Per installare questo pacchetto, è necessario "gtk2hsC2hs" e il tipo gli errori sono nei file .chs, che presumibilmente sono generati dallo strumento gtk2hsC2hs. Si tratta di un problema noto con gtk2hsC2hs? Qualcun altro è stato in grado di costruire questo pacchetto? Qualcuno sa di una soluzione?

Sono su 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 

Ho fatto un cabal update, in modo che tutti i miei pacchetti sembrano essere sempre aggiornato. Ho anche provato a creare alcune delle vecchie versioni disponibili da hackage, ma ho gli stessi errori.

Modifica

Gli errori nei file generati, sembrano tutti trattano con le importazioni FFI che sono sempre generati da gtk2hsC2hs. Alla fine del file, mi sto

Sembra mescolare costantemente fino Ptr() con Maybe DrawWindow. Quindi il tipo generato Ptr() non è corretto oppure l'utilizzo è errato?

+0

Solo un breve commento, non hanno avuto il tempo di guardare sufficiente scrivere una risposta: i file '.chs' non sono generati da' gtk2hsC2hs'; sono scritti a mano ed elaborati da 'gtk2hsC2hs' per produrre file' .hs'. Se vuoi, puoi cercare in quei file; 'cabal' li memorizza nella directory' dist'. Ci sarà il pragma che punta dal file '.hs' al file' .chs', che è il modo in cui GHC sa dove nel file '.chs' puntare i suoi errori. –

+0

Ok, grazie per il suggerimento. Lo esaminerò. – Matt

risposta

21

Questo ha avuto una soluzione davvero semplice.

cabal install gtk -fhave-quartz-gtk 

Sarebbe bello se questo è stato più ben documentato, ma spero che questo aiuterà chiunque altro che finisce in una situazione simile

+1

Mi ha appena aiutato. Posso confermare che funziona su MacOSX 10.8. Grazie! :) –

+2

Variante di stack (ad es. Per l'installazione di threadscope): 'installa stack --flag gtk: threadscope ha-quartz-gtk' –