Hi Duncan, thanks for your positive feedback.
On Apr 21, 2010, at 20:46, Duncan Coutts wrote: > >> When configuring the gtk package, the cabal file will look for Gtk+ >> 2.20 >> which you most likely don't have. You need to specify -f-gtk_2_20 >> for Gtk+ >> 2.18 and -f-gtk_2_20 -f-gtk_2_18 for Gtk+ 2.16 and so on. (I have >> filed a >> feature request that Cabal should be able to infer the best >> possible choice >> of flags for pkg-config requirements. >> http://hackage.haskell.org/trac/hackage/ticket/662 ) > > Yes, it should, however that's not going to happen soon. In the mean > time I've got a better way of doing it in the gtk2hs Setup.hs. I've > got the changes working locally. Just needs a bit of polishing and > testing before I send them in. Basically the approach is to remove all > the gtk_x_y flags and add some code in Setup.hs. It generates the > --tag=gtk-2.xx flags based on the pkgconfig-depends field. > > For example for "pkgconfig-depends: gtk+-2.0" it generates --tag=gtk > --tag=gtk-2.0 --tag=gtk-2.2 etc up to --tag=gtk-2.18, on my machine > since I've got gtk-2.18. It uses the appropriate upper bound depending > on what the user has locally. Similarly for the pango package it uses > --tag=pango --tag=pango-1.0 ... etc > Hm, yes, I think I have briefly considered adding something to Setup.hs. I tried to use the magic of Cabal since it seemed to be the appropriate thing to do (rather than to complicate Setup). What I would really like is to keep the Setup file the same for all Gtk2Hs packages. That way, there is one (very complicated) file less to write for each add-on library. > Also, for the pango package, I've got some code to generate a .h file > with the pango version defines, rather than needing flags for that. > That is a bit tricky since Pango doesn't define its version before a certain version number. This is done in the hspango.h file. But I think you're aware of that. In a nutshell: I'm not quite sure what you mean. I'll wait for the patch. >> When compiling the Setup.hs program, you will see a warning that >> the Cabal >> version is guessed. If compilation succeeds, this warning can be >> ignored. >> (Cabal should really define CPP macros with it's version when it >> builds >> Setup.hs, see http://hackage.haskell.org/trac/hackage/ticket/326 ) > > This is not likely to change until Cabal-2 because currently the > Setup.hs is the primary interface for packages, so it is not possible > to provide extra CPP defines, since people and package managers cannot > be expected to do that even if cabal-install could do. Ah, true. So the future will bring the possibility to specify different Setup.hs files for different Cabal versions?! That's of course also possible. Cheers, Axel. ------------------------------------------------------------------------------ _______________________________________________ Gtk2hs-devel mailing list Gtk2hs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel