Snow Leopard, gtk2hs

This may be a little off-topic, but if someone could help me, I'd be
grateful.I am trying to get to a working gtk2hs environment in MacOSX Snow
Leopard
I have a Macbook Pro 2.1 with Snow Leopard.
While I had Leopard, I had the Haskell Platform installed, and it worked
fine.
I also had the MacPorts edition of gtk, and compiled gtk2hs by hand.
After I got Snow Leopard, I installed the Haskell Platform. I have made the
necessary changes to make it compile (flags to ghc), and it compiles normal
programs.
I installed the standalone version of the GTK+ platform, and then tried to
compile gtk2hs from /gtk2hs .
./configure works, but make results in this:
adhmac:gtk2hs arne$ make
make all-am
rm -rf gtk/Graphics/UI/Gtk/Types.o gtk/Graphics/UI/Gtk/Types_split/; mkdir
-p gtk/Graphics/UI/Gtk/Types_split
/usr/bin/ghc +RTS -RTS -split-objs -c gtk/Graphics/UI/Gtk/Types.hs -o
gtk/Graphics/UI/Gtk/Types.o -O -XForeignFunctionInterface -fglasgow-exts
-igtk -package-conf package.conf.inplace -hide-all-packages -ignore-package
gtk -package base-4.1.0.0 -package mtl-1.1.0.2 -package containers-0.2.0.1
-package array-0.2.0.0 -package glib-0.10.1 -package cairo-0.10.1
-package-name gtk-0.10.1 '-#include

Arne Dehli Halvorsen
This may be a little off-topic, but if someone could help me, I'd be grateful. I am trying to get to a working gtk2hs environment in MacOSX Snow Leopard
Have you patched:
/usr/bin/ghc
/usr/bin/ghci
/usr/bin/runhaskell
/usr/bin/runghc
/usr/bin/hsc2hs -- discovered this one only recently
with the 32-bit flags?
G.
--
Gregory Collins

On Tue, Oct 6, 2009 at 8:49 PM, Gregory Collins
Arne Dehli Halvorsen
writes: This may be a little off-topic, but if someone could help me, I'd be grateful. I am trying to get to a working gtk2hs environment in MacOSX Snow Leopard
Have you patched:
/usr/bin/ghc /usr/bin/ghci /usr/bin/runhaskell /usr/bin/runghc /usr/bin/hsc2hs -- discovered this one only recently
hsc2hs was new to me, the others were ok. It didn't help, though.
with the 32-bit flags?
G. -- Gregory Collins

Arne Dehli Halvorsen
On Tue, Oct 6, 2009 at 8:49 PM, Gregory Collins
wrote: Arne Dehli Halvorsen
writes: > This may be a little off-topic, but if someone could help me, I'd be grateful. > I am trying to get to a working gtk2hs environment in MacOSX Snow Leopard
Have you patched:
/usr/bin/ghc /usr/bin/ghci /usr/bin/runhaskell /usr/bin/runghc /usr/bin/hsc2hs -- discovered this one only recently
hsc2hs was new to me, the others were ok. It didn't help, though.
Sorry to be pedantic, just to confirm, the last line of hsc2hs should
read:
exec /Library/Frameworks/GHC.framework/Versions/610/usr/lib/ghc-6.10.4/hsc2hs $tflag $HSC2HS_EXTRA --cflag="-m32" --lflag="-m32" ${1+"$@"} "$Iflag"
If that doesn't work I'm stumped (haven't tried to build gtk2hs on OSX.)
G
--
Gregory Collins

On Tue, Oct 6, 2009 at 10:09 PM, Gregory Collins
Arne Dehli Halvorsen
writes: On Tue, Oct 6, 2009 at 8:49 PM, Gregory Collins
wrote: hsc2hs was new to me, the others were ok. It didn't help, though.
Sorry to be pedantic, just to confirm, the last line of hsc2hs should read:
exec /Library/Frameworks/GHC.framework/Versions/610/usr/lib/ghc-6.10.4/hsc2hs $tflag $HSC2HS_EXTRA --cflag="-m32" --lflag="-m32" ${1+"$@"} "$Iflag"
If that doesn't work I'm stumped (haven't tried to build gtk2hs on OSX.)
Hmm: This is what my /usr/bin/ghc (->/Library/Frameworks/GHC.framework/Versions/610/usr/bin/ghc-6.10.4) looks like - exec /Library/Frameworks/GHC.framework/Versions/610/usr/lib/ghc-6.10.4/ghc -B/Library/Frameworks/GHC.framework/Versions/610/usr/lib/ghc-6.10.4/. -dynload wrapped ${1+"$@"} -optc-m32 -opta-m32 -optl-m32 ...and I had added that same "-optc-m32 -opta-m32 -optl-m32 " to all the others too. The result is the same after altering hsc2hs to follow the same flag convention as yours, though. Arne D Halvorsen
G -- Gregory Collins

On Tue, Oct 6, 2009 at 2:49 PM, Gregory Collins
Arne Dehli Halvorsen
writes: This may be a little off-topic, but if someone could help me, I'd be grateful. I am trying to get to a working gtk2hs environment in MacOSX Snow Leopard
Have you patched:
/usr/bin/ghc /usr/bin/ghci /usr/bin/runhaskell /usr/bin/runghc /usr/bin/hsc2hs -- discovered this one only recently
with the 32-bit flags?
The relevant wiki page[1] is linking to a blog post[2] that is perhaps
out of date. I think a how-to page on the wiki is called for.
(Assuming we can't easily repackage the installer with updated
scripts.)
[1] http://www.haskell.org/haskellwiki/Mac_OS_X
[2] http://obvioushints.blogspot.com/2009/09/running-haskell-ghc-on-snow-leopard...
--
Dave Menendez

On Tue, Oct 6, 2009 at 11:41 AM, Arne Dehli Halvorsen
This may be a little off-topic, but if someone could help me, I'd be grateful. I am trying to get to a working gtk2hs environment in MacOSX Snow Leopard
I have a Macbook Pro 2.1 with Snow Leopard. While I had Leopard, I had the Haskell Platform installed, and it worked fine. I also had the MacPorts edition of gtk, and compiled gtk2hs by hand. After I got Snow Leopard, I installed the Haskell Platform. I have made the necessary changes to make it compile (flags to ghc), and it compiles normal programs. I installed the standalone version of the GTK+ platform, and then tried to compile gtk2hs from /gtk2hs . ./configure works, but make results in this: [snip] /var/folders/G8/G8LY9MSBEGuyatB+JjSWq++++TI/-Tmp-/ghc4162_0/ghc4162_0.split__2870.s:35:0: invalid character '_' in mnemonic /var/folders/G8/G8LY9MSBEGuyatB+JjSWq++++TI/-Tmp-/ghc4162_0/ghc4162_0.split__2870.s:953:0: FATAL:Symbol L_gtk_misc_get_type$stub already defined. make[1]: *** [gtk/Graphics/UI/Gtk/Types.o] Error 1 make: *** [all] Error 2 I also have gtk installed via macports recently, but I am not sure whether this makes a difference. I don't think there is any point currently in trying to go MacPorts all the way, and install ghc+gtk2hs via MacPorts. Does anyone have a recipe for getting ghc + gtk2hs + gtk working on MacOSX Snow Leopard? Best regards, Arne D Halvorsen
I was able to get gtk2hs working with ghc-6.10.3 (after patching the /usr/bin scripts with -m32) by following the steps from http://www.haskell.org/haskellwiki/Gtk2Hs#Using_the_GTK.2B_OS_X_Framework with one change: call configure for gtk2hs as ./configure --disable-split-objs --disable-gio Hope that helps, -Judah

On Sun, Oct 11, 2009 at 3:29 AM, Judah Jacobson
On Tue, Oct 6, 2009 at 11:41 AM, Arne Dehli Halvorsen
wrote: Does anyone have a recipe for getting ghc + gtk2hs + gtk working on MacOSX Snow Leopard? Best regards, Arne D Halvorsen
I was able to get gtk2hs working with ghc-6.10.3 (after patching the /usr/bin scripts with -m32) by following the steps from
http://www.haskell.org/haskellwiki/Gtk2Hs#Using_the_GTK.2B_OS_X_Framework
with one change: call configure for gtk2hs as
./configure --disable-split-objs --disable-gio
Thanks, that seems to have done the trick under ghc 6.10.4 - almost. Current output: adhmac:demo arne$ cd buttonbox adhmac:buttonbox arne$ make ghc --make ButtonBox.hs -o buttonbox [1 of 1] Compiling Main ( ButtonBox.hs, ButtonBox.o ) Linking buttonbox ... ld: warning: duplicate dylib /opt/local/lib/libiconv.2.dylib ld: warning: duplicate dylib /opt/local/lib/libz.1.dylib adhmac:buttonbox arne$ ls ButtonBox.hi ButtonBox.hs ButtonBox.o Makefile buttonbox adhmac:buttonbox arne$ ./buttonbox (buttonbox:42418): Pango-WARNING **: failed to create cairo scaled font, expect ugly output. the offending font is 'Lucida Grande 12' The buttons have boxes instead of letters, due to the font problem. So close... Arne D Halvorsen
Hope that helps, -Judah
participants (4)
-
Arne Dehli Halvorsen
-
David Menendez
-
Gregory Collins
-
Judah Jacobson