
Hi, I am having trouble building c2hs on Mac OS X. I noticed that Darwinports has a port for this, but I'd like to install it without using Darwinports because I already have ghc compiled and installed on my system. Does anyone know how to get c2hs to work on the mac (or why it doesn't work in the first place)? Regards, Ruben

On Thu, 2007-04-12 at 15:20 +1000, Ruben Zilibowitz wrote:
Hi,
I am having trouble building c2hs on Mac OS X. I noticed that Darwinports has a port for this, but I'd like to install it without using Darwinports because I already have ghc compiled and installed on my system.
Does anyone know how to get c2hs to work on the mac (or why it doesn't work in the first place)?
What is the problem exactly? Are you using the latest tarball or the darcs version? Duncan

Sorry to Duncan, I hit reply which just sent my reply to your own email address not to the mailing list. Second time I've made that mistake. Hopefully this one will reach the list instead. I can't even check out the darcs version from the repository because that gives me an error (on applying patch 107/256 from memory). So I am using the tarball for c2hs-0.14.5. Here is the problem: ./Setup.hs configure ./Setup.hs:11:57: Couldn't match expected type `Distribution.PackageDescription.PackageDescription' against inferred type `LocalBuildInfo' Probable cause: `addWrapperAndLib' is applied to too many arguments In the `postInst' field of a record In the first argument of `defaultMainWithHooks', namely `defaultUserHooks {postInst = addWrapperAndLib}' I have ghc 6.6 installed. I also have ghc 6.7.x installed in a different location. I would like to be able to use c2hs with ghc 6.7.x if possible. Ruben On 12/04/2007, at 3:41 PM, Duncan Coutts wrote:
On Thu, 2007-04-12 at 15:20 +1000, Ruben Zilibowitz wrote:
Hi,
I am having trouble building c2hs on Mac OS X. I noticed that Darwinports has a port for this, but I'd like to install it without using Darwinports because I already have ghc compiled and installed on my system.
Does anyone know how to get c2hs to work on the mac (or why it doesn't work in the first place)?
What is the problem exactly? Are you using the latest tarball or the darcs version?
Duncan

On Thu, 2007-04-12 at 16:02 +1000, Ruben Zilibowitz wrote:
I can't even check out the darcs version from the repository because that gives me an error (on applying patch 107/256 from memory). So I am using the tarball for c2hs-0.14.5. Here is the problem:
Ah, the problem with case sensitive file names. I've made a new checkpoint in the darcs repo so if you use darcs get --partial then you can avoid having to download and apply the problematic patch. So give this another go: darcs get --partial http://darcs.haskell.org/c2hs/
./Setup.hs:11:57: Couldn't match expected type [..]
This was due to changes in the cabal api. In the darcs version of c2hs I've removed all the custom code from Setup.hs and found better ways of doing it. We need a new c2hs release, but I'm still somewhat in the middle of improving the parser and I'd like to do at least a bit of testing before making a release :-)
I have ghc 6.6 installed. I also have ghc 6.7.x installed in a different location. I would like to be able to use c2hs with ghc 6.7.x if possible.
Try the darcs version. uncan

Ok I managed to check out a version from darcs. Now this is happening: ./Setup.hs build Preprocessing executables for c2hs-0.14.6... Setup.hs: c2hs/c/CLexer.x: no alex preprocessor available The installation instructions don't mention that I need the alex package. I guess I can just install it and try again. Are there any other prerequisites though? Ruben On 12/04/2007, at 5:30 PM, Duncan Coutts wrote:
On Thu, 2007-04-12 at 16:02 +1000, Ruben Zilibowitz wrote:
I can't even check out the darcs version from the repository because that gives me an error (on applying patch 107/256 from memory). So I am using the tarball for c2hs-0.14.5. Here is the problem:
Ah, the problem with case sensitive file names. I've made a new checkpoint in the darcs repo so if you use darcs get --partial then you can avoid having to download and apply the problematic patch. So give this another go:
darcs get --partial http://darcs.haskell.org/c2hs/
./Setup.hs:11:57: Couldn't match expected type [..]
This was due to changes in the cabal api. In the darcs version of c2hs I've removed all the custom code from Setup.hs and found better ways of doing it. We need a new c2hs release, but I'm still somewhat in the middle of improving the parser and I'd like to do at least a bit of testing before making a release :-)
I have ghc 6.6 installed. I also have ghc 6.7.x installed in a different location. I would like to be able to use c2hs with ghc 6.7.x if possible.
Try the darcs version.
uncan

On Thu, 2007-04-12 at 18:55 +1000, Ruben Zilibowitz wrote:
Ok I managed to check out a version from darcs. Now this is happening: ./Setup.hs build Preprocessing executables for c2hs-0.14.6... Setup.hs: c2hs/c/CLexer.x: no alex preprocessor available
The installation instructions don't mention that I need the alex package.
The tarball versions come with pre-generated lexer and parser files but the darcs version does not.
I guess I can just install it and try again. Are there any other prerequisites though?
Yes, you also need 'happy' the parser generator. http://haskell.org/happy/ Duncan

Ok, thanks. I finally managed to build it. Ruben On 12/04/2007, at 8:30 PM, Duncan Coutts wrote:
On Thu, 2007-04-12 at 18:55 +1000, Ruben Zilibowitz wrote:
Ok I managed to check out a version from darcs. Now this is happening: ./Setup.hs build Preprocessing executables for c2hs-0.14.6... Setup.hs: c2hs/c/CLexer.x: no alex preprocessor available
The installation instructions don't mention that I need the alex package.
The tarball versions come with pre-generated lexer and parser files but the darcs version does not.
I guess I can just install it and try again. Are there any other prerequisites though?
Yes, you also need 'happy' the parser generator. http://haskell.org/happy/
Duncan
participants (2)
-
Duncan Coutts
-
Ruben Zilibowitz