Haskellers hate GUIs!!

I am in the damned position to have tried to develop a GUI app in Haskell. I'm building on top of gtk2hs, now we have a new compiler version a new Platform release and no gtk2hs release, so I cite from a mail from a potential user/contributor for my GUI app. What shall I say, how should he install gtk2hs? Is their a way to get a stable version from a changing darcs repo? If not all Haskellers were such GUI haters, we would have GUI libs with the platform. Jürgen " ... Each gtk2hs package (like glib-0.10.1) installed in that non-standard location by Ubuntu apt-get does at least have a package.conf file, like glib.package.conf. However, on inspection, the "id" fields are missing, and the "depends" fields look more like .cabal file "depends" fields (no ABI ID). I tried an experiment on my glib.package.conf, used "ghc --abi-hash" to generate an ID, so eventually creating a new line something like id: glib-0.10.1-d41d8cd98f00b204e9800998ecf8427e and then set up the "depends" properly by getting the real dependencies using "ghc-pkg -v list". After doing this then ghc-pkg register glib.package.conf worked just fine, and I see it in my global DB. It's cool that this works but it seems highly roundabout. :-) Building gtk2hs from source is broken. Not sure why - I did it OK with ghc-6.10.3. I can run ./configure no problem with ./configure --with-hcflags=-O0 --disable-split-objs --with-ghc=/usr/local/lib/ghc-6.12.1 and it claims that it will build: * The following packages will be built: * * glib : yes * gtk : yes * gio : yes * glade : yes * cairo : yes * svgcairo : yes * gtkglext : no * gconf : yes * sourceview : no * gtksourceview2 : yes * mozembed : no * soegtk : yes * gnomevfs : no * gstreamer : yes * documentation : no But "make" fails horribly...can't find any packages like "base" that configure had no problems finding, so I have no idea what the problem is there. Which is why I'd rather figure out a way to make ghc-6.12.1 recognize the gtk2hs packages that I have in that non-standard location. It works but it's awkward. :-) Each gtk2hs package (like glib-0.10.1) installed in that non-standard location by Ubuntu apt-get does at least have a package.conf file, like glib.package.conf. However, on inspection, the "id" fields are missing, and the "depends" fields look more like .cabal file "depends" fields (no ABI ID). I tried an experiment on my glib.package.conf, used "ghc --abi-hash" to generate an ID, so eventually creating a new line something like id: glib-0.10.1-d41d8cd98f00b204e9800998ecf8427e and then set up the "depends" properly by getting the real dependencies using "ghc-pkg -v list". After doing this then ghc-pkg register glib.package.conf worked just fine, and I see it in my global DB. It's cool that this works but it seems highly roundabout. :-) I think I'll pack it in for the evening. The procedure I described works well in theory, but apparently if the "depends" field in the "package conf" files says something like foo-2.0.1.0, it's not OK to use an existing registered "foo" that has a higher version number...I registered everything in gtk2hs manually but when building ltk it complains with Bad interface file: /usr/lib/haskell-packages/ghc6/lib/gtk-0.10.1/imports/Graphics/UI/Gtk.hi mismatched interface file versions (wanted "6121", got "") Unfortunately when using these package configuration files one has to use the ABI ID - "ghc-pkg register" won't work otherwise - so it's very finicky. I'll have to un-register all my gtk2hs packages, and start again from scratch. Anyway, back to Ubuntu, Haskell and Leksah. :-) I am removing vestiges of ghc-6.10.3 off my Ubuntu system as I encounter them, although I have no reason to believe that the presence of directories and files for that old version are causing me any harm. I am keeping ghc-6.10.4 around, in parallel with ghc-6.12.1. In any case, to the degree that I have exercised it, ghc-6.12.1 is apparently OK. I have done some "cabal install"s on a few executables and libraries, both into user and global, and things seem OK as evidenced by "ghc-pkg list". Now, to gtk2hs and ltk and Leksah. After having initial problems with building gtk2hs from source, for reasons I don't want to spend time investigating (yet), I am returning to the apt package approach, command-line this time instead of through the Synaptic GUI. Running sudo apt-get install libghc6-gtk-dev partially returns --------------- Selecting previously deselected package libghc6-glib-dev. (Reading database ... 257458 files and directories currently installed.) Unpacking libghc6-glib-dev (from .../libghc6-glib-dev_0.10.1-1ubuntu2_i386.deb) ... Selecting previously deselected package libghc6-cairo-dev. Unpacking libghc6-cairo-dev (from .../libghc6-cairo-dev_0.10.1-1ubuntu2_i386.deb) ... Selecting previously deselected package libghc6-gtk-dev. Unpacking libghc6-gtk-dev (from .../libghc6-gtk-dev_0.10.1-1ubuntu2_i386.deb) ... Setting up libghc6-glib-dev (0.10.1-1ubuntu2) ... Reading package info from "/usr/lib/haskell-packages/ghc6/lib/glib-0.10.1/glib.package.conf" ... done. Writing new package config file... done. Setting up libghc6-cairo-dev (0.10.1-1ubuntu2) ... Reading package info from "/usr/lib/haskell-packages/ghc6/lib/cairo-0.10.1/cairo.package.conf" ... done. Writing new package config file... done. Setting up libghc6-gtk-dev (0.10.1-1ubuntu2) ... Reading package info from "/usr/lib/haskell-packages/ghc6/lib/gtk-0.10.1/gtk.package.conf" ... done. Writing new package config file... done. --------------- You'll see the files I was talking about, the *.package.conf files. I've attached the one for cairo, so you can also see what I was talking about: these files are real close to the *.conf files in the user and global package.conf.d databases, but they are missing the "id" field, and the "depends" field entries are like base-4.1.0.0 as opposed to a full base-3.0.3.2-52acef427378232ec569bca0486ee48f In other words, as is, "ghc-pkg register" can't use these files. Which is why I manually edited them. I still see no reason why my manual approach will not work (although figuring out how to build from source would be even better), but I'll have to keep the exact versions specified in these *.package.conf files. Much obliged for the tip about using darcs for the gtk2hs build. Worked like a charm. Combined with that, and doing occasional "cabal install"'s along the way, I have ltk and haddock-leksah-6.12 now built. I don't consider the 5 or 6 hours I spent on all this (which includes building ghc-6.12.1 from source) to be wasted; I learned a lot more about GHC package management. Bit of a snag now with leksah-server (the version in leksah-server.cabal is 0.8.0.5). I've included the console output of the build. Looking at that very first problem: /home/arved/.cabal/lib/ltk-0.8/ghc-6.12.1/libHSltk-0.8.a(Parameters.o): In function `s9Ao_info': (.text+0x28b9): undefined reference to `gtkzm0zi10zi1_GraphicsziUIziGtkziGeneralziEnums_zdfShowShadowType_closure' I can sort of parse this. I see code concerning ShadowType in ltk/Graphics.UI.Editor.Parameters.hs, and I can see that a complaint is being made about something related to ShadowType not being found (I believe) in gtk/Graphics.UI.Gtk.General.Enums. With the {-- #if MIN_VERSION_gtk(0,9,13) -- now defined in gtk #else instance Show ShadowType where show _ = "Any Shadow" #endif --} in Parameters.hs, and seeing as how gtk is 0.10.1, I would expect us to be using gtk code to provide that Show instance for ShadowType, no? Any ideas? ... "

Haskeller's certainly aren't GUI-haters! It's just difficult in
general to write cross-platform GUIs. The goal *is* to put gtk2hs
into the platform, but in order to do that, it needs to be buildable
using Cabal. The limiting factor is time, not motivation.
2010/4/2 Jürgen Nicklisch-Franken
I am in the damned position to have tried to develop a GUI app in Haskell. I'm building on top of gtk2hs, now we have a new compiler version a new Platform release and no gtk2hs release, so I cite from a mail from a potential user/contributor for my GUI app. What shall I say, how should he install gtk2hs? Is their a way to get a stable version from a changing darcs repo? If not all Haskellers were such GUI haters, we would have GUI libs with the platform.
Jürgen
" ... Each gtk2hs package (like glib-0.10.1) installed in that non-standard location by Ubuntu apt-get does at least have a package.conf file, like glib.package.conf. However, on inspection, the "id" fields are missing, and the "depends" fields look more like .cabal file "depends" fields (no ABI ID).
I tried an experiment on my glib.package.conf, used "ghc --abi-hash" to generate an ID, so eventually creating a new line something like
id: glib-0.10.1-d41d8cd98f00b204e9800998ecf8427e
and then set up the "depends" properly by getting the real dependencies using "ghc-pkg -v list".
After doing this then
ghc-pkg register glib.package.conf
worked just fine, and I see it in my global DB. It's cool that this works but it seems highly roundabout. :-)
Building gtk2hs from source is broken. Not sure why - I did it OK with ghc-6.10.3. I can run ./configure no problem with
./configure --with-hcflags=-O0 --disable-split-objs --with-ghc=/usr/local/lib/ghc-6.12.1
and it claims that it will build:
* The following packages will be built: * * glib : yes * gtk : yes * gio : yes * glade : yes * cairo : yes * svgcairo : yes * gtkglext : no * gconf : yes * sourceview : no * gtksourceview2 : yes * mozembed : no * soegtk : yes * gnomevfs : no * gstreamer : yes * documentation : no
But "make" fails horribly...can't find any packages like "base" that configure had no problems finding, so I have no idea what the problem is there. Which is why I'd rather figure out a way to make ghc-6.12.1 recognize the gtk2hs packages that I have in that non-standard location.
It works but it's awkward. :-)
Each gtk2hs package (like glib-0.10.1) installed in that non-standard location by Ubuntu apt-get does at least have a package.conf file, like glib.package.conf. However, on inspection, the "id" fields are missing, and the "depends" fields look more like .cabal file "depends" fields (no ABI ID).
I tried an experiment on my glib.package.conf, used "ghc --abi-hash" to generate an ID, so eventually creating a new line something like
id: glib-0.10.1-d41d8cd98f00b204e9800998ecf8427e
and then set up the "depends" properly by getting the real dependencies using "ghc-pkg -v list".
After doing this then
ghc-pkg register glib.package.conf
worked just fine, and I see it in my global DB. It's cool that this works but it seems highly roundabout. :-)
I think I'll pack it in for the evening. The procedure I described works well in theory, but apparently if the "depends" field in the "package conf" files says something like foo-2.0.1.0, it's not OK to use an existing registered "foo" that has a higher version number...I registered everything in gtk2hs manually but when building ltk it complains with
Bad interface file: /usr/lib/haskell-packages/ghc6/lib/gtk-0.10.1/imports/Graphics/UI/Gtk.hi mismatched interface file versions (wanted "6121", got "")
Unfortunately when using these package configuration files one has to use the ABI ID - "ghc-pkg register" won't work otherwise - so it's very finicky.
I'll have to un-register all my gtk2hs packages, and start again from scratch.
Anyway, back to Ubuntu, Haskell and Leksah. :-)
I am removing vestiges of ghc-6.10.3 off my Ubuntu system as I encounter them, although I have no reason to believe that the presence of directories and files for that old version are causing me any harm. I am keeping ghc-6.10.4 around, in parallel with ghc-6.12.1.
In any case, to the degree that I have exercised it, ghc-6.12.1 is apparently OK. I have done some "cabal install"s on a few executables and libraries, both into user and global, and things seem OK as evidenced by "ghc-pkg list".
Now, to gtk2hs and ltk and Leksah. After having initial problems with building gtk2hs from source, for reasons I don't want to spend time investigating (yet), I am returning to the apt package approach, command-line this time instead of through the Synaptic GUI. Running
sudo apt-get install libghc6-gtk-dev
partially returns
--------------- Selecting previously deselected package libghc6-glib-dev. (Reading database ... 257458 files and directories currently installed.) Unpacking libghc6-glib-dev (from .../libghc6-glib-dev_0.10.1-1ubuntu2_i386.deb) ... Selecting previously deselected package libghc6-cairo-dev. Unpacking libghc6-cairo-dev (from .../libghc6-cairo-dev_0.10.1-1ubuntu2_i386.deb) ... Selecting previously deselected package libghc6-gtk-dev. Unpacking libghc6-gtk-dev (from .../libghc6-gtk-dev_0.10.1-1ubuntu2_i386.deb) ... Setting up libghc6-glib-dev (0.10.1-1ubuntu2) ... Reading package info from "/usr/lib/haskell-packages/ghc6/lib/glib-0.10.1/glib.package.conf" ... done. Writing new package config file... done.
Setting up libghc6-cairo-dev (0.10.1-1ubuntu2) ... Reading package info from "/usr/lib/haskell-packages/ghc6/lib/cairo-0.10.1/cairo.package.conf" ... done. Writing new package config file... done.
Setting up libghc6-gtk-dev (0.10.1-1ubuntu2) ... Reading package info from "/usr/lib/haskell-packages/ghc6/lib/gtk-0.10.1/gtk.package.conf" ... done. Writing new package config file... done. ---------------
You'll see the files I was talking about, the *.package.conf files. I've attached the one for cairo, so you can also see what I was talking about: these files are real close to the *.conf files in the user and global package.conf.d databases, but they are missing the "id" field, and the "depends" field entries are like
base-4.1.0.0
as opposed to a full
base-3.0.3.2-52acef427378232ec569bca0486ee48f
In other words, as is, "ghc-pkg register" can't use these files. Which is why I manually edited them.
I still see no reason why my manual approach will not work (although figuring out how to build from source would be even better), but I'll have to keep the exact versions specified in these *.package.conf files.
Much obliged for the tip about using darcs for the gtk2hs build. Worked like a charm. Combined with that, and doing occasional "cabal install"'s along the way, I have ltk and haddock-leksah-6.12 now built.
I don't consider the 5 or 6 hours I spent on all this (which includes building ghc-6.12.1 from source) to be wasted; I learned a lot more about GHC package management.
Bit of a snag now with leksah-server (the version in leksah-server.cabal is 0.8.0.5). I've included the console output of the build.
Looking at that very first problem:
/home/arved/.cabal/lib/ltk-0.8/ghc-6.12.1/libHSltk-0.8.a(Parameters.o): In function `s9Ao_info': (.text+0x28b9): undefined reference to `gtkzm0zi10zi1_GraphicsziUIziGtkziGeneralziEnums_zdfShowShadowType_closure'
I can sort of parse this. I see code concerning ShadowType in ltk/Graphics.UI.Editor.Parameters.hs, and I can see that a complaint is being made about something related to ShadowType not being found (I believe) in gtk/Graphics.UI.Gtk.General.Enums.
With the
{-- #if MIN_VERSION_gtk(0,9,13) -- now defined in gtk #else instance Show ShadowType where show _ = "Any Shadow" #endif --}
in Parameters.hs, and seeing as how gtk is 0.10.1, I would expect us to be using gtk code to provide that Show instance for ShadowType, no?
Any ideas? ... "
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Push the envelope. Watch it bend.

Thomas Schilling wrote:
Haskeller's certainly aren't GUI-haters! It's just difficult in general to write cross-platform GUIs. The goal *is* to put gtk2hs into the platform, but in order to do that, it needs to be buildable using Cabal. The limiting factor is time, not motivation.
Well, expertise is also a limiting. Few people are willing to invest a huge amount of time to learn the often arcane craft of modifying somebody else's makefiles and build architecture. Also, cabalizing gtk2hs won't necessarily make the compilation problems go away. You still have to get gtk working on non-Linux systems and you still have to deal with unexpected errors somewhere deep in the dungeons of preprocessing for the Haskell FFI. Regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com

Hi Jürgen,
For GHC-6.12, just darcs version support.
So please download darcs version.
Axel has working on that make gtk2hs build on cabal.
And i'm working on update All gtk2hs API to Gtk+ 2.18.3 (have finish
99%), i can finish all APIs in later days.
Axel have finish some sub-modules on http://www2.in.tum.de/~simona/
(Note, above cabal packages not include patches i push recently)
After we finsh work, we can merge gtk2hs into Haskell Platform.
Because gtk2hs just interface code for low-level C library, so it's
stable enough.
As recently so much new code push in gtk2hs, perhaps have bug.
So please report any problem on gtk2hs mail-list, we can fix it as soon
as we can.
-- Haskller GUI lover
Jürgen Nicklisch-Franken
I am in the damned position to have tried to develop a GUI app in Haskell. I'm building on top of gtk2hs, now we have a new compiler version a new Platform release and no gtk2hs release, so I cite from a mail from a potential user/contributor for my GUI app. What shall I say, how should he install gtk2hs? Is their a way to get a stable version from a changing darcs repo? If not all Haskellers were such GUI haters, we would have GUI libs with the platform.
Jürgen
" ... Each gtk2hs package (like glib-0.10.1) installed in that non-standard location by Ubuntu apt-get does at least have a package.conf file, like glib.package.conf. However, on inspection, the "id" fields are missing, and the "depends" fields look more like .cabal file "depends" fields (no ABI ID).
I tried an experiment on my glib.package.conf, used "ghc --abi-hash" to generate an ID, so eventually creating a new line something like
id: glib-0.10.1-d41d8cd98f00b204e9800998ecf8427e
and then set up the "depends" properly by getting the real dependencies using "ghc-pkg -v list".
After doing this then
ghc-pkg register glib.package.conf
worked just fine, and I see it in my global DB. It's cool that this works but it seems highly roundabout. :-)
Building gtk2hs from source is broken. Not sure why - I did it OK with ghc-6.10.3. I can run ./configure no problem with
./configure --with-hcflags=-O0 --disable-split-objs --with-ghc=/usr/local/lib/ghc-6.12.1
and it claims that it will build:
* The following packages will be built: * * glib : yes * gtk : yes * gio : yes * glade : yes * cairo : yes * svgcairo : yes * gtkglext : no * gconf : yes * sourceview : no * gtksourceview2 : yes * mozembed : no * soegtk : yes * gnomevfs : no * gstreamer : yes * documentation : no
But "make" fails horribly...can't find any packages like "base" that configure had no problems finding, so I have no idea what the problem is there. Which is why I'd rather figure out a way to make ghc-6.12.1 recognize the gtk2hs packages that I have in that non-standard location.
It works but it's awkward. :-)
Each gtk2hs package (like glib-0.10.1) installed in that non-standard location by Ubuntu apt-get does at least have a package.conf file, like glib.package.conf. However, on inspection, the "id" fields are missing, and the "depends" fields look more like .cabal file "depends" fields (no ABI ID).
I tried an experiment on my glib.package.conf, used "ghc --abi-hash" to generate an ID, so eventually creating a new line something like
id: glib-0.10.1-d41d8cd98f00b204e9800998ecf8427e
and then set up the "depends" properly by getting the real dependencies using "ghc-pkg -v list".
After doing this then
ghc-pkg register glib.package.conf
worked just fine, and I see it in my global DB. It's cool that this works but it seems highly roundabout. :-)
I think I'll pack it in for the evening. The procedure I described works well in theory, but apparently if the "depends" field in the "package conf" files says something like foo-2.0.1.0, it's not OK to use an existing registered "foo" that has a higher version number...I registered everything in gtk2hs manually but when building ltk it complains with
Bad interface file: /usr/lib/haskell-packages/ghc6/lib/gtk-0.10.1/imports/Graphics/UI/Gtk.hi mismatched interface file versions (wanted "6121", got "")
Unfortunately when using these package configuration files one has to use the ABI ID - "ghc-pkg register" won't work otherwise - so it's very finicky.
I'll have to un-register all my gtk2hs packages, and start again from scratch.
Anyway, back to Ubuntu, Haskell and Leksah. :-)
I am removing vestiges of ghc-6.10.3 off my Ubuntu system as I encounter them, although I have no reason to believe that the presence of directories and files for that old version are causing me any harm. I am keeping ghc-6.10.4 around, in parallel with ghc-6.12.1.
In any case, to the degree that I have exercised it, ghc-6.12.1 is apparently OK. I have done some "cabal install"s on a few executables and libraries, both into user and global, and things seem OK as evidenced by "ghc-pkg list".
Now, to gtk2hs and ltk and Leksah. After having initial problems with building gtk2hs from source, for reasons I don't want to spend time investigating (yet), I am returning to the apt package approach, command-line this time instead of through the Synaptic GUI. Running
sudo apt-get install libghc6-gtk-dev
partially returns
--------------- Selecting previously deselected package libghc6-glib-dev. (Reading database ... 257458 files and directories currently installed.) Unpacking libghc6-glib-dev (from .../libghc6-glib-dev_0.10.1-1ubuntu2_i386.deb) ... Selecting previously deselected package libghc6-cairo-dev. Unpacking libghc6-cairo-dev (from .../libghc6-cairo-dev_0.10.1-1ubuntu2_i386.deb) ... Selecting previously deselected package libghc6-gtk-dev. Unpacking libghc6-gtk-dev (from .../libghc6-gtk-dev_0.10.1-1ubuntu2_i386.deb) ... Setting up libghc6-glib-dev (0.10.1-1ubuntu2) ... Reading package info from "/usr/lib/haskell-packages/ghc6/lib/glib-0.10.1/glib.package.conf" ... done. Writing new package config file... done.
Setting up libghc6-cairo-dev (0.10.1-1ubuntu2) ... Reading package info from "/usr/lib/haskell-packages/ghc6/lib/cairo-0.10.1/cairo.package.conf" ... done. Writing new package config file... done.
Setting up libghc6-gtk-dev (0.10.1-1ubuntu2) ... Reading package info from "/usr/lib/haskell-packages/ghc6/lib/gtk-0.10.1/gtk.package.conf" ... done. Writing new package config file... done. ---------------
You'll see the files I was talking about, the *.package.conf files. I've attached the one for cairo, so you can also see what I was talking about: these files are real close to the *.conf files in the user and global package.conf.d databases, but they are missing the "id" field, and the "depends" field entries are like
base-4.1.0.0
as opposed to a full
base-3.0.3.2-52acef427378232ec569bca0486ee48f
In other words, as is, "ghc-pkg register" can't use these files. Which is why I manually edited them.
I still see no reason why my manual approach will not work (although figuring out how to build from source would be even better), but I'll have to keep the exact versions specified in these *.package.conf files.
Much obliged for the tip about using darcs for the gtk2hs build. Worked like a charm. Combined with that, and doing occasional "cabal install"'s along the way, I have ltk and haddock-leksah-6.12 now built.
I don't consider the 5 or 6 hours I spent on all this (which includes building ghc-6.12.1 from source) to be wasted; I learned a lot more about GHC package management.
Bit of a snag now with leksah-server (the version in leksah-server.cabal is 0.8.0.5). I've included the console output of the build.
Looking at that very first problem:
/home/arved/.cabal/lib/ltk-0.8/ghc-6.12.1/libHSltk-0.8.a(Parameters.o): In function `s9Ao_info': (.text+0x28b9): undefined reference to `gtkzm0zi10zi1_GraphicsziUIziGtkziGeneralziEnums_zdfShowShadowType_closure'
I can sort of parse this. I see code concerning ShadowType in ltk/Graphics.UI.Editor.Parameters.hs, and I can see that a complaint is being made about something related to ShadowType not being found (I believe) in gtk/Graphics.UI.Gtk.General.Enums.
With the
{-- #if MIN_VERSION_gtk(0,9,13) -- now defined in gtk #else instance Show ShadowType where show _ = "Any Shadow" #endif --}
in Parameters.hs, and seeing as how gtk is 0.10.1, I would expect us to be using gtk code to provide that Show instance for ShadowType, no?
Any ideas? ... "

Never been a fan of GTK myself, but that's because I was a KDE developer I
guess :-).
Having said that, are there any plans to make it really easy to get gtk2hs
working on Mac OS X?
Dave
On Fri, Apr 2, 2010 at 6:34 AM, Andy Stewart
Hi Jürgen,
For GHC-6.12, just darcs version support. So please download darcs version.
Axel has working on that make gtk2hs build on cabal. And i'm working on update All gtk2hs API to Gtk+ 2.18.3 (have finish 99%), i can finish all APIs in later days.
Axel have finish some sub-modules on http://www2.in.tum.de/~simona/ (Note, above cabal packages not include patches i push recently)
After we finsh work, we can merge gtk2hs into Haskell Platform.
Because gtk2hs just interface code for low-level C library, so it's stable enough.
As recently so much new code push in gtk2hs, perhaps have bug. So please report any problem on gtk2hs mail-list, we can fix it as soon as we can.
-- Haskller GUI lover
Jürgen Nicklisch-Franken
writes: I am in the damned position to have tried to develop a GUI app in Haskell. I'm building on top of gtk2hs, now we have a new compiler version a new Platform release and no gtk2hs release, so I cite from a mail from a potential user/contributor for my GUI app. What shall I say, how should he install gtk2hs? Is their a way to get a stable version from a changing darcs repo? If not all Haskellers were such GUI haters, we would have GUI libs with the platform.
Jürgen
" ... Each gtk2hs package (like glib-0.10.1) installed in that non-standard location by Ubuntu apt-get does at least have a package.conf file, like glib.package.conf. However, on inspection, the "id" fields are missing, and the "depends" fields look more like .cabal file "depends" fields (no ABI ID).
I tried an experiment on my glib.package.conf, used "ghc --abi-hash" to generate an ID, so eventually creating a new line something like
id: glib-0.10.1-d41d8cd98f00b204e9800998ecf8427e
and then set up the "depends" properly by getting the real dependencies using "ghc-pkg -v list".
After doing this then
ghc-pkg register glib.package.conf
worked just fine, and I see it in my global DB. It's cool that this works but it seems highly roundabout. :-)
Building gtk2hs from source is broken. Not sure why - I did it OK with ghc-6.10.3. I can run ./configure no problem with
./configure --with-hcflags=-O0 --disable-split-objs --with-ghc=/usr/local/lib/ghc-6.12.1
and it claims that it will build:
* The following packages will be built: * * glib : yes * gtk : yes * gio : yes * glade : yes * cairo : yes * svgcairo : yes * gtkglext : no * gconf : yes * sourceview : no * gtksourceview2 : yes * mozembed : no * soegtk : yes * gnomevfs : no * gstreamer : yes * documentation : no
But "make" fails horribly...can't find any packages like "base" that configure had no problems finding, so I have no idea what the problem is there. Which is why I'd rather figure out a way to make ghc-6.12.1 recognize the gtk2hs packages that I have in that non-standard location.
It works but it's awkward. :-)
Each gtk2hs package (like glib-0.10.1) installed in that non-standard location by Ubuntu apt-get does at least have a package.conf file, like glib.package.conf. However, on inspection, the "id" fields are missing, and the "depends" fields look more like .cabal file "depends" fields (no ABI ID).
I tried an experiment on my glib.package.conf, used "ghc --abi-hash" to generate an ID, so eventually creating a new line something like
id: glib-0.10.1-d41d8cd98f00b204e9800998ecf8427e
and then set up the "depends" properly by getting the real dependencies using "ghc-pkg -v list".
After doing this then
ghc-pkg register glib.package.conf
worked just fine, and I see it in my global DB. It's cool that this works but it seems highly roundabout. :-)
I think I'll pack it in for the evening. The procedure I described works well in theory, but apparently if the "depends" field in the "package conf" files says something like foo-2.0.1.0, it's not OK to use an existing registered "foo" that has a higher version number...I registered everything in gtk2hs manually but when building ltk it complains with
Bad interface file: /usr/lib/haskell-packages/ghc6/lib/gtk-0.10.1/imports/Graphics/UI/Gtk.hi mismatched interface file versions (wanted "6121", got "")
Unfortunately when using these package configuration files one has to use the ABI ID - "ghc-pkg register" won't work otherwise - so it's very finicky.
I'll have to un-register all my gtk2hs packages, and start again from scratch.
Anyway, back to Ubuntu, Haskell and Leksah. :-)
I am removing vestiges of ghc-6.10.3 off my Ubuntu system as I encounter them, although I have no reason to believe that the presence of directories and files for that old version are causing me any harm. I am keeping ghc-6.10.4 around, in parallel with ghc-6.12.1.
In any case, to the degree that I have exercised it, ghc-6.12.1 is apparently OK. I have done some "cabal install"s on a few executables and libraries, both into user and global, and things seem OK as evidenced by "ghc-pkg list".
Now, to gtk2hs and ltk and Leksah. After having initial problems with building gtk2hs from source, for reasons I don't want to spend time investigating (yet), I am returning to the apt package approach, command-line this time instead of through the Synaptic GUI. Running
sudo apt-get install libghc6-gtk-dev
partially returns
--------------- Selecting previously deselected package libghc6-glib-dev. (Reading database ... 257458 files and directories currently installed.) Unpacking libghc6-glib-dev (from .../libghc6-glib-dev_0.10.1-1ubuntu2_i386.deb) ... Selecting previously deselected package libghc6-cairo-dev. Unpacking libghc6-cairo-dev (from .../libghc6-cairo-dev_0.10.1-1ubuntu2_i386.deb) ... Selecting previously deselected package libghc6-gtk-dev. Unpacking libghc6-gtk-dev (from .../libghc6-gtk-dev_0.10.1-1ubuntu2_i386.deb) ... Setting up libghc6-glib-dev (0.10.1-1ubuntu2) ... Reading package info from
"/usr/lib/haskell-packages/ghc6/lib/glib-0.10.1/glib.package.conf" ...
done. Writing new package config file... done.
Setting up libghc6-cairo-dev (0.10.1-1ubuntu2) ... Reading package info from
"/usr/lib/haskell-packages/ghc6/lib/cairo-0.10.1/cairo.package.conf" ...
done. Writing new package config file... done.
Setting up libghc6-gtk-dev (0.10.1-1ubuntu2) ... Reading package info from "/usr/lib/haskell-packages/ghc6/lib/gtk-0.10.1/gtk.package.conf"
...
done. Writing new package config file... done. ---------------
You'll see the files I was talking about, the *.package.conf files. I've attached the one for cairo, so you can also see what I was talking about: these files are real close to the *.conf files in the user and global package.conf.d databases, but they are missing the "id" field, and the "depends" field entries are like
base-4.1.0.0
as opposed to a full
base-3.0.3.2-52acef427378232ec569bca0486ee48f
In other words, as is, "ghc-pkg register" can't use these files. Which is why I manually edited them.
I still see no reason why my manual approach will not work (although figuring out how to build from source would be even better), but I'll have to keep the exact versions specified in these *.package.conf files.
Much obliged for the tip about using darcs for the gtk2hs build. Worked like a charm. Combined with that, and doing occasional "cabal install"'s along the way, I have ltk and haddock-leksah-6.12 now built.
I don't consider the 5 or 6 hours I spent on all this (which includes building ghc-6.12.1 from source) to be wasted; I learned a lot more about GHC package management.
Bit of a snag now with leksah-server (the version in leksah-server.cabal is 0.8.0.5). I've included the console output of the build.
Looking at that very first problem:
/home/arved/.cabal/lib/ltk-0.8/ghc-6.12.1/libHSltk-0.8.a(Parameters.o):
In function `s9Ao_info': (.text+0x28b9): undefined reference to
`gtkzm0zi10zi1_GraphicsziUIziGtkziGeneralziEnums_zdfShowShadowType_closure'
I can sort of parse this. I see code concerning ShadowType in ltk/Graphics.UI.Editor.Parameters.hs, and I can see that a complaint is being made about something related to ShadowType not being found (I believe) in gtk/Graphics.UI.Gtk.General.Enums.
With the
{-- #if MIN_VERSION_gtk(0,9,13) -- now defined in gtk #else instance Show ShadowType where show _ = "Any Shadow" #endif --}
in Parameters.hs, and seeing as how gtk is 0.10.1, I would expect us to be using gtk code to provide that Show instance for ShadowType, no?
Any ideas? ... "
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Fri, Apr 02, 2010 at 07:41:38AM -0700, David Leimbach wrote:
Having said that, are there any plans to make it really easy to get gtk2hs working on Mac OS X?
I think this is an important issue in developing run-of-the-mill GUI apps in Haskell. I recently wrote a small application using gtk2hs, but found it nearly impossible to deploy. I developed it on Linux (where installing all the infrastructure is not too hard, or at least people are used to doing so), but the work required to get it to run on MacOS X seemed extreme. I ended up rewriting it in another language (due to time pressure) and I'm a little wary of attempting to use Haskell again for developing such an application. I didn't even try getting it to work on Windows; maybe that's easier. On the plus side, I found developing with gtk2hs to be straightforward. Is there a general strategy for deploying Haskell apps, graphical or no, to MacOS X and/or Windows? I'm especially interested in cases where the application uses some heavyweight libraries like OpenGL.

On 2 April 2010 17:53, Dominic Espinosa
I ended up rewriting it in another language (due to time pressure) and I'm a little wary of attempting to use Haskell again for developing such an application.
Hi Dominic Out of curiosity what language did you choose instead? Each time a thread comes up on the Cafe documenting GUI woes, I always wonder if Python or other languages[*] have such problems and if not why not. [*] Obviously Java and C# have benefited from a large industrial investment so have solved their GUI problems by dollars. Best wishes Stephen

Stephen Tetley
On 2 April 2010 17:53, Dominic Espinosa
wrote: [SNIP]
I ended up rewriting it in another language (due to time pressure) and I'm a little wary of attempting to use Haskell again for developing such an application.
Hi Dominic
Out of curiosity what language did you choose instead?
Each time a thread comes up on the Cafe documenting GUI woes, I always wonder if Python or other languages[*] have such problems and if not why not.
For better or worse python interpreter comes with Tk. So, if you develop your application to use Tk, as ugly as it may look, it will work in every platform supported by the python interpreter. However, if you want to use pygtk, you still have to install gtk runtime. When using haskell, can't you just make a static binary on MacOS and Windows, though? Why wouldn't that work?

Rafael Cunha de Almeida wrote:
When using haskell, can't you just make a static binary on MacOS and Windows, though? Why wouldn't that work?
On MacOS, you would have to relocate the shared gtk2hs libraries and bundle them with the application. It's actually easiest to exorcise the paths from the compiled binary with some otool vodoo; Inkscape did it this way last time I remember. There was also a gtk framework once, but it seems to be out of date. Regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com

On Fri, Apr 02, 2010 at 06:11:52PM +0100, Stephen Tetley wrote:
On 2 April 2010 17:53, Dominic Espinosa
wrote: [SNIP]
I ended up rewriting it in another language (due to time pressure) and I'm a little wary of attempting to use Haskell again for developing such an application.
Out of curiosity what language did you choose instead?
Some algol-like language purporting to have cross-platform GUI support, widely used by others in our department. I think the name started with "J". I did not enjoy the rewrite. The Haskell code was a lot nicer (and shorter). However, the application had to be deployed to arbitrary MacBook users, and the process of installing the Haskell infrastructure plus MacPorts plus the MacPort of gtk2hs (which had a lot of dependencies, if I remember correctly) seemed too arduous to expect all Mac-based users of my application to go through, especially when battling the "what is this 'Haskell' business? why didn't you use blub, like a normal person?" sentiment. Is there an easier way? The process of using cabal-install on Linux is similar, but the 'distribution culture' there is a lot different. I fully expect to install packages and their dependencies with a package manager, or at least download and compile a tarball, and tend to be suspicious of binary-only releases. But they are the norm on those two other platforms. It would be nice if there were a quick way of generating such packages.

This may not be helpful for you, but when I did GUI stuff with haskell I wrote the GUI part in c++ with fltk, exposed a medium-level api specific to that gui, and then call that api through the FFI. This is sort of like the web browser + backend thing, except switch c++ and fltk for javascript and the browser, and you are making synchronous FFI function calls instead of sending asynchronous JSON messages. It has worked well for me so far, but my GUIs are all simple with well defined interaction with the backend (i.e. backend says "add these 15 items" and GUI says "user selected this item"). If you have complicated interaction between backend and GUI you may get tired implementing a large API and lots of marshal/unmarshal. Of course you could still pass data via JSON or protobufs or something, and there are various tools to automate wrapping large numbers of C calls. In terms of distribution, you get a single binary and fltk is designed for static linking. You can run on X, mac, and windows, though it doesn't look like a native app on any.

On 04/02/2010 10:15 PM, Dominic Espinosa wrote:
On Fri, Apr 02, 2010 at 06:11:52PM +0100, Stephen Tetley wrote:
On 2 April 2010 17:53, Dominic Espinosa
wrote: I ended up rewriting it in another language (due to time pressure) and I'm a little wary of attempting to use Haskell again for developing such an application.
Out of curiosity what language did you choose instead?
Some algol-like language purporting to have cross-platform GUI support, widely used by others in our department. I think the name started with "J". I did not enjoy the rewrite. The Haskell code was a lot nicer (and shorter).
May you tell us how much (a percentage) shorter the Haskell code was? Maybe, you can even specify the project size better. Peter.

On Fri, Apr 2, 2010 at 12:53 PM, Dominic Espinosa
Is there a general strategy for deploying Haskell apps, graphical or no, to MacOS X and/or Windows? I'm especially interested in cases where the application uses some heavyweight libraries like OpenGL.
I have a GUI app that I deploy on Mac and Linux that uses OpenGL and wxHaskell. It has been a pretty good experience, but getting wx set up on every development machine is hairier than cabal install. The good news is that it was easy to set up a pure GLUT front end as well as a wx one that both use the same OpenGL code for rendering graphically intensive bits. I just have two build targets to switch between the two. For general cross-platform GUI apps that I need in a pinch, I turn to PLT Scheme. They have a really excellent system in this regard. Anthony

On Fri, Apr 2, 2010 at 10:31 AM, Anthony Cowley
On Fri, Apr 2, 2010 at 12:53 PM, Dominic Espinosa
wrote: Is there a general strategy for deploying Haskell apps, graphical or no, to MacOS X and/or Windows? I'm especially interested in cases where the application uses some heavyweight libraries like OpenGL.
I have a GUI app that I deploy on Mac and Linux that uses OpenGL and wxHaskell. It has been a pretty good experience, but getting wx set up on every development machine is hairier than cabal install. The good news is that it was easy to set up a pure GLUT front end as well as a wx one that both use the same OpenGL code for rendering graphically intensive bits. I just have two build targets to switch between the two.
For general cross-platform GUI apps that I need in a pinch, I turn to PLT Scheme. They have a really excellent system in this regard.
Yeah PLT is pretty awesome... But I think they're calling it Racket now. :-) http://www.plt-racket.org/new-name.html
Anthony

Hi Anthony, On Fri, Apr 02, 2010 at 12:59:48 +0000, Anthony Cowley wrote:
I have a GUI app that I deploy on Mac and Linux that uses OpenGL and wxHaskell. It has been a pretty good experience, but getting wx set up on every development machine is hairier than cabal install.
Is it still hairy with the 0.12 series of wxHaskell? Whereas the 0.11 series wraps around a configure/make/make install process with its Cabal file, the 0.12 series on hackage is 100% Cabal based On Ubuntu Linux, I think it was just a matter of sudo aptitude libwxgtk2.8-dev cabal install wx On MacOS X with GHC 6.10 I could just install wxWidgets (native UI) with MacPorts and cabal install wx On MacOS X with GHC 6.12, things got a little hairier with the whole iconv/MacPorts deal and I had to build my own wxWidgets and scrupulously avoid any MacPorts usage. Hopefully this is something Greg (who maintains the Haskell stuff on MacPorts) can solve in time. Thanks! -- Eric Kow http://www.nltg.brighton.ac.uk/home/Eric.Kow PGP Key ID: 08AC04F9

On Apr 2, 2010, at 10:41 , David Leimbach wrote:
Having said that, are there any plans to make it really easy to get gtk2hs working on Mac OS X?
It's in MacPorts. -- 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

On 2 April 2010 20:15, Brandon S. Allbery KF8NH
On Apr 2, 2010, at 10:41 , David Leimbach wrote:
Having said that, are there any plans to make it really easy to get gtk2hs working on Mac OS X?
It's in MacPorts.
But that's the variant using X11, no? There now is a Gtk+ framework, which worked well but was missing some common extensions last time I checked (e.g., sourceview). Unfortunately, the website hosting it has been down for a while now (http://www.gtk-osx.org) and I don't know whether it's available somewhere else.
-- 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
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Push the envelope. Watch it bend.

On Apr 2, 2010, at 15:21 , Thomas Schilling wrote:
On 2 April 2010 20:15, Brandon S. Allbery KF8NH
wrote: On Apr 2, 2010, at 10:41 , David Leimbach wrote: Having said that, are there any plans to make it really easy to get gtk2hs working on Mac OS X?
It's in MacPorts.
But that's the variant using X11, no? There now is a Gtk+ framework,
"port variants gtk2hs" reports a +no_x11 option, which for Gtk+ stuff in MacPorts means it uses one of the native Gtk+ frameworks (there were two last I checked, one not being developed any more). Both of them are missing various things, sadly. -- 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

On Apr 2, 2010, at 15:21 , Thomas Schilling wrote:
On 2 April 2010 20:15, Brandon S. Allbery KF8NH
wrote: On Apr 2, 2010, at 10:41 , David Leimbach wrote: Having said that, are there any plans to make it really easy to get gtk2hs working on Mac OS X?
It's in MacPorts.
But that's the variant using X11, no? There now is a Gtk+ framework,
BTW, native Cocoa support is now part of the standard Gtk+ distribution. -- 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

On 2 Apr 2010, at 21:01, Brandon S. Allbery KF8NH wrote:
On Apr 2, 2010, at 15:21 , Thomas Schilling wrote:
On 2 April 2010 20:15, Brandon S. Allbery KF8NH
wrote: On Apr 2, 2010, at 10:41 , David Leimbach wrote: Having said that, are there any plans to make it really easy to get gtk2hs working on Mac OS X?
It's in MacPorts.
But that's the variant using X11, no? There now is a Gtk+ framework,
BTW, native Cocoa support is now part of the standard Gtk+ distribution.
Unfortunately, it still doesn't behave anything like a Cocoa application.

Brandon S. Allbery KF8NH wrote:
David Leimbach wrote:
Having said that, are there any plans to make it really easy to get gtk2hs working on Mac OS X?
It's in MacPorts.
Which doesn't necessarily make it easier. Took me 2 full days to install gtk and it's still crashing a lot more than it's supposed to. Regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com

Hi Jürgen, Am Freitag, den 02.04.2010, 14:31 +0200 schrieb Jürgen Nicklisch-Franken:
I cite from a mail from a potential user/contributor for my GUI app. What shall I say, how should he install gtk2hs? Is their a way to get a stable version from a changing darcs repo?
Is he trying to use or to develop leksah? If it is just using, the correct answer should be, eventually, use the package provided by your distribution. For this case, I guess I should put the leksah Debian packages that I already have somewhere (maybe on leksah.org) until they can be included in Debian proper. Do you use a Debian-based system yourself? In that case, I can tell you how to build these yourself so you will always have up-to-date packages to give to interested users.
... Each gtk2hs package (like glib-0.10.1) installed in that non-standard location by Ubuntu apt-get does at least have a package.conf file, like glib.package.conf. However, on inspection, the "id" fields are missing, and the "depends" fields look more like .cabal file "depends" fields (no ABI ID).
This is maybe not an issue with gtk2hs, but with the Debian packaging of it. It would be best in these cases if the user would report the problem to the maintainer of the package (e.g. using the reportbug tool on Debian). Version numbers would also be helpful. On my machine, I had no troubles building leksah with the gtk2hs library provided by Debian. Note that the trouble of building those with ghc-6.12 is already taken care of by the Debian maintainers. Greetings, Joachim (with his Debian Haskell Team member hat on) -- Joachim "nomeata" Breitner Debian Developer nomeata@debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C JID: nomeata@joachim-breitner.de | http://people.debian.org/~nomeata
participants (15)
-
Andy Stewart
-
Anthony Cowley
-
Brandon S. Allbery KF8NH
-
David Leimbach
-
Dominic Espinosa
-
Eric Kow
-
Evan Laforge
-
Heinrich Apfelmus
-
Joachim Breitner
-
Jürgen Nicklisch-Franken
-
Peter Hercek
-
Rafael Cunha de Almeida
-
Stephen Tetley
-
Thomas Davie
-
Thomas Schilling