
Sorry for my ignorance but..why install with +universal? i didn't use this in any port.
Sudish Joseph
Hi,
I ran into one problem worth mentioning while recompiling gtk and its dependencies as universal libraries using macports: the pango port refused to build with +universal (it fails when trying to merge the i386 & x86_64 libs). The pango-devel port does work with one small tweak as described at https://trac.macports.org/ticket/22801.
Essentially, I had to comment out the "PortGroup muniversal 1.0" line in the Portfile to get a working universal library for pango.
-Sudish
On Mon, Jun 21, 2010 at 5:09 AM, Giuseppe Luigi Punzi
wrote: I died in more dependencies. One, ige-mac-integration. To avoid possible problems I uninstall all ports last night to reinstall full gtk2 with quartz.
For now, i'm solving all of this and I hope to get it working this night.
Sudish Joseph
wrote: Antoine Latter
writes: On Sun, Jun 20, 2010 at 12:53 PM, Giuseppe Luigi Punzi Ruiz
wrote: Hi again,
Yes, you are right, but now, "cabal install leksah" I get:
[...]
Undefined symbols: "_iconv_close", referenced from: _hs_iconv_close in libHSbase-4.2.0.0.a(iconv.o) "_iconv_open", referenced from: _hs_iconv_open in libHSbase-4.2.0.0.a(iconv.o) "_iconv", referenced from: _hs_iconv in libHSbase-4.2.0.0.a(iconv.o) ld: symbol(s) not found
This one is a bummer, and I see it all the time when I try to build a package linked against macports.
This is caused by the two libiconv's in the system being ABI-incompatible, sadly. The ghc pkg available for download from haskell.org is linked against the system /usr/lib/libiconv.dynlib, which has iconv_open() as a function. Macports has GNU libiconv which #defines iconv_open to libiconv_open() in /opt/local/include/iconv.h.
This then blows up as above when linking against other libraries in macports - the linker pulls in GNU libiconv which lacks the symbols needed as you see above.
One workaround is to link GHC itself against the macports version of libiconv (and libgmp) and have cabal-install link all subsequent libraries against macports. I did just that this weekend and now have a working threadscope using the Quartz backend for gtk2, which is very nice (no need to run the X server).
Recipe for reproducing this build is included below (and I can also provide the resulting ghc-6.12.3 pkg file if needed).
Another possible option is to use Homebrew to install gtk2 and other dependencies. Homebrew prefers to use the system-provided libraries and will not pull in GNU libiconv, so this should work with the existing GHC pkg in theory. I didn't pursue this since the homebrew 'gtk+' package didn't seem to have the option to use Quartz instead of X11 as its backend.
Steps for linking the ghc runtime against macports:
- Specify EXTRA_CABAL_CONFIGURE_FLAGS in mk/build.mk as mentioned at the bottom of http://www.haskell.org/ghc/download_ghc_6_12_3.html
EXTRA_CABAL_CONFIGURE_FLAGS = --extra-include-dirs=/opt/local/include \ --extra-lib-dirs=/opt/local/lib
- Use the --with-iconv-* and --with-gmp-* flags when configuring ghc.
./configure --with-iconv-includes=/opt/local/include \ --with-iconv-libraries=/opt/local/lib \ --with-gmp-includes=/opt/local/include \ --with-gmp-libraries=/opt/local/lib
- This produces a GHC runtime and libraries linked against macports:
% otool -L ghc ghc: /opt/local/lib/libncurses.5.dylib (compatibility version 5.0.0, current version 5.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0) /opt/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current version 8.0.0) /opt/local/lib/libgmp.10.dylib (compatibility version 11.0.0, current version 11.1.0)
% nm HSbase-4.2.0.2.o | fgrep iconv 001ff7f0 T _hs_iconv 001ff7e0 T _hs_iconv_close 001ff800 T _hs_iconv_open U _libiconv U _libiconv_close U _libiconv_open
ghc and included libraries use the macports libiconv, so linking against other libraries in macports (gtk2!) will work.
- Have cabal-install use macports as well for packages it installs by editing ~/.cabal/config and setting:
extra-include-dirs: /opt/local/include extra-lib-dirs: /opt/local/lib
- This gives, for e.g., threadscope linked against macports:
% otool -L ~/.cabal/bin/threadscope | egrep '(gtk|iconv)' /opt/local/lib/libgtk-quartz-2.0.0.dylib (compatibility version 2001.0.0, current version 2001.1.0) /opt/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current version 8.0.0)
- Note that since the ghc runtime is still in 32-bit i386 mode, we need universal versions of most libraries in macports. Recent versions of macports (1.9 for sure, maybe 1.8) make it simple to switch from an x86_64 library to a universal one:
% port install gtk2 +universal
This will recompile gtk2 and *all* dependent libraries as universal libraries which is exactly what you need. You can then eliminate any inactive 64-bit libraries with:
% port -f uninstall inactive
Here's the last thread about with, with more links and discussion:
http://thread.gmane.org/gmane.comp.lang.haskell.general/18064/
The response by Jean-Marie Gaillourdet has worked for me in the past.
Antoine
Thanks for that link, I didn't think of overriding libiconv on a per-package basis.
-Sudish

uhmm.. Now, with all gtk2 rebuilded with +no_x11 and +quartz I get Linking dist/build/leksah/leksah ... ld: library not found for -lgtk-x11-2.0 collect2: ld returned 1 exit status cabal: Error: some packages failed to install: leksah-0.8.0.6 failed during the building phase. The exception was: ExitFailure 1 I searched, and it suppose libgtk-x11-2.0 is part of GTK2, but I only can found it in darwinports inside xulrunner package, but fails me a lot building. Some idea? Giuseppe Luigi Punzi Ruiz Blog: http://www.lordzealon.com Twitter & Skype & GoogleTalk accounts: glpunzi

On 22 Jun 2010, at 08:01, Giuseppe Luigi Punzi Ruiz wrote:
uhmm..
Now, with all gtk2 rebuilded with +no_x11 and +quartz I get
Linking dist/build/leksah/leksah ... ld: library not found for -lgtk-x11-2.0 collect2: ld returned 1 exit status cabal: Error: some packages failed to install: leksah-0.8.0.6 failed during the building phase. The exception was: ExitFailure 1
I searched, and it suppose libgtk-x11-2.0 is part of GTK2, but I only can found it in darwinports inside xulrunner package, but fails me a lot building.
Some idea?
I think something must still have been built against gtk x11. Did you rebuild all of Gtk2Hs after rebuilding Gtk? cabal install --reinstall glib cabal install --reinstall gio cabal install --reinstall cairo cabal install --reinstall pango cabal install --reinstall gtk cabal install --reinstall gtksourceview If that does not fix it, you could try this to find the package at fault. grep gtk-x11 ~/.ghc/i386-darwin-6.12.1/package.conf.d/* I am interested to see how you get on with MacPorts. I have not tried it myself in a while. I built the current Leksah OS X binary with jhbuild... http://sourceforge.net/apps/trac/gtk-osx/wiki/Build I am sorry that the current binary is not compatible with OS X 10.5. I will try to use OS X 10.5 to build the next release to make sure it is compatible. Once you have Leksah working you will probably need to update the keymap file (~/.cabal/share/leksah-0.8.0.6/data/keymap.lkshk) if you want Command-C, V and X to work. Just uncomment the three lines already in there... <ctrl>x -> EditCut <ctrl>c -> EditCopy <ctrl>v -> EditPaste You will probably find it beeps each time you use them. I have a nice fix for that but I think it requires a newer version of ige-mac-integration than the one in MacPorts. Good Luck, Hamish

Hi again, El mar, 22-06-2010 a las 13:36 +1200, Hamish Mackenzie escribió:
On 22 Jun 2010, at 08:01, Giuseppe Luigi Punzi Ruiz wrote:
uhmm..
Now, with all gtk2 rebuilded with +no_x11 and +quartz I get
Linking dist/build/leksah/leksah ... ld: library not found for -lgtk-x11-2.0 collect2: ld returned 1 exit status cabal: Error: some packages failed to install: leksah-0.8.0.6 failed during the building phase. The exception was: ExitFailure 1
I searched, and it suppose libgtk-x11-2.0 is part of GTK2, but I only can found it in darwinports inside xulrunner package, but fails me a lot building.
Some idea?
I think something must still have been built against gtk x11.
Did you rebuild all of Gtk2Hs after rebuilding Gtk? cabal install --reinstall glib cabal install --reinstall gio cabal install --reinstall cairo cabal install --reinstall pango cabal install --reinstall gtk cabal install --reinstall gtksourceview
Oops..not. I will try at home..
If that does not fix it, you could try this to find the package at fault. grep gtk-x11 ~/.ghc/i386-darwin-6.12.1/package.conf.d/*
I am interested to see how you get on with MacPorts. I have not tried it myself in a while. I built the current Leksah OS X binary with jhbuild... http://sourceforge.net/apps/trac/gtk-osx/wiki/Build
I am sorry that the current binary is not compatible with OS X 10.5. I will try to use OS X 10.5 to build the next release to make sure it is compatible.
Once you have Leksah working you will probably need to update the keymap file (~/.cabal/share/leksah-0.8.0.6/data/keymap.lkshk) if you want Command-C, V and X to work. Just uncomment the three lines already in there... <ctrl>x -> EditCut <ctrl>c -> EditCopy <ctrl>v -> EditPaste You will probably find it beeps each time you use them. I have a nice fix for that but I think it requires a newer version of ige-mac-integration than the one in MacPorts.
I will check all of this, thanks a lot.

I uninstalled all ports and macports, to try with gtk-osx Once I did all of this, leksah builds, but leksah-server don't, with problems with version of libgthread2. I'm at "jhbuild build meta-gtk-osx-bootstrap" step of GTK-OSX. Once the next step ("jhbuild build meta-gtk-osx-core") is finished, and all is fine (and really I hope it), there are some consideration, before directly reinstall cabal gtk packages, and reinstall leksah? I ask because it sais thath jhbuild is needed to build gtk apps. Cheers. Note: Somebody wants a Macbook? I sell mine :P El 22/06/2010, a las 3:36, Hamish Mackenzie escribió:
On 22 Jun 2010, at 08:01, Giuseppe Luigi Punzi Ruiz wrote:
uhmm..
Now, with all gtk2 rebuilded with +no_x11 and +quartz I get
Linking dist/build/leksah/leksah ... ld: library not found for -lgtk-x11-2.0 collect2: ld returned 1 exit status cabal: Error: some packages failed to install: leksah-0.8.0.6 failed during the building phase. The exception was: ExitFailure 1
I searched, and it suppose libgtk-x11-2.0 is part of GTK2, but I only can found it in darwinports inside xulrunner package, but fails me a lot building.
Some idea?
I think something must still have been built against gtk x11.
Did you rebuild all of Gtk2Hs after rebuilding Gtk? cabal install --reinstall glib cabal install --reinstall gio cabal install --reinstall cairo cabal install --reinstall pango cabal install --reinstall gtk cabal install --reinstall gtksourceview
If that does not fix it, you could try this to find the package at fault. grep gtk-x11 ~/.ghc/i386-darwin-6.12.1/package.conf.d/*
I am interested to see how you get on with MacPorts. I have not tried it myself in a while. I built the current Leksah OS X binary with jhbuild... http://sourceforge.net/apps/trac/gtk-osx/wiki/Build
I am sorry that the current binary is not compatible with OS X 10.5. I will try to use OS X 10.5 to build the next release to make sure it is compatible.
Once you have Leksah working you will probably need to update the keymap file (~/.cabal/share/leksah-0.8.0.6/data/keymap.lkshk) if you want Command-C, V and X to work. Just uncomment the three lines already in there... <ctrl>x -> EditCut <ctrl>c -> EditCopy <ctrl>v -> EditPaste You will probably find it beeps each time you use them. I have a nice fix for that but I think it requires a newer version of ige-mac- integration than the one in MacPorts.
Good Luck, Hamish
Giuseppe Luigi Punzi Ruiz Blog: http://www.lordzealon.com Twitter & Skype & GoogleTalk accounts: glpunzi

On 23 Jun 2010, at 10:25, Giuseppe Luigi Punzi Ruiz wrote:
I uninstalled all ports and macports, to try with gtk-osx
Once I did all of this, leksah builds, but leksah-server don't, with problems with version of libgthread2.
I am confused leksah depends on leksah-server so I am not sure how leksah could build but not leksah-server, unless leksah were using some old version of leksah-server installed earlier.
I'm at "jhbuild build meta-gtk-osx-bootstrap" step of GTK-OSX.
Once the next step ("jhbuild build meta-gtk-osx-core") is finished, and all is fine (and really I hope it), there are some consideration, before directly reinstall cabal gtk packages, and reinstall leksah? I ask because it sais thath jhbuild is needed to build gtk apps.
You will also need to jhbuild build gtksourceview jhbuild build ige-mac-integration As for building gtk2hs, I have the following in them .profile and that seems to be enough. export PATH=/Users/hamish/gtk/inst/bin:~/.cabal/bin:$PATH export XDG_DATA_DIRS=~/gtk/inst/share export PKG_CONFIG_PATH=~/gtk/inst/lib/pkgconfig:/usr/lib/pkgconfig Alternatively you could probably use 'jhbuild shell' to set up the environment for you. Then of course you will need to run... cabal install --reinstall glib cabal install --reinstall gio cabal install --reinstall cairo cabal install --reinstall pango cabal install --reinstall gtk cabal install --reinstall gtksourceview If you do have half installed Leksah libs then run this... cabal install --reinstall ltk cabal install --reinstall leksah-server cabal install --reinstall leksah You can make Leksah look a bit nicer too with jhbuild build gtk-engines Then to your ~/.gtkrc-2.0 file (or your ~/.gtkrc.mine file if if appropriate) add something like... include "/Users/hamish/gtk/inst/share/themes/Clearlooks/gtk-2.0/gtkrc" style "leksah-close-button-style" { GtkWidget::focus-padding = 0 GtkWidget::focus-line-width = 0 xthickness = 0 ythickness = 0 } widget "*.leksah-close-button" style "leksah-close-button-style"

Hi Hamish, list... El mié, 23-06-2010 a las 18:09 +1200, Hamish Mackenzie escribió:
On 23 Jun 2010, at 10:25, Giuseppe Luigi Punzi Ruiz wrote:
I uninstalled all ports and macports, to try with gtk-osx
Once I did all of this, leksah builds, but leksah-server don't, with problems with version of libgthread2.
I am confused leksah depends on leksah-server so I am not sure how leksah could build but not leksah-server, unless leksah were using some old version of leksah-server installed earlier.
leksah starts with a blank window, asking for parameter to reindex, but when Ok is pressed, then, a blank window appears, and closes with an error leksah-server is not running. leksah-server it suppose to be builded. I don't remember exactly, but the error gives trying to execute is something like this Dyld Error Message:Library not loaded: /opt/lib/libgthread-2.0.0.dylib Referenced from: /User/glpunzi/.cabal/bin/leksah-server Reason: Incompatible library version: libgthread requires version 2501.0.0 or later, but libgthread-2.0.0.dylib provides version 2001.0.0 Now, with my mind cleared, I'm thinking, thath once I rebuilded macports with quartz support, I reinstalled gtk related packages from cabal, but, with leksah, I didn't a reinstall, only a "cabal install leksah". Could be the problem, leksah-server was builded before, and for this, later is giving this kind of error?
I'm at "jhbuild build meta-gtk-osx-bootstrap" step of GTK-OSX.
Once the next step ("jhbuild build meta-gtk-osx-core") is finished, and all is fine (and really I hope it), there are some consideration, before directly reinstall cabal gtk packages, and reinstall leksah? I ask because it sais thath jhbuild is needed to build gtk apps.
You will also need to jhbuild build gtksourceview jhbuild build ige-mac-integration
As for building gtk2hs, I have the following in them .profile and that seems to be enough. export PATH=/Users/hamish/gtk/inst/bin:~/.cabal/bin:$PATH export XDG_DATA_DIRS=~/gtk/inst/share export PKG_CONFIG_PATH=~/gtk/inst/lib/pkgconfig:/usr/lib/pkgconfig
Alternatively you could probably use 'jhbuild shell' to set up the environment for you.
Then of course you will need to run...
cabal install --reinstall glib cabal install --reinstall gio cabal install --reinstall cairo cabal install --reinstall pango cabal install --reinstall gtk cabal install --reinstall gtksourceview
If you do have half installed Leksah libs then run this... cabal install --reinstall ltk cabal install --reinstall leksah-server cabal install --reinstall leksah
You can make Leksah look a bit nicer too with jhbuild build gtk-engines
Then to your ~/.gtkrc-2.0 file (or your ~/.gtkrc.mine file if if appropriate) add something like...
include "/Users/hamish/gtk/inst/share/themes/Clearlooks/gtk-2.0/gtkrc"
style "leksah-close-button-style" { GtkWidget::focus-padding = 0 GtkWidget::focus-line-width = 0 xthickness = 0 ythickness = 0 } widget "*.leksah-close-button" style "leksah-close-button-style"
From Linux all ok. From Windows seems ok too, but Macos, always gives me
Thanks a lot. I will check later at home. I throw "jhbuild build meta-gtk-osx-core", and, when I went to bed, it stopped with some error AFAIR. I will check it :( problems with this kind of things.. Seems thath something in the air, stops me to learn haskell + GUI development :P

Finnally, I got it working. I have one strange beahivour, but I think is better to post in leksah maillist, I did a lot of noise here. Cheers, and thanks a lot. El mié, 23-06-2010 a las 10:31 +0200, Giuseppe Luigi Punzi escribió:
Hi Hamish, list...
El mié, 23-06-2010 a las 18:09 +1200, Hamish Mackenzie escribió:
On 23 Jun 2010, at 10:25, Giuseppe Luigi Punzi Ruiz wrote:
I uninstalled all ports and macports, to try with gtk-osx
Once I did all of this, leksah builds, but leksah-server don't, with problems with version of libgthread2.
I am confused leksah depends on leksah-server so I am not sure how leksah could build but not leksah-server, unless leksah were using some old version of leksah-server installed earlier.
leksah starts with a blank window, asking for parameter to reindex, but when Ok is pressed, then, a blank window appears, and closes with an error leksah-server is not running.
leksah-server it suppose to be builded. I don't remember exactly, but the error gives trying to execute is something like this
Dyld Error Message:Library not loaded: /opt/lib/libgthread-2.0.0.dylib Referenced from: /User/glpunzi/.cabal/bin/leksah-server Reason: Incompatible library version: libgthread requires version 2501.0.0 or later, but libgthread-2.0.0.dylib provides version 2001.0.0
Now, with my mind cleared, I'm thinking, thath once I rebuilded macports with quartz support, I reinstalled gtk related packages from cabal, but, with leksah, I didn't a reinstall, only a "cabal install leksah". Could be the problem, leksah-server was builded before, and for this, later is giving this kind of error?
I'm at "jhbuild build meta-gtk-osx-bootstrap" step of GTK-OSX.
Once the next step ("jhbuild build meta-gtk-osx-core") is finished, and all is fine (and really I hope it), there are some consideration, before directly reinstall cabal gtk packages, and reinstall leksah? I ask because it sais thath jhbuild is needed to build gtk apps.
You will also need to jhbuild build gtksourceview jhbuild build ige-mac-integration
As for building gtk2hs, I have the following in them .profile and that seems to be enough. export PATH=/Users/hamish/gtk/inst/bin:~/.cabal/bin:$PATH export XDG_DATA_DIRS=~/gtk/inst/share export PKG_CONFIG_PATH=~/gtk/inst/lib/pkgconfig:/usr/lib/pkgconfig
Alternatively you could probably use 'jhbuild shell' to set up the environment for you.
Then of course you will need to run...
cabal install --reinstall glib cabal install --reinstall gio cabal install --reinstall cairo cabal install --reinstall pango cabal install --reinstall gtk cabal install --reinstall gtksourceview
If you do have half installed Leksah libs then run this... cabal install --reinstall ltk cabal install --reinstall leksah-server cabal install --reinstall leksah
You can make Leksah look a bit nicer too with jhbuild build gtk-engines
Then to your ~/.gtkrc-2.0 file (or your ~/.gtkrc.mine file if if appropriate) add something like...
include "/Users/hamish/gtk/inst/share/themes/Clearlooks/gtk-2.0/gtkrc"
style "leksah-close-button-style" { GtkWidget::focus-padding = 0 GtkWidget::focus-line-width = 0 xthickness = 0 ythickness = 0 } widget "*.leksah-close-button" style "leksah-close-button-style"
Thanks a lot. I will check later at home. I throw "jhbuild build meta-gtk-osx-core", and, when I went to bed, it stopped with some error AFAIR. I will check it :(
From Linux all ok. From Windows seems ok too, but Macos, always gives me problems with this kind of things.. Seems thath something in the air, stops me to learn haskell + GUI development :P
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (3)
-
Giuseppe Luigi Punzi
-
Giuseppe Luigi Punzi Ruiz
-
Hamish Mackenzie