neurocyte / ghc-android

Build scripts for building ghc cross compilers targeting Android
182 stars 29 forks source link

cabal fails with Custom Setup.hs #4

Open joeyh opened 11 years ago

joeyh commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

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.