Banner

Colorized lambdabot for Windows

Posté par alpheccar le10 Nov 2006 à 17:54 CEST

I am often forced to use Windows :( But unfortunately, I have been unable to find a version of lambdabot for it. Since I am using this excellent tool more and more often, I decided to try to build it for windows.

It is a bit difficult but with the following steps, you should be able to have a colorized lambdabot running in offline mode on your windows box as shown in the below screenshot:

imageScreenshot
First

Get the darcs version of lambdabot:


darcs get --partial http://www.cse.unsw.edu.au/~dons/lambdabot
Second

Use darcs to apply the patch attached to this post

Third

There are some absolute paths to change. Look for hoggle.exe, hoogle.txt and State\\ and replace them by the right paths for you. State\\ is a folder contained in the lambdabot directory. hoogle.txt should also be in the lambdabot directory. I had already installed hoogle so I am not using the hoggle.txt from the lambdabot directory.

Fourth

Use cabal to configure, build and install lambdabot with ghc 6.6. You should get a working version of lambdabot for windows.

Limitations

I have disabled all modules accessing to the net because I do not need them. They should work. Just add them back in Module.hs.

Djinn is disabled because I have a crash when lambdabot is trying to communicate with djinn.exe

There is no possibility to evaluate code. So no QuickCheck or SmallCheck from lambdabot because I was unable to build a working version of hs-plugins.

But, that's not as limited as it may appear : you have hoogle, haddock, pl, free, instances etc... A good set of tools. Of course, I really would like to solve my hs-plugins problem to be able to use QuickCheck from the lambdabot.

If I succeed, I'll post a new patch on the blog.

WARNING : The patch is ugly. Not the kind that you'd like to send to the excellent Dons for inclusion in the official lambdabot.

Pas de tags

Pièces liées

Commentaires

Ajouter un commentaire...

Posté par alpheccar le05 Déc 2006 à07:36 CEST

I just disabled all features which were not working in windows :-)

For the color, I added a file Color.hs which is using the Win32 API. This file is also containing a function to parse a text string, extract the ANSI color sequences and call the Win32 function while displaying the String. It allows to colorize the output of Hoogle without having to change anything to Hoogle.

I'll check the problem with the homepage. The regular expression I am using is probably a bit wrong.

Posté par Neil Mitchell le05 Déc 2006 à04:27 CEST

Cool! I tried to get lambdabot building a while back, but ran into issues with Unix signals and unimplemented base libraries for Windows. I filed a few GHC bugs and gave up, well done on getting it fixed up!

How did you get colour in Windows console? Hoogle has a -color flag, but its disabled on Windows as escape codes don't work (if running through WinHugs they do work though).

PS. It complains my homepage is "wrong" - it really is "www.cs.york.ac.uk/~ndm/" (I tried http:// first and that also didn't work.

Updated

Posté par alpheccar le04 Déc 2006 à18:30 CEST

I have updated the patch

Posté par Andrea le03 Déc 2006 à22:39 CEST

Thanks in advance! I'll wait patiently, maybe trying to solve it myself too ^^

Posté par alpheccar le03 Déc 2006 à18:27 CEST

A friend told me that there is a merge conflict when you apply the patch to the latest darcs source. But it should work if you solve the conflict which is not difficult to solve.

I'll try to put the patched sources online. Come back in a few days :-) I currently don't have access to a windows box.

Posté par Andrea le03 Déc 2006 à16:56 CEST

it seems that it has stopped to work, because of changes in the lambdabot main source probably.. Can you put online a copy of the compiled binary? or prepatched sources that compiles as well.