Eric Y. Kow wrote:
> On Sat, Aug 08, 2009 at 14:00:49 -0500, Brian Lewis wrote:
>> [snip] It should not be trying to circumvent cabal's normal
>> procedure for package registration.
> 
> I agree with you.  This one stupid little issue makes wxHaskell
> difficult to install.  It drives me absolutely nuts (1) because
> it's a stupid little issue (2) everybody trips on it and (3)
> we are ever so tantalisingly close to making wxHaskell easy to
> install if we could just fix this problem and (4) nobody seems
> to have the spare cycles to sit down and solve the problem.

I recently tried to make Gentoo Linux ebuilds for wxHaskell. We've had
support in the past, for the 0.9.x series, and would like to support the
new 0.11.x too. I spent a few hours just to make it install, and I'm
still not satisfied with the result :)

The ebuild itself is located at:
http://code.haskell.org/gentoo/gentoo-haskell/dev-haskell/wxcore/wxcore-0.11.1.2.ebuild
and documents itself.
You can find the patches at:
http://code.haskell.org/gentoo/gentoo-haskell/dev-haskell/wxcore/files/
and they have also been documented.

What I had to change was:

 - cabal assumes the ./configure script understands the
     --with-hc-pkg flag [1], so now it does.

 - GHC docs are installed into a different path on gentoo.

 - The code to fix the trailing / in DESTDIR seems to be broken, it gave
     an error when I ran it.

 - Not only does Gentoo first install into a separate directory (called
     ${D} in the ebuild, put into variable DESTDIR), the registration is
        also done separately.

      * No files must be attempted to be changed during the install
        phase, other than in the directory ${D}. Thus, we can't register
        the package with 'make install', and changed the wxcore.pkg to
        not require sed magic. Cabal states [1] it assumes the
        package is not registered during this phase.

      * Package registration is done in a post install phase, and is
        handled with other code than what wxHaskell provides (same for
        all packages).
        Usually we use
           ./setup register --gen-pkg-config="${T}/${P}.conf"
        to get a config file to register later.

And what's still not working properly:

 - The ebuild installs wxhaskell directly into /usr/lib{,64}. I'm not
     sure I've set all the variables right, though. The wxcore.pkg's
     import-dir and and library-dirs looks wrong.
     I'd like to install into /usr/lib{,64}/ghc-<ver>/wx-<ver> as with
     other packages.

> Things to know:
> - The wx package itself is fine.  The problem is the wxcore package on
>   which it depends.

Making an ebuild for the wx package takes less than 2 minutes, prefect :)
Many distros can automatically generate description files for their
package systems from correctly packaged cabal applications/libraries.
Naturally we want to make it easy for the poor distro maintainers, right? ;)

>  - Cabalisation is recent.  In the past, we only had this
>    hand-written (grr!) configure script plus a makefile.
>    Now we have *that* and the Cabal stuff as a thin layer
>    around this.

It's sure some work that has gone into making it use cabal though, even
if it isn't perfect.

What do we need to make it easier, to use more of cabal? Any features in
those ./configure and makefiles cabal doesn't have?
I haven't really digged into wxhaskell's build system in many years, but
I remember it builds and uses an application (wxdirect?) to generate the
bindings to the underlying C library. Maybe we could use a field
"installable" similar to existing "buildable" to be able to build in in
the wxcore.cabal file?
What else?

Cheers,
  Lennart Kolmodin -- wearing the Gentoo developer hat
 
[1]http://www.haskell.org/cabal/release/cabal-latest/doc/API/Cabal/Distribution-Make.html


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users

Reply via email to