cabal fails with Custom Setup.hs #4

Open
joeyh opened this Issue Feb 8, 2013 · 2 comments

Projects

None yet

2 participants

@joeyh
Contributor
joeyh commented Feb 8, 2013

Trying to build packages that use a Custom Setup.hs with the cabal wrapper will fail. It seems cabal doesn't really understand cross-compiling, so it builds the Setup.hs with the android ghc, and then tries to run it.

I don't know of a fix at this time. May need cabal changes. I was able to work around it in one case by setting Build-Type: Simple in the cabal file. That package only used the cistom Setup.hs to do some haddock stuff.

@neurocyte
Owner

In the long run Cabal definitely needs proper cross compile support. There was some discussion on the mailing list awhile ago about it, but I don’t think anyone is actively working on it right now.

@joeyh
Contributor
joeyh commented Feb 9, 2013

The trick described above works for most problem packages. One challanging one is network, which uses a configure script. I just got it to build, via this very hacky method:

cabal unpack network
copy in config.sub and config.guess from automake 1.13.1
edit the configure script, and add to the top of it: set -- --host=arm-linux-androideabi

Then the cabal wrapper can be used to install it. Although I had several build failure due to, apparently, it wanting to build in IPV6 socket support, which seemed to use symbols not available to ghc-android. It was easy enough to edit the files where this occurred and ifdef that stuff out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment