2015-10-13 2 views
5

Le problème fondamental:Haskell gtk type d'installation conflits

Je tente d'installer le paquet gtk de Haskell utilisant le standard mac instructions sur OSX 10.10.4. Spécifiquement, je veux courir threadscope, ainsi j'ai besoin de gtk. Les premières étapes avec homebrew et l'amende de travail gtk buildtools, mais quand je

cabal install gtk 

ou utilise

cabal install --with-gcc=gcc-4.8 gtk 

j'obtiens l'erreur de compilation suivante:

Graphics/UI/Gtk/Embedding/Plug.chs:120:6: 
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: 
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: 
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) 
cabal: Error: some packages failed to install: 

J'avais déjà bibliothèque Haskell gtk et threadscope application installée et en cours d'exécution avant de mettre à jour ma plate-forme Haskell de ghc 7.8.4 à ghc 7.10.2. Au début, j'ai supposé un conflit d'installation, mais j'ai retiré à plusieurs reprises la plate-forme Haskell de mon système en utilisant le thorough removal instructions et j'ai recommencé l'installation threadscope sans succès. J'ai même supprimé et ré-installé le gtk+ sous-jacent et les paquets connexes en utilisant homebrew, encore une fois sans succès.

Je ne suis pas sûr d'où les types Ptr() et Maybe DrawWindow proviennent et donc d'où le conflit pourrait provenir. Toute idée sur ce qui pourrait mal se passer serait la bienvenue!

Répondre

1

Il y a une recette pour l'installation GTK et threadscope sur le blog de edsko:

http://www.edsko.net/2015/03/09/sandboxes-revisited/

Rechercher la page pour "bac à sable GTK".

Mise à jour

j'ai pu construire threadscope en suivant les instructions ci-dessus avec GHC-7.10.2.

Les commandes spécifiques I utilisées:

export PATH=/opt/X11/lib/pkgconfig 
brew install gtk+      # installed gtk+-2.24.25 
brew install poppler     # installed poppler-0.35.0 
cabal sandbox init 
cabal install gtk2hs-buildtools 
cabal install gtk 
cabal install poppler --with-gcc=gcc-4.9 --extra-include-dirs=/usr/local/include 
cabal install threadscope 

Les versions spécifiques de paquets installés dans le bac à sable:

cairo-0.13.1.0 
ghc-events-0.4.4.0 
gio-0.13.1.0 
glib-0.13.2.1 
gtk-0.13.9 
hashtables-1.2.0.2 
pango-0.13.1.0 
poppler-0.13.1 
utf8-string-1.0.1.1 
+0

Bonjour, merci pour votre réponse! Malheureusement, cela a entraîné les mêmes erreurs que ci-dessus lors de la construction de gtk. –

+0

Utilisez-vous GHC 7.10.2? La recette ci-dessus crée un fil de discussion dans un bac à sable, de sorte que vous pouvez le suivre sans déranger vos paquets installés si vous êtes actuellement sur une version différente de GHC. – ErikR

+0

Oui, j'utilise GHC 7.10.2, et je suis très confus pourquoi la recette n'a pas fonctionné, puisqu'un bac à sable était mon truc de dernier recours. –

3

vous pourriez peut-être essayer d'installer gtk avec cette ligne

cabal install gtk -fhave-quartz-gtk

+2

Variante de pile: 'stack install --flag gtk: have-quartz-gtk threadscope' –