Re: [Haskell-cafe] Ease of Haskell development on OS X?

(back to the list) Answers inline: On Mar 21, 2009, at 2:42 PM, Colin Adams wrote:
Yes, that was the problem, and swapping the PATH order does the trick. Thanks.
no prob.
I must still have the macports stuff installed. Can you tell me how to get rid of it?
if you really want to get rid of it I believe you just have to rm -rf / opt/local and remove any initialization hooks for /opt/local out of / etc/profile and ~/.bash_profile
However I still can't install my program - I get missing dependencies for gtk glib cairo and svgcairo.
I'm not really that savvy with the package registration magics -- on my system after doing sudo make install for gtk2hs, I get the packages properly registered. You can check the registered packages with ghc- pkg list. It could be that the package is registered local for your user, but the cabal install line you're using for the application includes --global (or your cabal configuration) so it won't look in the user config. I think Duncan answered some questions about this same problem recently, though I don't have a mailing list reference.
I tried some of the gtk2hs demos - they work, but, for instance, the actionmenu demo does not put the menus up at the top of the screen, so it doesn't look like the framework integration has worked.
Even with the integration everything is still GTK-ish. There's a separate framework that comes with the .dmg called ige-mac-integration that allows applications to meld with the mac environment better, but no gtk2hs bindings for this exist at the moment. Bindings would have to be created, and then you'd have to modify the application to make use of them (presumably with CPP or similar switch to control whether you want mac support, or just plain GTK) -Ross
2009/3/21 Ross Mellgren
: I think there must be a version inconsistency with your GLib framework -- either not the most recent copy of the GTK+ DMG, or your path is flipped around and you're using a ports version.
Run glib-mkenums --version to see what version you have... I have
rmm@Hugo:~/tmpgtk/GLib.framework/Resources/dev/bin$ ./glib-mkenums --version glib-mkenums version glib-2.18.1 glib-mkenums comes with ABSOLUTELY NO WARRANTY. You may redistribute copies of glib-mkenums under the terms of the GNU General Public License which can be found in the GLib source package. Sources, examples and contact information are available at http://www.gtk.org
Particularly, the error you're getting is because your version of glib-mkenums doesn't expand @ENUMPREFIX@ -- if I run glib-mkenums with no arguments, my version reports @ENUMPREFIX@ as a valid subtitution:
rmm@Hugo:~/tmpgtk/GLib.framework/Resources/dev/bin$ ./glib-mkenums Usage: glib-mkenums [options] [files...] --fhead <text> output file header --fprod <text> per input file production --ftail <text> output file trailer --eprod <text> per enum text (produced prior to value itarations) --vhead <text> value header, produced before iterating over enum values --vprod <text> value text, produced for each enum value --vtail <text> value tail, produced after iterating over enum values --comments <text> comment structure --template file template file -h, --help show this help message -v, --version print version informations Production text substitutions: @EnumName@ PrefixTheXEnum @enum_name@ prefix_the_xenum @ENUMNAME@ PREFIX_THE_XENUM @ENUMSHORT@ THE_XENUM @ENUMPREFIX@ PREFIX @VALUENAME@ PREFIX_THE_XVALUE @valuenick@ the-xvalue @type@ either enum or flags @Type@ either Enum or Flags @TYPE@ either ENUM or FLAGS @filename@ name of current input file
Does yours?
You might try moving /Library/Frameworks/GLib.framework/Resources/ dev/bin to the front of your path before make'ing pango --
cd pango-1.24.0 export PATH=/Library/Frameworks/GLib.framework/Resources/dev/bin: $PATH make
Hope this helps,
-Ross
On Mar 21, 2009, at 1:52 PM, Colin Adams wrote:
Attached.
2009/3/21 Ross Mellgren
: (taking this off list, to avoid noise)
Could you attach pango-1.24.0/pango/pango-enum-types.h? Something hokey is going on -- this file is shipped with pango-1.24.0 but may be overwritten if your glib-mkenums does it differently. In any case, since it's (possibly) machine generated I would have to see what's going on at those lines to make progress.
Also, if you could cd pango-1.24.0/pango, and run:
gcc -E -DHAVE_CONFIG_H -I. -I.. -DG_LOG_DOMAIN=\"Pango\" -DPANGO_ENABLE_BACKEND -DPANGO_ENABLE_ENGINE -DSYSCONFDIR=\"/usr/local/etc\" -DLIBDIR=\"/usr/local/lib\" -I.. -DG_DISABLE_CAST_CHECKS -I/Library/Frameworks/GLib.framework/Headers -I/Library/Frameworks/Cairo.framework/Headers -I/usr/X11/ include -DFC_WEIGHT_EXTRABLACK=215 -Wall -MT fonts.lo -MD -MP -MF .deps/fonts.Tpo -c -o fonts.i fonts.c
and attach fonts.i, that might shed more light. However, since the error you're getting is a preprocessor one, gcc -E may fail as well.
-Ross
On Mar 21, 2009, at 1:37 PM, Colin Adams wrote:
In file included from ../pango/pango.h:31, from pango-impl-utils.h:28, from fonts.c:30: ../pango/pango-enum-types.h:12:9: error: macro names must be identifiers ../pango/pango-enum-types.h:14:9: error: macro names must be identifiers ../pango/pango-enum-types.h:17:9: error: macro names must be identifiers ../pango/pango-enum-types.h:19:9: error: macro names must be identifiers ../pango/pango-enum-types.h:22:9: error: macro names must be identifiers ../pango/pango-enum-types.h:25:9: error: macro names must be identifiers ../pango/pango-enum-types.h:27:9: error: macro names must be identifiers ../pango/pango-enum-types.h:29:9: error: macro names must be identifiers ../pango/pango-enum-types.h:31:9: error: macro names must be identifiers ../pango/pango-enum-types.h:33:9: error: macro names must be identifiers ../pango/pango-enum-types.h:36:9: error: macro names must be identifiers ../pango/pango-enum-types.h:38:9: error: macro names must be identifiers ../pango/pango-enum-types.h:41:9: error: macro names must be identifiers ../pango/pango-enum-types.h:43:9: error: macro names must be identifiers ../pango/pango-enum-types.h:45:9: error: macro names must be identifiers ../pango/pango-enum-types.h:48:9: error: macro names must be identifiers ../pango/pango-enum-types.h:51:9: error: macro names must be identifiers ../pango/pango-enum-types.h:54:9: error: macro names must be identifiers In file included from ../pango/pango.h:31, from pango-impl-utils.h:28, from glyphstring.c:26: ../pango/pango-enum-types.h:12:9: error: macro names must be identifiers ../pango/pango-enum-types.h:14:9: error: macro names must be identifiers ../pango/pango-enum-types.h:17:9: error: macro names must be identifiers ../pango/pango-enum-types.h:19:9: error: macro names must be identifiers ../pango/pango-enum-types.h:22:9: error: macro names must be identifiers ../pango/pango-enum-types.h:25:9: error: macro names must be identifiers ../pango/pango-enum-types.h:27:9: error: macro names must be identifiers ../pango/pango-enum-types.h:29:9: error: macro names must be identifiers ../pango/pango-enum-types.h:31:9: error: macro names must be identifiers ../pango/pango-enum-types.h:33:9: error: macro names must be identifiers ../pango/pango-enum-types.h:36:9: error: macro names must be identifiers ../pango/pango-enum-types.h:38:9: error: macro names must be identifiers ../pango/pango-enum-types.h:41:9: error: macro names must be identifiers ../pango/pango-enum-types.h:43:9: error: macro names must be identifiers ../pango/pango-enum-types.h:45:9: error: macro names must be identifiers ../pango/pango-enum-types.h:48:9: error: macro names must be identifiers ../pango/pango-enum-types.h:51:9: error: macro names must be identifiers ../pango/pango-enum-types.h:54:9: error: macro names must be identifiers
2009/3/21 Ross Mellgren
: I didn't get any errors like that (nor do I remember ever having them), though if you want to paste them here maybe I can help with them.
-Ross
On Mar 21, 2009, at 1:27 PM, Colin Adams wrote:
> If I try this, pango fails to compile with lots of error > messages > about error: macro names must be identifiers. > > I think I've seen this before - some well-known Mac OSX > problem? (I'm > a linux man myself - so I'm not used to the mac) > > 2009/3/21 Ross Mellgren
: >> >> I tried making this work, but librsvg requires pango, and >> pango is a >> huge >> pain in the ass -- I managed to get the whole thing to >> compile, but >> now >> it >> can't find any fonts, apparently due to some dynaloading >> issues. >> >> I think if you need any of the extended modules (e.g. >> svgcairo, gl) >> that >> the >> DMG doesn't directly support then you're best served by >> shedding a >> couple >> tears and going with macports. >> >> The steps I used to get the broken version were (FYI -- doing >> this >> causes >> all fonts to load as the no-character square in all gtk2hs >> apps): >> >> export >> >> >> >> PKG_CONFIG_PATH=/usr/X11/lib/pkgconfig:/usr/local/lib/ >> pkgconfig:/Library/Frameworks/Cairo.framework/Resources/dev/ >> lib/pkgconfig:/Library/Frameworks/GLib.framework/Resources/ >> dev/lib/pkgconfig:/Library/Frameworks/Gtk.framework/Resources/ >> dev/lib/pkgconfig >> >> export >> PATH=$PATH:/Library/Frameworks/GLib.framework/Resources/dev/bin >> >> cd pango-1.24.0 >> CFLAGS="-DFC_WEIGHT_EXTRABLACK=215" ./configure --prefix=/usr/ >> local >> make -j4 >> sudo make install >> >> cd librsvg-2.26.0 >> ./configure --prefix=/usr/local >> make -j4 >> sudo make install >> >> cd gtk2hs-0.10.0 >> ./configure --disable-gio >> make -j4 >> sudo make install >> >> Running apps linked with this version of gtk2hs gets: >> >> (svgviewer:43314): Pango-CRITICAL **: No modules found: >> No builtin or dynamically loaded modules were found. >> PangoFc will not work correctly. >> This probably means there was an error in the creation of: >> '/usr/local/etc/pango/pango.modules' >> You should create this file by running: >> pango-querymodules > '/usr/local/etc/pango/pango.modules' >> >> (svgviewer:43314): Pango-WARNING **: failed to choose a font, >> expect >> ugly >> output. engine-type='PangoRenderATSUI', script='latin' >> >> So if anyone knows what Pango is trying to do, maybe they >> could help >> resolve >> this. >> >> I'm probably going to ditch the use of GTK in my own project >> and use >> FFI >> bindings to Carbon/Win32, since I don't really need widgets >> for my >> own >> stuff >> and the whole family of GTK related packages is a total pain >> in the >> ass >> (as >> are most things in the GNU family of software, IMO) >> >> -Ross >> >> On Mar 21, 2009, at 10:13 AM, Colin Paul Adams wrote: >> >>>>>>>> "Ross" == Ross Mellgren writes: >>> >>> Ross> While there is not a .dmg for Gtk2Hs, you can use >>> a .dmg >>> Ross> installed GHC with a .dmg installed Gtk, and then build >>> Ross> gtk2hs straight on top of that, without having to >>> deal with >>> Ross> the dual-GHC macports mess.. >>> >>> Ross> >>> >>> >>> >>> http://www.haskell.org/haskellwiki/Gtk2hs#Using_the_GTK.2B_OS_X_Framework >>> >>> I just tried this. >>> >>> The configure enables cairo, but does not enable svgcairo. >>> Is there >>> anyway round this, or do I have to revert to the macports >>> gtk? (my >>> application uses svgcairo) >>> -- >>> Colin Adams >>> Preston Lancashire >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe@haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >>

OK - I added the --with-user-pkginfo flag.
It nearly all works now - but still no svgcairo - ./configure doesn't find it.
2009/3/21 Ross Mellgren
(back to the list)
Answers inline:
On Mar 21, 2009, at 2:42 PM, Colin Adams wrote:
Yes, that was the problem, and swapping the PATH order does the trick. Thanks.
no prob.
I must still have the macports stuff installed. Can you tell me how to get rid of it?
if you really want to get rid of it I believe you just have to rm -rf /opt/local and remove any initialization hooks for /opt/local out of /etc/profile and ~/.bash_profile
However I still can't install my program - I get missing dependencies for gtk glib cairo and svgcairo.
I'm not really that savvy with the package registration magics -- on my system after doing sudo make install for gtk2hs, I get the packages properly registered. You can check the registered packages with ghc-pkg list. It could be that the package is registered local for your user, but the cabal install line you're using for the application includes --global (or your cabal configuration) so it won't look in the user config.
I think Duncan answered some questions about this same problem recently, though I don't have a mailing list reference.
I tried some of the gtk2hs demos - they work, but, for instance, the actionmenu demo does not put the menus up at the top of the screen, so it doesn't look like the framework integration has worked.
Even with the integration everything is still GTK-ish. There's a separate framework that comes with the .dmg called ige-mac-integration that allows applications to meld with the mac environment better, but no gtk2hs bindings for this exist at the moment. Bindings would have to be created, and then you'd have to modify the application to make use of them (presumably with CPP or similar switch to control whether you want mac support, or just plain GTK)
-Ross
2009/3/21 Ross Mellgren
: I think there must be a version inconsistency with your GLib framework -- either not the most recent copy of the GTK+ DMG, or your path is flipped around and you're using a ports version.
Run glib-mkenums --version to see what version you have... I have
rmm@Hugo:~/tmpgtk/GLib.framework/Resources/dev/bin$ ./glib-mkenums --version glib-mkenums version glib-2.18.1 glib-mkenums comes with ABSOLUTELY NO WARRANTY. You may redistribute copies of glib-mkenums under the terms of the GNU General Public License which can be found in the GLib source package. Sources, examples and contact information are available at http://www.gtk.org
Particularly, the error you're getting is because your version of glib-mkenums doesn't expand @ENUMPREFIX@ -- if I run glib-mkenums with no arguments, my version reports @ENUMPREFIX@ as a valid subtitution:
rmm@Hugo:~/tmpgtk/GLib.framework/Resources/dev/bin$ ./glib-mkenums Usage: glib-mkenums [options] [files...] --fhead <text> output file header --fprod <text> per input file production --ftail <text> output file trailer --eprod <text> per enum text (produced prior to value itarations) --vhead <text> value header, produced before iterating over enum values --vprod <text> value text, produced for each enum value --vtail <text> value tail, produced after iterating over enum values --comments <text> comment structure --template file template file -h, --help show this help message -v, --version print version informations Production text substitutions: @EnumName@ PrefixTheXEnum @enum_name@ prefix_the_xenum @ENUMNAME@ PREFIX_THE_XENUM @ENUMSHORT@ THE_XENUM @ENUMPREFIX@ PREFIX @VALUENAME@ PREFIX_THE_XVALUE @valuenick@ the-xvalue @type@ either enum or flags @Type@ either Enum or Flags @TYPE@ either ENUM or FLAGS @filename@ name of current input file
Does yours?
You might try moving /Library/Frameworks/GLib.framework/Resources/dev/bin to the front of your path before make'ing pango --
cd pango-1.24.0 export PATH=/Library/Frameworks/GLib.framework/Resources/dev/bin:$PATH make
Hope this helps,
-Ross
On Mar 21, 2009, at 1:52 PM, Colin Adams wrote:
Attached.
2009/3/21 Ross Mellgren
: (taking this off list, to avoid noise)
Could you attach pango-1.24.0/pango/pango-enum-types.h? Something hokey is going on -- this file is shipped with pango-1.24.0 but may be overwritten if your glib-mkenums does it differently. In any case, since it's (possibly) machine generated I would have to see what's going on at those lines to make progress.
Also, if you could cd pango-1.24.0/pango, and run:
gcc -E -DHAVE_CONFIG_H -I. -I.. -DG_LOG_DOMAIN=\"Pango\" -DPANGO_ENABLE_BACKEND -DPANGO_ENABLE_ENGINE -DSYSCONFDIR=\"/usr/local/etc\" -DLIBDIR=\"/usr/local/lib\" -I.. -DG_DISABLE_CAST_CHECKS -I/Library/Frameworks/GLib.framework/Headers -I/Library/Frameworks/Cairo.framework/Headers -I/usr/X11/include -DFC_WEIGHT_EXTRABLACK=215 -Wall -MT fonts.lo -MD -MP -MF .deps/fonts.Tpo -c -o fonts.i fonts.c
and attach fonts.i, that might shed more light. However, since the error you're getting is a preprocessor one, gcc -E may fail as well.
-Ross
On Mar 21, 2009, at 1:37 PM, Colin Adams wrote:
In file included from ../pango/pango.h:31, from pango-impl-utils.h:28, from fonts.c:30: ../pango/pango-enum-types.h:12:9: error: macro names must be identifiers ../pango/pango-enum-types.h:14:9: error: macro names must be identifiers ../pango/pango-enum-types.h:17:9: error: macro names must be identifiers ../pango/pango-enum-types.h:19:9: error: macro names must be identifiers ../pango/pango-enum-types.h:22:9: error: macro names must be identifiers ../pango/pango-enum-types.h:25:9: error: macro names must be identifiers ../pango/pango-enum-types.h:27:9: error: macro names must be identifiers ../pango/pango-enum-types.h:29:9: error: macro names must be identifiers ../pango/pango-enum-types.h:31:9: error: macro names must be identifiers ../pango/pango-enum-types.h:33:9: error: macro names must be identifiers ../pango/pango-enum-types.h:36:9: error: macro names must be identifiers ../pango/pango-enum-types.h:38:9: error: macro names must be identifiers ../pango/pango-enum-types.h:41:9: error: macro names must be identifiers ../pango/pango-enum-types.h:43:9: error: macro names must be identifiers ../pango/pango-enum-types.h:45:9: error: macro names must be identifiers ../pango/pango-enum-types.h:48:9: error: macro names must be identifiers ../pango/pango-enum-types.h:51:9: error: macro names must be identifiers ../pango/pango-enum-types.h:54:9: error: macro names must be identifiers In file included from ../pango/pango.h:31, from pango-impl-utils.h:28, from glyphstring.c:26: ../pango/pango-enum-types.h:12:9: error: macro names must be identifiers ../pango/pango-enum-types.h:14:9: error: macro names must be identifiers ../pango/pango-enum-types.h:17:9: error: macro names must be identifiers ../pango/pango-enum-types.h:19:9: error: macro names must be identifiers ../pango/pango-enum-types.h:22:9: error: macro names must be identifiers ../pango/pango-enum-types.h:25:9: error: macro names must be identifiers ../pango/pango-enum-types.h:27:9: error: macro names must be identifiers ../pango/pango-enum-types.h:29:9: error: macro names must be identifiers ../pango/pango-enum-types.h:31:9: error: macro names must be identifiers ../pango/pango-enum-types.h:33:9: error: macro names must be identifiers ../pango/pango-enum-types.h:36:9: error: macro names must be identifiers ../pango/pango-enum-types.h:38:9: error: macro names must be identifiers ../pango/pango-enum-types.h:41:9: error: macro names must be identifiers ../pango/pango-enum-types.h:43:9: error: macro names must be identifiers ../pango/pango-enum-types.h:45:9: error: macro names must be identifiers ../pango/pango-enum-types.h:48:9: error: macro names must be identifiers ../pango/pango-enum-types.h:51:9: error: macro names must be identifiers ../pango/pango-enum-types.h:54:9: error: macro names must be identifiers
2009/3/21 Ross Mellgren
: > > I didn't get any errors like that (nor do I remember ever having > them), > though if you want to paste them here maybe I can help with them. > > -Ross > > On Mar 21, 2009, at 1:27 PM, Colin Adams wrote: > >> If I try this, pango fails to compile with lots of error messages >> about error: macro names must be identifiers. >> >> I think I've seen this before - some well-known Mac OSX problem? >> (I'm >> a linux man myself - so I'm not used to the mac) >> >> 2009/3/21 Ross Mellgren : >>> >>> I tried making this work, but librsvg requires pango, and pango is >>> a >>> huge >>> pain in the ass -- I managed to get the whole thing to compile, but >>> now >>> it >>> can't find any fonts, apparently due to some dynaloading issues. >>> >>> I think if you need any of the extended modules (e.g. svgcairo, gl) >>> that >>> the >>> DMG doesn't directly support then you're best served by shedding a >>> couple >>> tears and going with macports. >>> >>> The steps I used to get the broken version were (FYI -- doing this >>> causes >>> all fonts to load as the no-character square in all gtk2hs apps): >>> >>> export >>> >>> >>> >>> >>> PKG_CONFIG_PATH=/usr/X11/lib/pkgconfig:/usr/local/lib/pkgconfig:/Library/Frameworks/Cairo.framework/Resources/dev/lib/pkgconfig:/Library/Frameworks/GLib.framework/Resources/dev/lib/pkgconfig:/Library/Frameworks/Gtk.framework/Resources/dev/lib/pkgconfig >>> >>> export >>> PATH=$PATH:/Library/Frameworks/GLib.framework/Resources/dev/bin >>> >>> cd pango-1.24.0 >>> CFLAGS="-DFC_WEIGHT_EXTRABLACK=215" ./configure --prefix=/usr/local >>> make -j4 >>> sudo make install >>> >>> cd librsvg-2.26.0 >>> ./configure --prefix=/usr/local >>> make -j4 >>> sudo make install >>> >>> cd gtk2hs-0.10.0 >>> ./configure --disable-gio >>> make -j4 >>> sudo make install >>> >>> Running apps linked with this version of gtk2hs gets: >>> >>> (svgviewer:43314): Pango-CRITICAL **: No modules found: >>> No builtin or dynamically loaded modules were found. >>> PangoFc will not work correctly. >>> This probably means there was an error in the creation of: >>> '/usr/local/etc/pango/pango.modules' >>> You should create this file by running: >>> pango-querymodules > '/usr/local/etc/pango/pango.modules' >>> >>> (svgviewer:43314): Pango-WARNING **: failed to choose a font, >>> expect >>> ugly >>> output. engine-type='PangoRenderATSUI', script='latin' >>> >>> So if anyone knows what Pango is trying to do, maybe they could >>> help >>> resolve >>> this. >>> >>> I'm probably going to ditch the use of GTK in my own project and >>> use >>> FFI >>> bindings to Carbon/Win32, since I don't really need widgets for my >>> own >>> stuff >>> and the whole family of GTK related packages is a total pain in the >>> ass >>> (as >>> are most things in the GNU family of software, IMO) >>> >>> -Ross >>> >>> On Mar 21, 2009, at 10:13 AM, Colin Paul Adams wrote: >>> >>>>>>>>> "Ross" == Ross Mellgren writes: >>>> >>>> Ross> While there is not a .dmg for Gtk2Hs, you can use a .dmg >>>> Ross> installed GHC with a .dmg installed Gtk, and then build >>>> Ross> gtk2hs straight on top of that, without having to deal with >>>> Ross> the dual-GHC macports mess.. >>>> >>>> Ross> >>>> >>>> >>>> >>>> >>>> http://www.haskell.org/haskellwiki/Gtk2hs#Using_the_GTK.2B_OS_X_Framework >>>> >>>> I just tried this. >>>> >>>> The configure enables cairo, but does not enable svgcairo. Is >>>> there >>>> anyway round this, or do I have to revert to the macports gtk? (my >>>> application uses svgcairo) >>>> -- >>>> Colin Adams >>>> Preston Lancashire >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe@haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> > >

Did the configure for gtk2hs claim that it was going to build svgcairo? If something is wrong with the librsvg install, it won't. -Ross On Mar 21, 2009, at 4:49 PM, Colin Adams wrote:
OK - I added the --with-user-pkginfo flag. It nearly all works now - but still no svgcairo - ./configure doesn't find it.
2009/3/21 Ross Mellgren
: (back to the list)
Answers inline:
On Mar 21, 2009, at 2:42 PM, Colin Adams wrote:
Yes, that was the problem, and swapping the PATH order does the trick. Thanks.
no prob.
I must still have the macports stuff installed. Can you tell me how to get rid of it?
if you really want to get rid of it I believe you just have to rm -rf /opt/local and remove any initialization hooks for /opt/local out of /etc/profile and ~/.bash_profile
However I still can't install my program - I get missing dependencies for gtk glib cairo and svgcairo.
I'm not really that savvy with the package registration magics -- on my system after doing sudo make install for gtk2hs, I get the packages properly registered. You can check the registered packages with ghc-pkg list. It could be that the package is registered local for your user, but the cabal install line you're using for the application includes --global (or your cabal configuration) so it won't look in the user config.
I think Duncan answered some questions about this same problem recently, though I don't have a mailing list reference.
I tried some of the gtk2hs demos - they work, but, for instance, the actionmenu demo does not put the menus up at the top of the screen, so it doesn't look like the framework integration has worked.
Even with the integration everything is still GTK-ish. There's a separate framework that comes with the .dmg called ige-mac-integration that allows applications to meld with the mac environment better, but no gtk2hs bindings for this exist at the moment. Bindings would have to be created, and then you'd have to modify the application to make use of them (presumably with CPP or similar switch to control whether you want mac support, or just plain GTK)
-Ross
2009/3/21 Ross Mellgren
: I think there must be a version inconsistency with your GLib framework -- either not the most recent copy of the GTK+ DMG, or your path is flipped around and you're using a ports version.
Run glib-mkenums --version to see what version you have... I have
rmm@Hugo:~/tmpgtk/GLib.framework/Resources/dev/bin$ ./glib-mkenums --version glib-mkenums version glib-2.18.1 glib-mkenums comes with ABSOLUTELY NO WARRANTY. You may redistribute copies of glib-mkenums under the terms of the GNU General Public License which can be found in the GLib source package. Sources, examples and contact information are available at http://www.gtk.org
Particularly, the error you're getting is because your version of glib-mkenums doesn't expand @ENUMPREFIX@ -- if I run glib-mkenums with no arguments, my version reports @ENUMPREFIX@ as a valid subtitution:
rmm@Hugo:~/tmpgtk/GLib.framework/Resources/dev/bin$ ./glib-mkenums Usage: glib-mkenums [options] [files...] --fhead <text> output file header --fprod <text> per input file production --ftail <text> output file trailer --eprod <text> per enum text (produced prior to value itarations) --vhead <text> value header, produced before iterating over enum values --vprod <text> value text, produced for each enum value --vtail <text> value tail, produced after iterating over enum values --comments <text> comment structure --template file template file -h, --help show this help message -v, --version print version informations Production text substitutions: @EnumName@ PrefixTheXEnum @enum_name@ prefix_the_xenum @ENUMNAME@ PREFIX_THE_XENUM @ENUMSHORT@ THE_XENUM @ENUMPREFIX@ PREFIX @VALUENAME@ PREFIX_THE_XVALUE @valuenick@ the-xvalue @type@ either enum or flags @Type@ either Enum or Flags @TYPE@ either ENUM or FLAGS @filename@ name of current input file
Does yours?
You might try moving /Library/Frameworks/GLib.framework/Resources/ dev/bin to the front of your path before make'ing pango --
cd pango-1.24.0 export PATH=/Library/Frameworks/GLib.framework/Resources/dev/bin: $PATH make
Hope this helps,
-Ross
On Mar 21, 2009, at 1:52 PM, Colin Adams wrote:
Attached.
2009/3/21 Ross Mellgren
: (taking this off list, to avoid noise)
Could you attach pango-1.24.0/pango/pango-enum-types.h? Something hokey is going on -- this file is shipped with pango-1.24.0 but may be overwritten if your glib-mkenums does it differently. In any case, since it's (possibly) machine generated I would have to see what's going on at those lines to make progress.
Also, if you could cd pango-1.24.0/pango, and run:
gcc -E -DHAVE_CONFIG_H -I. -I.. -DG_LOG_DOMAIN=\"Pango\" -DPANGO_ENABLE_BACKEND -DPANGO_ENABLE_ENGINE -DSYSCONFDIR=\"/usr/local/etc\" -DLIBDIR=\"/usr/local/lib\" -I.. -DG_DISABLE_CAST_CHECKS -I/Library/Frameworks/GLib.framework/Headers -I/Library/Frameworks/Cairo.framework/Headers -I/usr/X11/ include -DFC_WEIGHT_EXTRABLACK=215 -Wall -MT fonts.lo -MD -MP -MF .deps/fonts.Tpo -c -o fonts.i fonts.c
and attach fonts.i, that might shed more light. However, since the error you're getting is a preprocessor one, gcc -E may fail as well.
-Ross
On Mar 21, 2009, at 1:37 PM, Colin Adams wrote:
> In file included from ../pango/pango.h:31, > from pango-impl-utils.h:28, > from fonts.c:30: > ../pango/pango-enum-types.h:12:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:14:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:17:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:19:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:22:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:25:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:27:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:29:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:31:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:33:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:36:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:38:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:41:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:43:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:45:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:48:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:51:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:54:9: error: macro names must be > identifiers > In file included from ../pango/pango.h:31, > from pango-impl-utils.h:28, > from glyphstring.c:26: > ../pango/pango-enum-types.h:12:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:14:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:17:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:19:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:22:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:25:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:27:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:29:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:31:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:33:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:36:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:38:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:41:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:43:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:45:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:48:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:51:9: error: macro names must be > identifiers > ../pango/pango-enum-types.h:54:9: error: macro names must be > identifiers > > > 2009/3/21 Ross Mellgren
: >> >> I didn't get any errors like that (nor do I remember ever >> having >> them), >> though if you want to paste them here maybe I can help with >> them. >> >> -Ross >> >> On Mar 21, 2009, at 1:27 PM, Colin Adams wrote: >> >>> If I try this, pango fails to compile with lots of error >>> messages >>> about error: macro names must be identifiers. >>> >>> I think I've seen this before - some well-known Mac OSX >>> problem? >>> (I'm >>> a linux man myself - so I'm not used to the mac) >>> >>> 2009/3/21 Ross Mellgren : >>>> >>>> I tried making this work, but librsvg requires pango, and >>>> pango is >>>> a >>>> huge >>>> pain in the ass -- I managed to get the whole thing to >>>> compile, but >>>> now >>>> it >>>> can't find any fonts, apparently due to some dynaloading >>>> issues. >>>> >>>> I think if you need any of the extended modules (e.g. >>>> svgcairo, gl) >>>> that >>>> the >>>> DMG doesn't directly support then you're best served by >>>> shedding a >>>> couple >>>> tears and going with macports. >>>> >>>> The steps I used to get the broken version were (FYI -- >>>> doing this >>>> causes >>>> all fonts to load as the no-character square in all gtk2hs >>>> apps): >>>> >>>> export >>>> >>>> >>>> >>>> >>>> PKG_CONFIG_PATH=/usr/X11/lib/pkgconfig:/usr/local/lib/ >>>> pkgconfig:/Library/Frameworks/Cairo.framework/Resources/dev/ >>>> lib/pkgconfig:/Library/Frameworks/GLib.framework/Resources/ >>>> dev/lib/pkgconfig:/Library/Frameworks/Gtk.framework/ >>>> Resources/dev/lib/pkgconfig >>>> >>>> export >>>> PATH=$PATH:/Library/Frameworks/GLib.framework/Resources/dev/ >>>> bin >>>> >>>> cd pango-1.24.0 >>>> CFLAGS="-DFC_WEIGHT_EXTRABLACK=215" ./configure --prefix=/ >>>> usr/local >>>> make -j4 >>>> sudo make install >>>> >>>> cd librsvg-2.26.0 >>>> ./configure --prefix=/usr/local >>>> make -j4 >>>> sudo make install >>>> >>>> cd gtk2hs-0.10.0 >>>> ./configure --disable-gio >>>> make -j4 >>>> sudo make install >>>> >>>> Running apps linked with this version of gtk2hs gets: >>>> >>>> (svgviewer:43314): Pango-CRITICAL **: No modules found: >>>> No builtin or dynamically loaded modules were found. >>>> PangoFc will not work correctly. >>>> This probably means there was an error in the creation of: >>>> '/usr/local/etc/pango/pango.modules' >>>> You should create this file by running: >>>> pango-querymodules > '/usr/local/etc/pango/pango.modules' >>>> >>>> (svgviewer:43314): Pango-WARNING **: failed to choose a font, >>>> expect >>>> ugly >>>> output. engine-type='PangoRenderATSUI', script='latin' >>>> >>>> So if anyone knows what Pango is trying to do, maybe they >>>> could >>>> help >>>> resolve >>>> this. >>>> >>>> I'm probably going to ditch the use of GTK in my own >>>> project and >>>> use >>>> FFI >>>> bindings to Carbon/Win32, since I don't really need widgets >>>> for my >>>> own >>>> stuff >>>> and the whole family of GTK related packages is a total >>>> pain in the >>>> ass >>>> (as >>>> are most things in the GNU family of software, IMO) >>>> >>>> -Ross >>>> >>>> On Mar 21, 2009, at 10:13 AM, Colin Paul Adams wrote: >>>> >>>>>>>>>> "Ross" == Ross Mellgren writes: >>>>> >>>>> Ross> While there is not a .dmg for Gtk2Hs, you can use >>>>> a .dmg >>>>> Ross> installed GHC with a .dmg installed Gtk, and then >>>>> build >>>>> Ross> gtk2hs straight on top of that, without having to >>>>> deal with >>>>> Ross> the dual-GHC macports mess.. >>>>> >>>>> Ross> >>>>> >>>>> >>>>> >>>>> >>>>> http://www.haskell.org/haskellwiki/Gtk2hs#Using_the_GTK.2B_OS_X_Framework >>>>> >>>>> I just tried this. >>>>> >>>>> The configure enables cairo, but does not enable svgcairo. >>>>> Is >>>>> there >>>>> anyway round this, or do I have to revert to the macports >>>>> gtk? (my >>>>> application uses svgcairo) >>>>> -- >>>>> Colin Adams >>>>> Preston Lancashire >>>> >>>> _______________________________________________ >>>> Haskell-Cafe mailing list >>>> Haskell-Cafe@haskell.org >>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>>> >> >>

It didn't.
2009/3/21 Ross Mellgren
Did the configure for gtk2hs claim that it was going to build svgcairo? If something is wrong with the librsvg install, it won't.
-Ross
On Mar 21, 2009, at 4:49 PM, Colin Adams wrote:
OK - I added the --with-user-pkginfo flag. It nearly all works now - but still no svgcairo - ./configure doesn't find it.
2009/3/21 Ross Mellgren
: (back to the list)
Answers inline:
On Mar 21, 2009, at 2:42 PM, Colin Adams wrote:
Yes, that was the problem, and swapping the PATH order does the trick. Thanks.
no prob.
I must still have the macports stuff installed. Can you tell me how to get rid of it?
if you really want to get rid of it I believe you just have to rm -rf /opt/local and remove any initialization hooks for /opt/local out of /etc/profile and ~/.bash_profile
However I still can't install my program - I get missing dependencies for gtk glib cairo and svgcairo.
I'm not really that savvy with the package registration magics -- on my system after doing sudo make install for gtk2hs, I get the packages properly registered. You can check the registered packages with ghc-pkg list. It could be that the package is registered local for your user, but the cabal install line you're using for the application includes --global (or your cabal configuration) so it won't look in the user config.
I think Duncan answered some questions about this same problem recently, though I don't have a mailing list reference.
I tried some of the gtk2hs demos - they work, but, for instance, the actionmenu demo does not put the menus up at the top of the screen, so it doesn't look like the framework integration has worked.
Even with the integration everything is still GTK-ish. There's a separate framework that comes with the .dmg called ige-mac-integration that allows applications to meld with the mac environment better, but no gtk2hs bindings for this exist at the moment. Bindings would have to be created, and then you'd have to modify the application to make use of them (presumably with CPP or similar switch to control whether you want mac support, or just plain GTK)
-Ross
2009/3/21 Ross Mellgren
: I think there must be a version inconsistency with your GLib framework -- either not the most recent copy of the GTK+ DMG, or your path is flipped around and you're using a ports version.
Run glib-mkenums --version to see what version you have... I have
rmm@Hugo:~/tmpgtk/GLib.framework/Resources/dev/bin$ ./glib-mkenums --version glib-mkenums version glib-2.18.1 glib-mkenums comes with ABSOLUTELY NO WARRANTY. You may redistribute copies of glib-mkenums under the terms of the GNU General Public License which can be found in the GLib source package. Sources, examples and contact information are available at http://www.gtk.org
Particularly, the error you're getting is because your version of glib-mkenums doesn't expand @ENUMPREFIX@ -- if I run glib-mkenums with no arguments, my version reports @ENUMPREFIX@ as a valid subtitution:
rmm@Hugo:~/tmpgtk/GLib.framework/Resources/dev/bin$ ./glib-mkenums Usage: glib-mkenums [options] [files...] --fhead <text> output file header --fprod <text> per input file production --ftail <text> output file trailer --eprod <text> per enum text (produced prior to value itarations) --vhead <text> value header, produced before iterating over enum values --vprod <text> value text, produced for each enum value --vtail <text> value tail, produced after iterating over enum values --comments <text> comment structure --template file template file -h, --help show this help message -v, --version print version informations Production text substitutions: @EnumName@ PrefixTheXEnum @enum_name@ prefix_the_xenum @ENUMNAME@ PREFIX_THE_XENUM @ENUMSHORT@ THE_XENUM @ENUMPREFIX@ PREFIX @VALUENAME@ PREFIX_THE_XVALUE @valuenick@ the-xvalue @type@ either enum or flags @Type@ either Enum or Flags @TYPE@ either ENUM or FLAGS @filename@ name of current input file
Does yours?
You might try moving /Library/Frameworks/GLib.framework/Resources/dev/bin to the front of your path before make'ing pango --
cd pango-1.24.0 export PATH=/Library/Frameworks/GLib.framework/Resources/dev/bin:$PATH make
Hope this helps,
-Ross
On Mar 21, 2009, at 1:52 PM, Colin Adams wrote:
Attached.
2009/3/21 Ross Mellgren
: > > (taking this off list, to avoid noise) > > Could you attach pango-1.24.0/pango/pango-enum-types.h? Something > hokey > is > going on -- this file is shipped with pango-1.24.0 but may be > overwritten > if > your glib-mkenums does it differently. In any case, since it's > (possibly) > machine generated I would have to see what's going on at those lines > to > make > progress. > > Also, if you could cd pango-1.24.0/pango, and run: > > gcc -E -DHAVE_CONFIG_H -I. -I.. -DG_LOG_DOMAIN=\"Pango\" > -DPANGO_ENABLE_BACKEND -DPANGO_ENABLE_ENGINE > -DSYSCONFDIR=\"/usr/local/etc\" > -DLIBDIR=\"/usr/local/lib\" -I.. -DG_DISABLE_CAST_CHECKS > -I/Library/Frameworks/GLib.framework/Headers > -I/Library/Frameworks/Cairo.framework/Headers -I/usr/X11/include > -DFC_WEIGHT_EXTRABLACK=215 -Wall -MT fonts.lo -MD -MP -MF > .deps/fonts.Tpo > -c -o fonts.i fonts.c > > and attach fonts.i, that might shed more light. However, since the > error > you're getting is a preprocessor one, gcc -E may fail as well. > > -Ross > > On Mar 21, 2009, at 1:37 PM, Colin Adams wrote: > >> In file included from ../pango/pango.h:31, >> from pango-impl-utils.h:28, >> from fonts.c:30: >> ../pango/pango-enum-types.h:12:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:14:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:17:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:19:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:22:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:25:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:27:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:29:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:31:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:33:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:36:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:38:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:41:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:43:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:45:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:48:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:51:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:54:9: error: macro names must be >> identifiers >> In file included from ../pango/pango.h:31, >> from pango-impl-utils.h:28, >> from glyphstring.c:26: >> ../pango/pango-enum-types.h:12:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:14:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:17:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:19:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:22:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:25:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:27:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:29:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:31:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:33:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:36:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:38:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:41:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:43:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:45:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:48:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:51:9: error: macro names must be >> identifiers >> ../pango/pango-enum-types.h:54:9: error: macro names must be >> identifiers >> >> >> 2009/3/21 Ross Mellgren : >>> >>> I didn't get any errors like that (nor do I remember ever having >>> them), >>> though if you want to paste them here maybe I can help with them. >>> >>> -Ross >>> >>> On Mar 21, 2009, at 1:27 PM, Colin Adams wrote: >>> >>>> If I try this, pango fails to compile with lots of error messages >>>> about error: macro names must be identifiers. >>>> >>>> I think I've seen this before - some well-known Mac OSX problem? >>>> (I'm >>>> a linux man myself - so I'm not used to the mac) >>>> >>>> 2009/3/21 Ross Mellgren : >>>>> >>>>> I tried making this work, but librsvg requires pango, and pango >>>>> is >>>>> a >>>>> huge >>>>> pain in the ass -- I managed to get the whole thing to compile, >>>>> but >>>>> now >>>>> it >>>>> can't find any fonts, apparently due to some dynaloading issues. >>>>> >>>>> I think if you need any of the extended modules (e.g. svgcairo, >>>>> gl) >>>>> that >>>>> the >>>>> DMG doesn't directly support then you're best served by shedding >>>>> a >>>>> couple >>>>> tears and going with macports. >>>>> >>>>> The steps I used to get the broken version were (FYI -- doing >>>>> this >>>>> causes >>>>> all fonts to load as the no-character square in all gtk2hs apps): >>>>> >>>>> export >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> PKG_CONFIG_PATH=/usr/X11/lib/pkgconfig:/usr/local/lib/pkgconfig:/Library/Frameworks/Cairo.framework/Resources/dev/lib/pkgconfig:/Library/Frameworks/GLib.framework/Resources/dev/lib/pkgconfig:/Library/Frameworks/Gtk.framework/Resources/dev/lib/pkgconfig >>>>> >>>>> export >>>>> PATH=$PATH:/Library/Frameworks/GLib.framework/Resources/dev/bin >>>>> >>>>> cd pango-1.24.0 >>>>> CFLAGS="-DFC_WEIGHT_EXTRABLACK=215" ./configure >>>>> --prefix=/usr/local >>>>> make -j4 >>>>> sudo make install >>>>> >>>>> cd librsvg-2.26.0 >>>>> ./configure --prefix=/usr/local >>>>> make -j4 >>>>> sudo make install >>>>> >>>>> cd gtk2hs-0.10.0 >>>>> ./configure --disable-gio >>>>> make -j4 >>>>> sudo make install >>>>> >>>>> Running apps linked with this version of gtk2hs gets: >>>>> >>>>> (svgviewer:43314): Pango-CRITICAL **: No modules found: >>>>> No builtin or dynamically loaded modules were found. >>>>> PangoFc will not work correctly. >>>>> This probably means there was an error in the creation of: >>>>> '/usr/local/etc/pango/pango.modules' >>>>> You should create this file by running: >>>>> pango-querymodules > '/usr/local/etc/pango/pango.modules' >>>>> >>>>> (svgviewer:43314): Pango-WARNING **: failed to choose a font, >>>>> expect >>>>> ugly >>>>> output. engine-type='PangoRenderATSUI', script='latin' >>>>> >>>>> So if anyone knows what Pango is trying to do, maybe they could >>>>> help >>>>> resolve >>>>> this. >>>>> >>>>> I'm probably going to ditch the use of GTK in my own project and >>>>> use >>>>> FFI >>>>> bindings to Carbon/Win32, since I don't really need widgets for >>>>> my >>>>> own >>>>> stuff >>>>> and the whole family of GTK related packages is a total pain in >>>>> the >>>>> ass >>>>> (as >>>>> are most things in the GNU family of software, IMO) >>>>> >>>>> -Ross >>>>> >>>>> On Mar 21, 2009, at 10:13 AM, Colin Paul Adams wrote: >>>>> >>>>>>>>>>> "Ross" == Ross Mellgren writes: >>>>>> >>>>>> Ross> While there is not a .dmg for Gtk2Hs, you can use a .dmg >>>>>> Ross> installed GHC with a .dmg installed Gtk, and then build >>>>>> Ross> gtk2hs straight on top of that, without having to deal >>>>>> with >>>>>> Ross> the dual-GHC macports mess.. >>>>>> >>>>>> Ross> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> http://www.haskell.org/haskellwiki/Gtk2hs#Using_the_GTK.2B_OS_X_Framework >>>>>> >>>>>> I just tried this. >>>>>> >>>>>> The configure enables cairo, but does not enable svgcairo. Is >>>>>> there >>>>>> anyway round this, or do I have to revert to the macports gtk? >>>>>> (my >>>>>> application uses svgcairo) >>>>>> -- >>>>>> Colin Adams >>>>>> Preston Lancashire >>>>> >>>>> _______________________________________________ >>>>> Haskell-Cafe mailing list >>>>> Haskell-Cafe@haskell.org >>>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>>>> >>> >>> > >

And the reason is that librsvg fails to find cairo, pangocairo and cairo-png.
Where is it supposed to find them?
2009/3/21 Colin Adams
It didn't.
2009/3/21 Ross Mellgren
: Did the configure for gtk2hs claim that it was going to build svgcairo? If something is wrong with the librsvg install, it won't.
-Ross
On Mar 21, 2009, at 4:49 PM, Colin Adams wrote:
OK - I added the --with-user-pkginfo flag. It nearly all works now - but still no svgcairo - ./configure doesn't find it.
2009/3/21 Ross Mellgren
: (back to the list)
Answers inline:
On Mar 21, 2009, at 2:42 PM, Colin Adams wrote:
Yes, that was the problem, and swapping the PATH order does the trick. Thanks.
no prob.
I must still have the macports stuff installed. Can you tell me how to get rid of it?
if you really want to get rid of it I believe you just have to rm -rf /opt/local and remove any initialization hooks for /opt/local out of /etc/profile and ~/.bash_profile
However I still can't install my program - I get missing dependencies for gtk glib cairo and svgcairo.
I'm not really that savvy with the package registration magics -- on my system after doing sudo make install for gtk2hs, I get the packages properly registered. You can check the registered packages with ghc-pkg list. It could be that the package is registered local for your user, but the cabal install line you're using for the application includes --global (or your cabal configuration) so it won't look in the user config.
I think Duncan answered some questions about this same problem recently, though I don't have a mailing list reference.
I tried some of the gtk2hs demos - they work, but, for instance, the actionmenu demo does not put the menus up at the top of the screen, so it doesn't look like the framework integration has worked.
Even with the integration everything is still GTK-ish. There's a separate framework that comes with the .dmg called ige-mac-integration that allows applications to meld with the mac environment better, but no gtk2hs bindings for this exist at the moment. Bindings would have to be created, and then you'd have to modify the application to make use of them (presumably with CPP or similar switch to control whether you want mac support, or just plain GTK)
-Ross
2009/3/21 Ross Mellgren
: I think there must be a version inconsistency with your GLib framework -- either not the most recent copy of the GTK+ DMG, or your path is flipped around and you're using a ports version.
Run glib-mkenums --version to see what version you have... I have
rmm@Hugo:~/tmpgtk/GLib.framework/Resources/dev/bin$ ./glib-mkenums --version glib-mkenums version glib-2.18.1 glib-mkenums comes with ABSOLUTELY NO WARRANTY. You may redistribute copies of glib-mkenums under the terms of the GNU General Public License which can be found in the GLib source package. Sources, examples and contact information are available at http://www.gtk.org
Particularly, the error you're getting is because your version of glib-mkenums doesn't expand @ENUMPREFIX@ -- if I run glib-mkenums with no arguments, my version reports @ENUMPREFIX@ as a valid subtitution:
rmm@Hugo:~/tmpgtk/GLib.framework/Resources/dev/bin$ ./glib-mkenums Usage: glib-mkenums [options] [files...] --fhead <text> output file header --fprod <text> per input file production --ftail <text> output file trailer --eprod <text> per enum text (produced prior to value itarations) --vhead <text> value header, produced before iterating over enum values --vprod <text> value text, produced for each enum value --vtail <text> value tail, produced after iterating over enum values --comments <text> comment structure --template file template file -h, --help show this help message -v, --version print version informations Production text substitutions: @EnumName@ PrefixTheXEnum @enum_name@ prefix_the_xenum @ENUMNAME@ PREFIX_THE_XENUM @ENUMSHORT@ THE_XENUM @ENUMPREFIX@ PREFIX @VALUENAME@ PREFIX_THE_XVALUE @valuenick@ the-xvalue @type@ either enum or flags @Type@ either Enum or Flags @TYPE@ either ENUM or FLAGS @filename@ name of current input file
Does yours?
You might try moving /Library/Frameworks/GLib.framework/Resources/dev/bin to the front of your path before make'ing pango --
cd pango-1.24.0 export PATH=/Library/Frameworks/GLib.framework/Resources/dev/bin:$PATH make
Hope this helps,
-Ross
On Mar 21, 2009, at 1:52 PM, Colin Adams wrote:
> Attached. > > > > 2009/3/21 Ross Mellgren
: >> >> (taking this off list, to avoid noise) >> >> Could you attach pango-1.24.0/pango/pango-enum-types.h? Something >> hokey >> is >> going on -- this file is shipped with pango-1.24.0 but may be >> overwritten >> if >> your glib-mkenums does it differently. In any case, since it's >> (possibly) >> machine generated I would have to see what's going on at those lines >> to >> make >> progress. >> >> Also, if you could cd pango-1.24.0/pango, and run: >> >> gcc -E -DHAVE_CONFIG_H -I. -I.. -DG_LOG_DOMAIN=\"Pango\" >> -DPANGO_ENABLE_BACKEND -DPANGO_ENABLE_ENGINE >> -DSYSCONFDIR=\"/usr/local/etc\" >> -DLIBDIR=\"/usr/local/lib\" -I.. -DG_DISABLE_CAST_CHECKS >> -I/Library/Frameworks/GLib.framework/Headers >> -I/Library/Frameworks/Cairo.framework/Headers -I/usr/X11/include >> -DFC_WEIGHT_EXTRABLACK=215 -Wall -MT fonts.lo -MD -MP -MF >> .deps/fonts.Tpo >> -c -o fonts.i fonts.c >> >> and attach fonts.i, that might shed more light. However, since the >> error >> you're getting is a preprocessor one, gcc -E may fail as well. >> >> -Ross >> >> On Mar 21, 2009, at 1:37 PM, Colin Adams wrote: >> >>> In file included from ../pango/pango.h:31, >>> from pango-impl-utils.h:28, >>> from fonts.c:30: >>> ../pango/pango-enum-types.h:12:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:14:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:17:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:19:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:22:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:25:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:27:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:29:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:31:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:33:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:36:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:38:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:41:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:43:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:45:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:48:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:51:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:54:9: error: macro names must be >>> identifiers >>> In file included from ../pango/pango.h:31, >>> from pango-impl-utils.h:28, >>> from glyphstring.c:26: >>> ../pango/pango-enum-types.h:12:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:14:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:17:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:19:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:22:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:25:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:27:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:29:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:31:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:33:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:36:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:38:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:41:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:43:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:45:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:48:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:51:9: error: macro names must be >>> identifiers >>> ../pango/pango-enum-types.h:54:9: error: macro names must be >>> identifiers >>> >>> >>> 2009/3/21 Ross Mellgren : >>>> >>>> I didn't get any errors like that (nor do I remember ever having >>>> them), >>>> though if you want to paste them here maybe I can help with them. >>>> >>>> -Ross >>>> >>>> On Mar 21, 2009, at 1:27 PM, Colin Adams wrote: >>>> >>>>> If I try this, pango fails to compile with lots of error messages >>>>> about error: macro names must be identifiers. >>>>> >>>>> I think I've seen this before - some well-known Mac OSX problem? >>>>> (I'm >>>>> a linux man myself - so I'm not used to the mac) >>>>> >>>>> 2009/3/21 Ross Mellgren : >>>>>> >>>>>> I tried making this work, but librsvg requires pango, and pango >>>>>> is >>>>>> a >>>>>> huge >>>>>> pain in the ass -- I managed to get the whole thing to compile, >>>>>> but >>>>>> now >>>>>> it >>>>>> can't find any fonts, apparently due to some dynaloading issues. >>>>>> >>>>>> I think if you need any of the extended modules (e.g. svgcairo, >>>>>> gl) >>>>>> that >>>>>> the >>>>>> DMG doesn't directly support then you're best served by shedding >>>>>> a >>>>>> couple >>>>>> tears and going with macports. >>>>>> >>>>>> The steps I used to get the broken version were (FYI -- doing >>>>>> this >>>>>> causes >>>>>> all fonts to load as the no-character square in all gtk2hs apps): >>>>>> >>>>>> export >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> PKG_CONFIG_PATH=/usr/X11/lib/pkgconfig:/usr/local/lib/pkgconfig:/Library/Frameworks/Cairo.framework/Resources/dev/lib/pkgconfig:/Library/Frameworks/GLib.framework/Resources/dev/lib/pkgconfig:/Library/Frameworks/Gtk.framework/Resources/dev/lib/pkgconfig >>>>>> >>>>>> export >>>>>> PATH=$PATH:/Library/Frameworks/GLib.framework/Resources/dev/bin >>>>>> >>>>>> cd pango-1.24.0 >>>>>> CFLAGS="-DFC_WEIGHT_EXTRABLACK=215" ./configure >>>>>> --prefix=/usr/local >>>>>> make -j4 >>>>>> sudo make install >>>>>> >>>>>> cd librsvg-2.26.0 >>>>>> ./configure --prefix=/usr/local >>>>>> make -j4 >>>>>> sudo make install >>>>>> >>>>>> cd gtk2hs-0.10.0 >>>>>> ./configure --disable-gio >>>>>> make -j4 >>>>>> sudo make install >>>>>> >>>>>> Running apps linked with this version of gtk2hs gets: >>>>>> >>>>>> (svgviewer:43314): Pango-CRITICAL **: No modules found: >>>>>> No builtin or dynamically loaded modules were found. >>>>>> PangoFc will not work correctly. >>>>>> This probably means there was an error in the creation of: >>>>>> '/usr/local/etc/pango/pango.modules' >>>>>> You should create this file by running: >>>>>> pango-querymodules > '/usr/local/etc/pango/pango.modules' >>>>>> >>>>>> (svgviewer:43314): Pango-WARNING **: failed to choose a font, >>>>>> expect >>>>>> ugly >>>>>> output. engine-type='PangoRenderATSUI', script='latin' >>>>>> >>>>>> So if anyone knows what Pango is trying to do, maybe they could >>>>>> help >>>>>> resolve >>>>>> this. >>>>>> >>>>>> I'm probably going to ditch the use of GTK in my own project and >>>>>> use >>>>>> FFI >>>>>> bindings to Carbon/Win32, since I don't really need widgets for >>>>>> my >>>>>> own >>>>>> stuff >>>>>> and the whole family of GTK related packages is a total pain in >>>>>> the >>>>>> ass >>>>>> (as >>>>>> are most things in the GNU family of software, IMO) >>>>>> >>>>>> -Ross >>>>>> >>>>>> On Mar 21, 2009, at 10:13 AM, Colin Paul Adams wrote: >>>>>> >>>>>>>>>>>> "Ross" == Ross Mellgren writes: >>>>>>> >>>>>>> Ross> While there is not a .dmg for Gtk2Hs, you can use a .dmg >>>>>>> Ross> installed GHC with a .dmg installed Gtk, and then build >>>>>>> Ross> gtk2hs straight on top of that, without having to deal >>>>>>> with >>>>>>> Ross> the dual-GHC macports mess.. >>>>>>> >>>>>>> Ross> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> http://www.haskell.org/haskellwiki/Gtk2hs#Using_the_GTK.2B_OS_X_Framework >>>>>>> >>>>>>> I just tried this. >>>>>>> >>>>>>> The configure enables cairo, but does not enable svgcairo. Is >>>>>>> there >>>>>>> anyway round this, or do I have to revert to the macports gtk? >>>>>>> (my >>>>>>> application uses svgcairo) >>>>>>> -- >>>>>>> Colin Adams >>>>>>> Preston Lancashire >>>>>> >>>>>> _______________________________________________ >>>>>> Haskell-Cafe mailing list >>>>>> Haskell-Cafe@haskell.org >>>>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>>>>> >>>> >>>> >> >> >

Should be from pkg-config path, make sure your PKG_CONFIG_PATH is set to include /Library/Frameworks/{GLib,Gtk,Cairo}.framework Also, I had a problem where it couldn't find libpng -- I had to add / usr/X11/lib/pkgconfig to my pkg-config path. -Ross On Mar 21, 2009, at 5:02 PM, Colin Adams wrote:
And the reason is that librsvg fails to find cairo, pangocairo and cairo-png.
Where is it supposed to find them?
2009/3/21 Colin Adams
: It didn't.
2009/3/21 Ross Mellgren
: Did the configure for gtk2hs claim that it was going to build svgcairo? If something is wrong with the librsvg install, it won't.
-Ross
On Mar 21, 2009, at 4:49 PM, Colin Adams wrote:
OK - I added the --with-user-pkginfo flag. It nearly all works now - but still no svgcairo - ./configure doesn't find it.
2009/3/21 Ross Mellgren
: (back to the list)
Answers inline:
On Mar 21, 2009, at 2:42 PM, Colin Adams wrote:
Yes, that was the problem, and swapping the PATH order does the trick. Thanks.
no prob.
I must still have the macports stuff installed. Can you tell me how to get rid of it?
if you really want to get rid of it I believe you just have to rm -rf /opt/local and remove any initialization hooks for /opt/local out of /etc/profile and ~/.bash_profile
However I still can't install my program - I get missing dependencies for gtk glib cairo and svgcairo.
I'm not really that savvy with the package registration magics -- on my system after doing sudo make install for gtk2hs, I get the packages properly registered. You can check the registered packages with ghc-pkg list. It could be that the package is registered local for your user, but the cabal install line you're using for the application includes --global (or your cabal configuration) so it won't look in the user config.
I think Duncan answered some questions about this same problem recently, though I don't have a mailing list reference.
I tried some of the gtk2hs demos - they work, but, for instance, the actionmenu demo does not put the menus up at the top of the screen, so it doesn't look like the framework integration has worked.
Even with the integration everything is still GTK-ish. There's a separate framework that comes with the .dmg called ige-mac-integration that allows applications to meld with the mac environment better, but no gtk2hs bindings for this exist at the moment. Bindings would have to be created, and then you'd have to modify the application to make use of them (presumably with CPP or similar switch to control whether you want mac support, or just plain GTK)
-Ross
2009/3/21 Ross Mellgren
: > > I think there must be a version inconsistency with your GLib > framework > -- > either not the most recent copy of the GTK+ DMG, or your path is > flipped > around and you're using a ports version. > > Run glib-mkenums --version to see what version you have... I > have > > rmm@Hugo:~/tmpgtk/GLib.framework/Resources/dev/bin$ ./glib- > mkenums > --version > glib-mkenums version glib-2.18.1 > glib-mkenums comes with ABSOLUTELY NO WARRANTY. > You may redistribute copies of glib-mkenums under the terms of > the GNU General Public License which can be found in the > GLib source package. Sources, examples and contact > information are available at http://www.gtk.org > > Particularly, the error you're getting is because your version > of > glib-mkenums doesn't expand @ENUMPREFIX@ -- if I run glib- > mkenums with > no > arguments, my version reports @ENUMPREFIX@ as a valid > subtitution: > > rmm@Hugo:~/tmpgtk/GLib.framework/Resources/dev/bin$ ./glib- > mkenums > Usage: glib-mkenums [options] [files...] > --fhead <text> output file header > --fprod <text> per input file production > --ftail <text> output file trailer > --eprod <text> per enum text (produced prior to > value > itarations) > --vhead <text> value header, produced before > iterating > over > enum values > --vprod <text> value text, produced for each enum > value > --vtail <text> value tail, produced after > iterating over > enum > values > --comments <text> comment structure > --template file template file > -h, --help show this help message > -v, --version print version informations > Production text substitutions: > @EnumName@ PrefixTheXEnum > @enum_name@ prefix_the_xenum > @ENUMNAME@ PREFIX_THE_XENUM > @ENUMSHORT@ THE_XENUM > @ENUMPREFIX@ PREFIX > @VALUENAME@ PREFIX_THE_XVALUE > @valuenick@ the-xvalue > @type@ either enum or flags > @Type@ either Enum or Flags > @TYPE@ either ENUM or FLAGS > @filename@ name of current input file > > > Does yours? > > You might try moving > /Library/Frameworks/GLib.framework/Resources/dev/bin > to > the front of your path before make'ing pango -- > > cd pango-1.24.0 > export PATH=/Library/Frameworks/GLib.framework/Resources/dev/ > bin:$PATH > make > > Hope this helps, > > -Ross > > On Mar 21, 2009, at 1:52 PM, Colin Adams wrote: > >> Attached. >> >> >> >> 2009/3/21 Ross Mellgren : >>> >>> (taking this off list, to avoid noise) >>> >>> Could you attach pango-1.24.0/pango/pango-enum-types.h? >>> Something >>> hokey >>> is >>> going on -- this file is shipped with pango-1.24.0 but may be >>> overwritten >>> if >>> your glib-mkenums does it differently. In any case, since it's >>> (possibly) >>> machine generated I would have to see what's going on at >>> those lines >>> to >>> make >>> progress. >>> >>> Also, if you could cd pango-1.24.0/pango, and run: >>> >>> gcc -E -DHAVE_CONFIG_H -I. -I.. -DG_LOG_DOMAIN=\"Pango\" >>> -DPANGO_ENABLE_BACKEND -DPANGO_ENABLE_ENGINE >>> -DSYSCONFDIR=\"/usr/local/etc\" >>> -DLIBDIR=\"/usr/local/lib\" -I.. -DG_DISABLE_CAST_CHECKS >>> -I/Library/Frameworks/GLib.framework/Headers >>> -I/Library/Frameworks/Cairo.framework/Headers -I/usr/X11/ >>> include >>> -DFC_WEIGHT_EXTRABLACK=215 -Wall -MT fonts.lo -MD -MP -MF >>> .deps/fonts.Tpo >>> -c -o fonts.i fonts.c >>> >>> and attach fonts.i, that might shed more light. However, >>> since the >>> error >>> you're getting is a preprocessor one, gcc -E may fail as well. >>> >>> -Ross >>> >>> On Mar 21, 2009, at 1:37 PM, Colin Adams wrote: >>> >>>> In file included from ../pango/pango.h:31, >>>> from pango-impl-utils.h:28, >>>> from fonts.c:30: >>>> ../pango/pango-enum-types.h:12:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:14:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:17:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:19:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:22:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:25:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:27:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:29:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:31:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:33:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:36:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:38:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:41:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:43:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:45:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:48:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:51:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:54:9: error: macro names must be >>>> identifiers >>>> In file included from ../pango/pango.h:31, >>>> from pango-impl-utils.h:28, >>>> from glyphstring.c:26: >>>> ../pango/pango-enum-types.h:12:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:14:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:17:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:19:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:22:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:25:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:27:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:29:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:31:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:33:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:36:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:38:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:41:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:43:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:45:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:48:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:51:9: error: macro names must be >>>> identifiers >>>> ../pango/pango-enum-types.h:54:9: error: macro names must be >>>> identifiers >>>> >>>> >>>> 2009/3/21 Ross Mellgren : >>>>> >>>>> I didn't get any errors like that (nor do I remember ever >>>>> having >>>>> them), >>>>> though if you want to paste them here maybe I can help >>>>> with them. >>>>> >>>>> -Ross >>>>> >>>>> On Mar 21, 2009, at 1:27 PM, Colin Adams wrote: >>>>> >>>>>> If I try this, pango fails to compile with lots of error >>>>>> messages >>>>>> about error: macro names must be identifiers. >>>>>> >>>>>> I think I've seen this before - some well-known Mac OSX >>>>>> problem? >>>>>> (I'm >>>>>> a linux man myself - so I'm not used to the mac) >>>>>> >>>>>> 2009/3/21 Ross Mellgren : >>>>>>> >>>>>>> I tried making this work, but librsvg requires pango, >>>>>>> and pango >>>>>>> is >>>>>>> a >>>>>>> huge >>>>>>> pain in the ass -- I managed to get the whole thing to >>>>>>> compile, >>>>>>> but >>>>>>> now >>>>>>> it >>>>>>> can't find any fonts, apparently due to some dynaloading >>>>>>> issues. >>>>>>> >>>>>>> I think if you need any of the extended modules (e.g. >>>>>>> svgcairo, >>>>>>> gl) >>>>>>> that >>>>>>> the >>>>>>> DMG doesn't directly support then you're best served by >>>>>>> shedding >>>>>>> a >>>>>>> couple >>>>>>> tears and going with macports. >>>>>>> >>>>>>> The steps I used to get the broken version were (FYI -- >>>>>>> doing >>>>>>> this >>>>>>> causes >>>>>>> all fonts to load as the no-character square in all >>>>>>> gtk2hs apps): >>>>>>> >>>>>>> export >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> PKG_CONFIG_PATH=/usr/X11/lib/pkgconfig:/usr/local/lib/ >>>>>>> pkgconfig:/Library/Frameworks/Cairo.framework/Resources/ >>>>>>> dev/lib/pkgconfig:/Library/Frameworks/GLib.framework/ >>>>>>> Resources/dev/lib/pkgconfig:/Library/Frameworks/ >>>>>>> Gtk.framework/Resources/dev/lib/pkgconfig >>>>>>> >>>>>>> export >>>>>>> PATH=$PATH:/Library/Frameworks/GLib.framework/Resources/ >>>>>>> dev/bin >>>>>>> >>>>>>> cd pango-1.24.0 >>>>>>> CFLAGS="-DFC_WEIGHT_EXTRABLACK=215" ./configure >>>>>>> --prefix=/usr/local >>>>>>> make -j4 >>>>>>> sudo make install >>>>>>> >>>>>>> cd librsvg-2.26.0 >>>>>>> ./configure --prefix=/usr/local >>>>>>> make -j4 >>>>>>> sudo make install >>>>>>> >>>>>>> cd gtk2hs-0.10.0 >>>>>>> ./configure --disable-gio >>>>>>> make -j4 >>>>>>> sudo make install >>>>>>> >>>>>>> Running apps linked with this version of gtk2hs gets: >>>>>>> >>>>>>> (svgviewer:43314): Pango-CRITICAL **: No modules found: >>>>>>> No builtin or dynamically loaded modules were found. >>>>>>> PangoFc will not work correctly. >>>>>>> This probably means there was an error in the creation of: >>>>>>> '/usr/local/etc/pango/pango.modules' >>>>>>> You should create this file by running: >>>>>>> pango-querymodules > '/usr/local/etc/pango/pango.modules' >>>>>>> >>>>>>> (svgviewer:43314): Pango-WARNING **: failed to choose a >>>>>>> font, >>>>>>> expect >>>>>>> ugly >>>>>>> output. engine-type='PangoRenderATSUI', script='latin' >>>>>>> >>>>>>> So if anyone knows what Pango is trying to do, maybe >>>>>>> they could >>>>>>> help >>>>>>> resolve >>>>>>> this. >>>>>>> >>>>>>> I'm probably going to ditch the use of GTK in my own >>>>>>> project and >>>>>>> use >>>>>>> FFI >>>>>>> bindings to Carbon/Win32, since I don't really need >>>>>>> widgets for >>>>>>> my >>>>>>> own >>>>>>> stuff >>>>>>> and the whole family of GTK related packages is a total >>>>>>> pain in >>>>>>> the >>>>>>> ass >>>>>>> (as >>>>>>> are most things in the GNU family of software, IMO) >>>>>>> >>>>>>> -Ross >>>>>>> >>>>>>> On Mar 21, 2009, at 10:13 AM, Colin Paul Adams wrote: >>>>>>> >>>>>>>>>>>>> "Ross" == Ross Mellgren >>>>>>>>>>>>> writes: >>>>>>>> >>>>>>>> Ross> While there is not a .dmg for Gtk2Hs, you can >>>>>>>> use a .dmg >>>>>>>> Ross> installed GHC with a .dmg installed Gtk, and >>>>>>>> then build >>>>>>>> Ross> gtk2hs straight on top of that, without having >>>>>>>> to deal >>>>>>>> with >>>>>>>> Ross> the dual-GHC macports mess.. >>>>>>>> >>>>>>>> Ross> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> http://www.haskell.org/haskellwiki/Gtk2hs#Using_the_GTK.2B_OS_X_Framework >>>>>>>> >>>>>>>> I just tried this. >>>>>>>> >>>>>>>> The configure enables cairo, but does not enable >>>>>>>> svgcairo. Is >>>>>>>> there >>>>>>>> anyway round this, or do I have to revert to the >>>>>>>> macports gtk? >>>>>>>> (my >>>>>>>> application uses svgcairo) >>>>>>>> -- >>>>>>>> Colin Adams >>>>>>>> Preston Lancashire >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Haskell-Cafe mailing list >>>>>>> Haskell-Cafe@haskell.org >>>>>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>>>>>> >>>>> >>>>> >>> >>> >> > >

Ross Mellgren
>>>>>>>>>
Way too many, definitely. -- (c) this sig last receiving data processing entity. Inspect headers for copyright history. All rights reserved. Copying, hiring, renting, performance and/or quoting of this signature prohibited.

OK, I got it installed, but build warned me of duplicate dylibs, and running my program gave a bus error. So I port uninstalled gtk2, so now it compiled without warnings, but the program won't run because I had been forced to uninstall pangoft to uninstall gtk2. So now I need to uninstall the gtk framework - how do I do that? Then i can re-install the macports version and have a working system again.

On 22 Mar 2009, at 10:28, Colin Adams wrote:
OK, I got it installed, but build warned me of duplicate dylibs, and running my program gave a bus error.
So I port uninstalled gtk2, so now it compiled without warnings, but the program won't run because I had been forced to uninstall pangoft to uninstall gtk2.
So now I need to uninstall the gtk framework - how do I do that?
Then i can re-install the macports version and have a working system again.
You might move it out of the way: sudo mv /opt /opt1 and then move it back. To get rid of ports altogether, sudo rm -rf /opt (But be careful so you type right when removing as root, as errors can screw up the whole installation.) I looked up my records - I compiled gtk2hs, and as was remarked, the one in MacPorts (but not gtk2 alone) insists on installing its own GHC. When taking down the sources (external to MacPorts) of gtk2hs, the .tgz ones worked, but the sources from the archive caused some problems with autoconf - despite intense discussions also on the gtk2hs list, this problem was left unresolved. The libraries might cause problems when compiling, because even if a libpath is included in the compile, if there are system ones available, then may be used - a GCC quirk. So in such cases, one might have to edit the libpath so that the system libraries are not at all there, moving selected one out of the way, using libtools or something. This is very technical, though. Hans Aberg

I tried issuing the sudo port install command on the wiki page.
After some time running it failed with:
To fully complete your installation and make python 2.5 the default, please run
sudo port install python_select
sudo python_select python25
---> Cleaning python25
---> Fetching py25-hashlib
---> Attempting to fetch Python-2.5.2.tar.bz2 from
http://www.python.org/ftp/python/2.5.2/
---> Verifying checksum(s) for py25-hashlib
---> Extracting py25-hashlib
---> Configuring py25-hashlib
---> Building py25-hashlib with target build
Error: Target org.macports.build returned: shell command " cd
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py25-hashlib/work/Python-2.5.2/Modules"
&& /opt/local/bin/python2.5 setup.py build " returned error 1
Command output: running build
running build_ext
building '_hashlib' extension
creating build
creating build/temp.macosx-10.3-i386-2.5
-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/local/include
-I/opt/local/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5
-c _hashopenssl.c -o build/temp.macosx-10.3-i386-2.5/_hashopenssl.o
unable to execute -DNDEBUG: No such file or directory
error: command '-DNDEBUG' failed with exit status 1
Error: The following dependencies failed to build: gtk-doc
gnome-doc-utils iso-codes py25-hashlib libxslt py25-gobject
py25-libxml2 py25-numeric rarian getopt gtk2 cairo jasper pango
hicolor-icon-theme libgnomeui gnome-icon-theme icon-naming-utils
p5-xml-simple p5-xml-namespacesupport p5-xml-sax gnome-keyring
autoconf help2man p5-locale-gettext m4 gconf libgcrypt libgpg-error
libtasn1 libbonoboui gnome-vfs libglade2 libgnome esound
libgnomecanvas
Error: Status 1 encountered during processing.
Which is singularly uninformative to me. It looks like I am not going
to be able to do any haskell programming next week when I am away with
only a macbook.
2009/3/22 Hans Aberg
On 22 Mar 2009, at 10:28, Colin Adams wrote:
OK, I got it installed, but build warned me of duplicate dylibs, and running my program gave a bus error.
So I port uninstalled gtk2, so now it compiled without warnings, but the program won't run because I had been forced to uninstall pangoft to uninstall gtk2.
So now I need to uninstall the gtk framework - how do I do that?
Then i can re-install the macports version and have a working system again.
You might move it out of the way: sudo mv /opt /opt1 and then move it back. To get rid of ports altogether, sudo rm -rf /opt (But be careful so you type right when removing as root, as errors can screw up the whole installation.)
I looked up my records - I compiled gtk2hs, and as was remarked, the one in MacPorts (but not gtk2 alone) insists on installing its own GHC. When taking down the sources (external to MacPorts) of gtk2hs, the .tgz ones worked, but the sources from the archive caused some problems with autoconf - despite intense discussions also on the gtk2hs list, this problem was left unresolved.
The libraries might cause problems when compiling, because even if a libpath is included in the compile, if there are system ones available, then may be used - a GCC quirk. So in such cases, one might have to edit the libpath so that the system libraries are not at all there, moving selected one out of the way, using libtools or something. This is very technical, though.
Hans Aberg

Colin Adams
-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/local/include -I/opt/local/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c _hashopenssl.c -o build/temp.macosx-10.3-i386-2.5/_hashopenssl.o unable to execute -DNDEBUG: No such file or directory
That's just flags, preceded by no command (or, rather, -DNDEBUG is interpreted as a command, which doesn't make much sense). My crystal ball says that the build script is dodgy and just tries to execute $(CC) or something, which isn't set. You can investigate the script and fix it, or complain with the python (or macports, whatever is appropriate) guys. -- (c) this sig last receiving data processing entity. Inspect headers for copyright history. All rights reserved. Copying, hiring, renting, performance and/or quoting of this signature prohibited.

On 22 Mar 2009, at 11:32, Colin Adams wrote:
creating build/temp.macosx-10.3-i386-2.5 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/local/include -I/opt/local/Library/Frameworks/Python.framework/Versions/2.5/ include/python2.5 -c _hashopenssl.c -o build/temp.macosx-10.3-i386-2.5/_hashopenssl.o unable to execute -DNDEBUG: No such file or directory error: command '-DNDEBUG' failed with exit status 1
A search on the Apple site says it is a compile option used to remove assert(): http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/asse... The first line mentions macosx-10.3 - do you have a compiler for an old system, or something? And I have a fairly recent python: $ python --version Python 2.5.1 $ which python /usr/bin/python Make sure to sign up (for free) as a developer at developer.apple.com and take down latest Xcode (mine is Version 3.1.2, though I do not know if it is the absolutely latest). Hans Aberg

No. It's all recent.
2009/3/22 Hans Aberg
On 22 Mar 2009, at 11:32, Colin Adams wrote:
creating build/temp.macosx-10.3-i386-2.5 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/local/include
-I/opt/local/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c _hashopenssl.c -o build/temp.macosx-10.3-i386-2.5/_hashopenssl.o unable to execute -DNDEBUG: No such file or directory error: command '-DNDEBUG' failed with exit status 1
A search on the Apple site says it is a compile option used to remove assert(): http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/asse...
The first line mentions macosx-10.3 - do you have a compiler for an old system, or something?
And I have a fairly recent python: $ python --version Python 2.5.1 $ which python /usr/bin/python
Make sure to sign up (for free) as a developer at developer.apple.com and take down latest Xcode (mine is Version 3.1.2, though I do not know if it is the absolutely latest).
Hans Aberg

On 22 Mar 2009, at 12:45, Colin Adams wrote:
No. It's all recent.
And MacPorts installs its own gcc. Achim Scheider pointed out that the compiler name is missing, so the shell tries to execute '-DNDEBUG' as a program. When I try it, I get: $ sudo port install python_select Password: ---> Fetching python_select ---> Attempting to fetch select-0.2.1.tar.gz from http://arn.se.distfiles.macports.org/python_select ---> Verifying checksum(s) for python_select ---> Extracting python_select ---> Configuring python_select ---> Building python_select ---> Staging python_select into destroot ---> Installing python_select @0.2.1_0+darwin_9 ---> Activating python_select @0.2.1_0+darwin_9 ---> Cleaning python_select $ sudo python_select python25 Selecting version "python25" for python Which perhaps only means that I already have it installed. But I also get this: $ which python /opt/local/bin/python $ python --version Python 2.5.1 $ /usr/bin/python --version Python 2.5.1 The version you tried to install is 2.5.2 - perhaps there is a script problem, then. Hans

On 22 Mar 2009, at 11:32, Colin Adams wrote:
I tried issuing the sudo port install command on the wiki page.
What did you try to install? ...
After some time running it failed with:
To fully complete your installation and make python 2.5 the default, please run
sudo port install python_select sudo python_select python25
...The thing is that when I removed python_select and python, there remains a $ /opt/local/bin/python --version Python 2.5.1 So your package somehow needs 2.5.2, which may be the culprit. Hans

2009/3/22 Hans Aberg
On 22 Mar 2009, at 11:32, Colin Adams wrote:
I tried issuing the sudo port install command on the wiki page.
What did you try to install? ...
Just what it says on the wiki page: sudo port install glade3 libglade2 gstreamer gst-plugins-base gtksourceview cairo librsvg gtkglext firefox
After some time running it failed with:
To fully complete your installation and make python 2.5 the default, please run
sudo port install python_select sudo python_select python25
...The thing is that when I removed python_select and python, there remains a $ /opt/local/bin/python --version Python 2.5.1 So your package somehow needs 2.5.2, which may be the culprit.
Which package? None of them are mine.

On 22 Mar 2009, at 13:42, Colin Adams wrote:
After some time running it failed with:
To fully complete your installation and make python 2.5 the default, please run
sudo port install python_select sudo python_select python25
...The thing is that when I removed python_select and python, there remains a $ /opt/local/bin/python --version Python 2.5.1 So your package somehow needs 2.5.2, which may be the culprit.
Which package? None of them are mine.
One of the packages you tried to install asked for this, in this list:
Just what it says on the wiki page:
sudo port install glade3 libglade2 gstreamer gst-plugins-base gtksourceview cairo librsvg gtkglext firefox
Looking into your post:
---> Cleaning python25 ---> Fetching py25-hashlib ---> Attempting to fetch Python-2.5.2.tar.bz2 from http://www.python.org/ftp/python/2.5.2/ ---> Verifying checksum(s) for py25-hashlib ---> Extracting py25-hashlib ---> Configuring py25-hashlib ---> Building py25-hashlib with target build Error: Target org.macports.build returned: shell command " cd it is py25-hashlib that is the culprit.
I was able to install it. Then I got a later Python:
---> Attempting to fetch Python-2.5.4.tar.bz2 from http://arn.se.distfiles.macports.org/python25
The procedure followed was (do a 'sudo -s' so save writing: First uninstall python25 and dependencies: # port uninstall python25 ---> Unable to uninstall python25 2.5.2_5+darwin_8, the following ports depend on it: ---> py25-gobject ---> py25-numeric ---> gstreamer # port uninstall gstreamer@0.10.19_0 ---> Deactivating gstreamer @0.10.19_0 ---> Uninstalling gstreamer @0.10.19_0 # port uninstall gstreamer@0.10.8_0 ---> Uninstalling gstreamer @0.10.8_0 # port uninstall py25-gobject ---> Deactivating py25-gobject @2.14.2_0 ---> Uninstalling py25-gobject @2.14.2_0 # port uninstall py25-numeric ---> Deactivating py25-numeric @24.2_1+macosx ---> Uninstalling py25-numeric @24.2_1+macosx # sudo port uninstall python25 Then I noticed there was an unregistered python - those seems to confuse MacPorts. OS move it: # cd /opt/local/bin/ # mv python python1 Then I installed python_select and python25: # port install python_select ---> Fetching python_select ---> Verifying checksum(s) for python_select ---> Extracting python_select ---> Configuring python_select ---> Building python_select ---> Staging python_select into destroot ---> Installing python_select @0.2.1_0+darwin_9 ---> Activating python_select @0.2.1_0+darwin_9 ---> Cleaning python_select bash-3.2# port install python25 ---> Fetching python25 ---> Attempting to fetch Python-2.5.4.tar.bz2 from http://arn.se.distfiles.macports.org/python25 ---> Verifying checksum(s) for python25 ---> Extracting python25 ---> Applying patches to python25 ---> Configuring python25 ---> Building python25 ---> Staging python25 into destroot ---> Installing python25 @2.5.4_0+darwin_9+macosx ---> Activating python25 @2.5.4_0+darwin_9+macosx To fully complete your installation and make python 2.5 the default, please run sudo port install python_select sudo python_select python25 ---> Cleaning python25 After that follow the instructions: # sudo port install python_select Skipping org.macports.activate (python_select +darwin_9) since this port is already active ---> Cleaning python_select # sudo python_select python25 Selecting version "python25" for python And finally to py25-hashlib: # port install py25-hashlib Portfile changed since last build; discarding previous state. ---> Fetching openssl ---> Attempting to fetch openssl-0.9.8j.tar.gz from http://arn.se.distfiles.macports.org/openssl ---> Verifying checksum(s) for openssl ---> Extracting openssl ---> Applying patches to openssl ---> Configuring openssl ---> Building openssl ---> Staging openssl into destroot ---> Installing openssl @0.9.8j_0 ---> Activating openssl @0.9.8j_0 Error: Target org.macports.activate returned: Image error: /opt/local/ share/man/man3/bn_print.3.gz already exists and does not belong to a registered port. Unable to activate port openssl. Error: The following dependencies failed to build: openssl Error: Status 1 encountered during processing. So here I just remove the unregistered file: # rm /opt/local/share/man/man3/bn_print.3.gz # port activate openssl @0.9.8j_0 ---> Activating openssl @0.9.8j_0 So now it worked. Try py25-hashlib again: # port install py25-hashlib ---> Fetching py25-hashlib ---> Verifying checksum(s) for py25-hashlib ---> Extracting py25-hashlib ---> Configuring py25-hashlib ---> Building py25-hashlib ---> Staging py25-hashlib into destroot ---> Installing py25-hashlib @2.5.4_0 ---> Activating py25-hashlib @2.5.4_0 ---> Cleaning py25-hashlib So now I git t installed. - I got beyond the point where you got stuck. Hans

On 2009 Mar 22, at 6:32, Colin Adams wrote:
creating build/temp.macosx-10.3-i386-2.5 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/local/include -I/opt/local/Library/Frameworks/Python.framework/Versions/2.5/ include/python2.5 -c _hashopenssl.c -o build/temp.macosx-10.3-i386-2.5/_hashopenssl.o unable to execute -DNDEBUG: No such file or directory error: command '-DNDEBUG' failed with exit status 1
I recall seeing that with an old version of MacPorts; have you run "sudo port sync" recently? (Or better, "sudo port selfupdate".) -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

No, I haven't done that - I forgot about that command since I first
installed macports nearly a year ago. :-(
Bit I DID manage to get the ports all installed (thanks to lots of
help from Hans, and lots of individual port uninstalls followed by
port installs). And configured gtk2hs ok.
But when I type make, I get (after a lot of compiling):
No rule to make target `glib/System/Glib/GObject_stub.p_o needed by' ...
I shall try again without enmabling profiling support.
2009/3/22 Brandon S. Allbery KF8NH
On 2009 Mar 22, at 6:32, Colin Adams wrote:
creating build/temp.macosx-10.3-i386-2.5 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/local/include
-I/opt/local/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c _hashopenssl.c -o build/temp.macosx-10.3-i386-2.5/_hashopenssl.o unable to execute -DNDEBUG: No such file or directory error: command '-DNDEBUG' failed with exit status 1
I recall seeing that with an old version of MacPorts; have you run "sudo port sync" recently? (Or better, "sudo port selfupdate".)
-- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

2009/3/22 Colin Adams
No, I haven't done that - I forgot about that command since I first installed macports nearly a year ago. :-(
Bit I DID manage to get the ports all installed (thanks to lots of help from Hans, and lots of individual port uninstalls followed by port installs). And configured gtk2hs ok.
But when I type make, I get (after a lot of compiling):
No rule to make target `glib/System/Glib/GObject_stub.p_o needed by' ...
I shall try again without enmabling profiling support.
It's all working now. And I don't need profiling support on the mac anyway.
participants (5)
-
Achim Schneider
-
Brandon S. Allbery KF8NH
-
Colin Adams
-
Hans Aberg
-
Ross Mellgren