Shlomi Fish ([info]shlomif) wrote,
@ 2006-11-03 18:24:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Current location:Home
Current mood: energetic
Current music:U2 - When Love Comes to Town
Entry tags:ghc, hacking, linux, mandriva, perl6, pugs, rpm

Building GHC 6.6 on Mandriva

I decided to try to build the latest Pugs (from the subversion trunk). The INSTALL file said: "Pugs needs the Glasgow Haskell Compiler (GHC), preferably version 6.6 or above.". OK, but Mandriva only has GHC 6.4. So I decided to make the world a bit better by preparing ghc-6.6 packages for Mandriva.

At first I installed the Mandriva ghc-6.4 source rpm, and then looked at the ghc 6.6 RPM Spec from the ghc homepage and adapted the Mandriva RPM accordingly. Then I started the building. It took a long time so I let it run overnight. In the morning when I woke up, I realised the RPM building was not successful. Apparently, the Mandriva RPM Spec building process also built the documentation and the makefile called haddock with an unknown flag. I realised I had to install the latest haddock version (0.8).

So I had to prepare an up-to-date haddock package. I started but then the build failed towards the end because the /usr/bin/haddock-0.8 binary was not installed. I guessed it was removed, and removed it from the RPM spec and built again. This time it was OK and I was able to install the binary RPM.

After haddock-0.8 was installed, I was able to install and build ghc-6.6. (After a few hours of compilation time). However, afterwards when I tried to compile pugs, but it compiled that it could not find the "mtl" library. I consulted people on the IRC about it and someone told me I should also build the src-extralibs package of ghc by unpacking it in the same directory.

I modified the RPM SPEC of ghc-6.6 to do exactly that, and rebuilt. I installed ghc-6.6 again, and again tried to compile pugs. It still complained about the "mtl library". Searcing for "mtl" in the ghc RPM build tree yielded the fact it was installed under the "ghc-6.6/ghc-6.6/" sub-directory there. As it turned out I used the rpm %setup macro in the wrong way: I used the -a 1 (which unpacks the source in 1 after cd'ing into the directory) instead of -b 1, which unpacks the source before cd'ing there.

Thus, I had to rebuild ghc after this correction. After a few more hours of compilation, the rpm was prepared, and I was able to install it. This time, I was able to compile pugs, and I even tested it and submitted a smoke test. This report to the Mandriva bug tracker is the result of my efforts and contains links to the RPMs I prepared.

I spent at least a day working on it, but a hacker got to do what a hacker got to do.




Create an Account
Forgot your login?
Login w/ OpenID
English • Español • Deutsch • Русский…