Gtk2Hs 0.12.1 pre-release packages available

Duncan has kindly upgraded the Gtk2Hs core packages to work with GHC version 7. They have successfully been tested on Linux, Mac OS 10.5, 10.6, 10.7 (even the native Aqua version seems to work), and Windows 7. Anyone having a different platform than the aforementioned: now is the time to test.

Note that users of ghc-6.10 will need to first install a more recent
version of the Cabal library, at least 1.8. This is straightforward and
should not break anything.

Try with cabal-install

If you’ve got cabal-install version 0.10 or later you can copy and paste
this huge command line to install them all:

cabal install http://code.haskell.org/~duncan/gtk2hs/gtk2hs-buildtools-0.12.1.tar.gz
cabal install http://code.haskell.org/~duncan/gtk2hs/glib-0.12.1.tar.gz http://code.haskell.org/~duncan/gtk2hs/gio-0.12.1.tar.gz http://code.haskell.org/~duncan/gtk2hs/pango-0.12.1.tar.gz http://code.haskell.org/~duncan/gtk2hs/cairo-0.12.1.tar.gz http://code.haskell.org/~duncan/gtk2hs/gtk-0.12.1.tar.gz

(The above are two lines only!)

Axel

21 Responses to “Gtk2Hs 0.12.1 pre-release packages available”

  1. Sven Says:

    Hey cool! Keep up the good work. Is there actually anything regarding GTK 3 on the way?

  2. Axel Says:

    Gtk 3from the Haskell point of view seems be have only few changes: many APIs that have been deprecated are now removed and the release is binary incompatible. With a bit of work we could make Gtk2Hs compile against Gtk 3. However, we need somebody to get his/her hands dirty on this subject.

  3. Dominic Morneau Says:

    Windows users: don’t forget to install the GTK bundle located here

    http://www.gtk.org/download/win32.php

    (direct: http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.22/gtk+-bundle_2.22.1-20101227_win32.zip )

    After extracting it somewhere, add the bin directory to the system path, then run both commands listed here and everything should work fine. Otherwise, you’ll get messages like: The program pkg-config version >=0.9.0 is required but the version of XXX could not be determined, could not be found, etc.

  4. Matti Nykänen Says:

    I tried to install Gtk2Hs. Since my version is 7.0.3, I tried the two lines above. However, the second line gave (what I think is) a compilation error in “gio”:

    [21 of 24] Compiling System.GIO.Volumes.Drive ( dist/build/System/GIO/Volumes/Drive.hs, dist/build/System/GIO/Volumes/Drive.o )

    System/GIO/Volumes/Drive.chs:59:5:
    Not in scope: type constructor or class `DriveStartStopType’

    System/GIO/Volumes/Drive.chs:60:5:
    Not in scope: type constructor or class `DriveStartFlags’

    Accordingly, at the end I got:

    cabal: Error: some packages failed to install:
    gio-0.12.1 failed during the building phase. The exception was:
    ExitFailure 1
    gtk-0.12.1 depends on gio-0.12.1 which failed to install.

    How could I get Gtk2Hs install? My apologies if this is a wrong place to ask for such assistance.

  5. Axel Says:

    The mailing list is probably more appropriate, yes. But no worries.

    It seems that we’ve forgot to exclude some type definitions that aren’t available in some older gio version. Which version of gio are you using? You can find out by saying:

    pkg-config –modversion gio-2.0

    on the command line.

  6. Roland Says:

    I was able to successfully install gtk2hs-buildtools-0.12.1.tar.gz (First line).

    However, I got the following error, when I tried the second line:

    C:\Temp>cabal install http://code.haskell.org/~duncan/gtk2hs/glib-0.12.1.tar.gz
    http://code.haskell.org/~duncan/gtk2hs/gio-0.12.1.tar.gz http://code.haskell.org
    /~duncan/gtk2hs/pango-0.12.1.tar.gz http://code.haskell.org/~duncan/gtk2hs/cairo
    -0.12.1.tar.gz http://code.haskell.org/~duncan/gtk2hs/gtk-0.12.1.tar.gz
    Downloading http://code.haskell.org/~duncan/gtk2hs/glib-0.12.1.tar.gz
    Downloading http://code.haskell.org/~duncan/gtk2hs/gio-0.12.1.tar.gz
    Downloading http://code.haskell.org/~duncan/gtk2hs/pango-0.12.1.tar.gz
    Downloading http://code.haskell.org/~duncan/gtk2hs/cairo-0.12.1.tar.gz
    Downloading http://code.haskell.org/~duncan/gtk2hs/gtk-0.12.1.tar.gz
    Resolving dependencies…
    : cannot satisfy -package Cabal-1.10.1.0:
    Cabal-1.10.1.0-55f781465ee9f32289755ad706c71f0f is unusable due to missing o
    r recursive dependencies:
    process-1.0.1.5-b3dded8e54a2e13d22af410bdcfafff4
    (use -v for more information)
    : cannot satisfy -package Cabal-1.10.1.0:
    Cabal-1.10.1.0-55f781465ee9f32289755ad706c71f0f is unusable due to missing o
    r recursive dependencies:
    process-1.0.1.5-b3dded8e54a2e13d22af410bdcfafff4
    (use -v for more information)
    cabal: Error: some packages failed to install:
    cairo-0.12.1 failed during the configure step. The exception was:
    ExitFailure 1
    gio-0.12.1 depends on glib-0.12.1 which failed to install.
    glib-0.12.1 failed during the configure step. The exception was:
    ExitFailure 1
    gtk-0.12.1 depends on glib-0.12.1 which failed to install.
    pango-0.12.1 depends on glib-0.12.1 which failed to install.

    C:\Temp>

    What can I do to fix this?
    Many thanks
    Roland

  7. Roland Says:

    Sorry, I forgot to add my versions:
    OS: Windows 7
    D:\Users\Roland>ghc –version
    The Glorious Glasgow Haskell Compilation System, version 7.0.3

    D:\Users\Roland>cabal –version
    cabal-install version 0.10.2
    using version 1.10.1.0 of the Cabal library

  8. Axel Says:

    Can you install anything else that needs cabal 0.10.1.0? It seems that your cabal package is missing a dependency or something. Please do as advised and try to install one of the packages (gio, for example) using the -v flag to see what’s happening.

  9. Roland Says:

    Here is the output of cabal install gio -v:

    C:\Temp>cabal install gio -v
    Reading available packages…
    Resolving dependencies…
    In order, the following would be installed:
    glib-0.12.1 (new package)
    gio-0.12.1 (new package)
    Extracting
    D:\Users\Roland\AppData\Roaming\cabal\packages\hackage.haskell.org\glib.12.1\g
    lib-0.12.1.tar.gz
    to D:\Users\Roland\AppData\Local\Temp\glib-0.12.15484…
    Creating
    D:\Users\Roland\AppData\Local\Temp\glib-0.12.15484\glib-0.12.1\dist\setup (and
    its parents)
    C:\Program Files\Haskell Platform\2011.2.0.1\bin\ghc.exe –make D:\Users\Roland\
    AppData\Local\Temp\glib-0.12.15484\glib-0.12.1\Setup.hs -o D:\Users\Roland\AppDa
    ta\Local\Temp\glib-0.12.15484\glib-0.12.1\dist\setup\setup.exe -odir D:\Users\Ro
    land\AppData\Local\Temp\glib-0.12.15484\glib-0.12.1\dist\setup -hidir D:\Users\R
    oland\AppData\Local\Temp\glib-0.12.15484\glib-0.12.1\dist\setup -i -iD:\Users\Ro
    land\AppData\Local\Temp\glib-0.12.15484\glib-0.12.1 -package Cabal-1.10.1.0
    : cannot satisfy -package Cabal-1.10.1.0:
    Cabal-1.10.1.0-55f781465ee9f32289755ad706c71f0f is unusable due to missing o
    r recursive dependencies:
    process-1.0.1.5-b3dded8e54a2e13d22af410bdcfafff4
    (use -v for more information)
    Updating world file…
    cabal: Error: some packages failed to install:
    gio-0.12.1 depends on glib-0.12.1 which failed to install.
    glib-0.12.1 failed during the configure step. The exception was:
    ExitFailure 1

    What are other packages that need cabal 1.10.1.0 ??

  10. Axel Says:

    I think you need to ask on the cabal or ghc-users mailing list or haskell cafe. This isn’t necessarily a gtk problem. I vaguely remember that there was something about a broken process package.

  11. Matti Nykänen Says:

    Alex asked about my gio version:

    pkg-config –modversion gio-2.0
    2.20.5

  12. Axel Says:

    Hi Matti,

    yes, so your gio version is older than the ones we used. We could either bump the minimum requirement to be gio 2.22 or we can conditionally compile those parts that are only in 2.22. Unless we install an older gio version on our machines, it’s a tad difficult to do. If you’re willing to do it, then we’d be grateful. The infrastructure is all there. All you need to do is to go to those modules that error, put an

    #if GLIB_CHECK_VERSION(2,12,0)

    #endif

    around the definition and the name in the export list. Add a comment to those declaration:

    – * Available in Glib 2.22 and later.

    Add

    {-# LANGUAGE CPP #-}

    as the first line of the module (if not already there). Then compile. You might find more definitions that lack the corresponding C definitions, so you need to repeat the above steps until all compiles. Once done, send use a patch. It might be good to check out the darcs version, then you can send us a darcs patch.

    Axel

  13. Matti Nykänen Says:

    Axel, the problem was as you suspected, and even smaller: the #ifdef…#endif is missing only from around the two DriveStart… types in the export list of System/GIO/Volumes/Drive.chs. Its body is already OK. Now I can compile a working “Hello World” example, so I believe that I now have a working Gtk2Hs. Thank you!

    However, I have never used darcs, and so I don’t know how to make a patch to send you.

  14. Axel Says:

    Ok, I’ve fixed the ifdefs and pushed the patch. It’s not in the repository!

  15. Roland Says:

    Re my problem (see above):
    A “cabal install Cabal-1.10.1.0 –reinstall” did the wonder. I have successfully installed Gtk!
    Many thanks for your help!!

  16. Adriana Says:

    thanks for share!

  17. Andy Says:

    i tried the gtk, downloaded / installed the gtk bundle. i then followed instructions on here to install gtk2hs
    it compiled and linked fine, but then when i try the World demo i get ”
    The procedure entry point g_get_environ could not be located in the dynamic link library libglib-2.0.0.dll”

    i have haskell platform with ghci 7.0.4 installed.
    also when i load World.hs into haskell i get this:
    Loading package gio-0.12.1 … can’t load .so/.DLL for: libgio-2.0-0 (addDLL: could not load DLL)

  18. Andy Says:

    PS im using windows 7

  19. Valentin Says:

    Hi there. I am trying to cabal install cairo but i get this error everytime:

    setup: The pkg-config package cairo-pdf is required but it could not be found.
    cabal: Error: some packages failed to install:
    cairo-0.12.1 failed during the configure step. The exception was:
    ExitFailure 1

    I am using Ubuntu! Any help?

  20. dmwit Says:

    Valentin, you may need to install some cairo library packages through your package manager first. Make sure to select the -dev versions if they’re available!

  21. George Thomas Says:

    I tried the install many times and having the following error on Windows 7.

    ————————————————————————————–
    $ cabal install gtk
    Resolving dependencies…
    [1 of 2] Compiling SetupWrapper ( F:\cygwin\tmp\cairo-0.12.4-1640\cairo-0.12.4\SetupWrapper.hs, F:\cygwin\tmp\cairo-0.12.4-1640\cairo-0.12.4\dist\setup\SetupWrapper.o )
    [2 of 2] Compiling Main ( F:\cygwin\tmp\cairo-0.12.4-1640\cairo-0.12.4\Setup.hs, F:\cygwin\tmp\cairo-0.12.4-1640\cairo-0.12.4\dist\setup\Main.o )
    Linking F:\cygwin\tmp\cairo-0.12.4-1640\cairo-0.12.4\dist\setup\setup.exe …
    [1 of 2] Compiling Gtk2HsSetup ( Gtk2HsSetup.hs, dist\setup-wrapper\Gtk2HsSetup.o )
    [2 of 2] Compiling Main ( SetupMain.hs, dist\setup-wrapper\Main.o )
    Linking dist/setup-wrapper\setup.exe …
    Configuring cairo-0.12.4…
    setup.exe: The pkg-config package cairo-pdf is required but it could not be
    found.

    ————————————————————————————-

    Please feel free to email me for any further information you might need. Thanks for your comments.

Leave a Reply