Home

Building GHC 6.6 on Mandriva

  • Nov. 3rd, 2006 at 6:24 PM
millie O&M David C. Simpson

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.

Adventures in MathML Land

  • Sep. 13th, 2006 at 12:18 AM
millie O&M David C. Simpson

A long time ago I decided that in order to make the Math-Ventures part of my homesite more attractive, I'd like to convert all the mathematical formulae that had been written using ASCII Art (%-)) into MathML - an XML grammar for writing mathematics. Knowing that MathML was extremely verbose, I decided to try converting to HTML+MathML from LaTeX using TeX4ht. However, when viewed using Firefox (which has a built-in MathML support), the test page rendered all the formulae as plain text, which made me believe it was a bug in TeX4ht.

I left it at that for a long time, but a few days ago decided to give it another try. Again displaying it did not render it nicely. However, copy and pasting the notation into the MathML Tester on the Mozilla homepage, yielded perfect results. After a little thought, my woman (OK - programmer) intuition told me that maybe Mozilla displayed it badly due to the fact the file ended in the .html extension and as thus was treated with the content-type of text/html.

Changing the extension to .xhtml (with a content type of application/xhtml+xml), solved the problem and the formulae were redisplayed. So I finished converting the page from its ASCII-art mess into TeX and rendered it into XHTML+MathML. I needed to change the DOCTYPE to XHTML+MathML which involved some Latemp voodoo. (As it turned out, I didn't do it properly the first time, and as a result the page did not validate).

I also had to install and configure the MathML fonts, or otherwise got weird artifacts and missing symbols in the formulas.

Then I discovered that when served as .xhtml, the Google AdSense ads don't get displayed. I found a workaround here, and after a lot of experimenting got it to work. Then I needed to modify the <object> tag CSS to the following:

.ads_side, .ads_top_wide
{
    overflow: hidden;
}
.ads_side
{
    width:120px;
    height:600px;
}
.ads_top_wide
{
    width:500px;
    height:70px;
}

Otherwise, I got annoying scrollbars and clipped content at all the same reason. Many thanks to someone I talked with on the IRC who helped a lot.

So then the Google Ads worked. Afterwards, I decided to convert a diagram to SVG to make it l33ter. I had to write a Perl script and experiment a bit with affine transformations. The SVG works in Opera and Firefox 1.5.0.x, but doesn't work in Konqueror from some reason. The MathML works only in Firefox, because Opera and Konqueror don't support it. Here's the final result.

The way I see it, when more and more sites like mine will integrate cutting-edge technologies, then more people will have them on their browsers, and web designers will have an easier life. Similarly my Music Recommendations Page now uses display: table and display: table-cell which works well in Firefox, Konqueror and Opera but is broken in MSIE 6. This will provide further motivation for people to stop using MSIE.

Together, we can make the revolution happen! Well, in any case, cheers.

New stable versions of Quad-Pres and Latemp

  • Aug. 30th, 2006 at 1:54 PM
EvilPHish evil fish shlomi fish

As promised, there's a new stable version of Quad-Pres - 0.12.0 with many improvements. This is the first new release since 2003. Otherwise, I also released Latemp 0.4.0 (also see the announcement on the site). Now it seems like I'm on a roll.

Next on my agenda is trying to find a good Look&Feel for the Welcome-to-Linux site and ,with a lower priority, for Perl-Begin.

Patronage and Self-Patronage

  • Jul. 26th, 2006 at 11:41 PM
EvilPHish evil fish shlomi fish

I hope you did not feel too bad about my previous post to this journal, which was of somewhat political nature. So here's a more technical-philosophical post which is in essence an essay.

Continuing with the thread in Perl-IL that I started, about the shortage of P-Languages (and FOSS in general) programmers in Israel, and the fact that employers have become more picky in hiring them, and my "Thoughts about Whether to Become Independent" threads in Perl-IL and in Hackers-IL, I'd like to go one step further. (Read the entire threads - they contain many important insights).

During the Renaissance (and possibly previously in the middle ages or before) it was customary for nobles and royals to become patrons of artists and scholars - sponsor their food and housing and in exchange become better known for the creations of these creative people. Now here I propose that now, well into the information age, such a paradigm may resurface, or already resurfaced in a way.

What I'm talking about is giving patronage to open source hackers: programmers, essayists/article writers/bloggers, artists, translators, QA people - all falling under the umbrella of people who hack. This patronage can be given by "rich people": companies, wealthy entrepreneurs, a collective donation of sponsorship, or other sources like that. In turn, the developer can do what he normally does, while possibly crediting his benefactors. (Depending on the terms of benefactors).

Now let's take me as an example. Being a 21st-century Homo sapiens, I require some basic things such as food, housing, clothing, electricity and good hardware, software and Internet resources. Without these things I won't be able to produce anything of value. Now, what I like to do the most, and what I feel like I'm the best at is hacking on various digital creations on my free time. You can find the stuff I wrote on my homesite. The license for most of it is very liberal, usually even Public Domain, BSD-style or CC-Attribution (CC-by).

Now, before I continue let me just say that I'm very happy with my workplace. The conditions there are excellent, the people are very nice, and I'd recommend every Israeli tech-worker who's looking for a job to consider working for them. However, lately I've been feeling that doing my day job's work is a waste of time, as strange as it sounds. I feel that I'm much productive, helpful and as a result satisfied hacking on voluntary stuff.

Obviously, I still have to eat and stuff. Which is where Patronage kicks in. Why can't I get someone or some people to support me so I can continue to do what I like most of the time?

Having a patronage does not mean I'm going to stop trying to earn some money on my own. On my home site I have a page with several ways I can make money. Before I got a job, I made a substantial amount of money off gigs, like writing articles for online publications, proof-reading documents and books, or writing code. Now I also have several ideas for several projects that are both open source but also have a commercial potential, which I cannot work on.

If I get a patronage, I can still do these things, and possibly have a share of the money I receive for such things be payed back to my patron (or donated to a charity approved by him). This brings me to Self-Patronage where such gigs make me entirely self-supportive.

I'm not going to quit my job just yet, albeit I've certainly been happier without a job, and with a full time dedicated to hacktivity. I wonder who will want to hire me to do the random stuff I normally do. I tend to have the attention span of a child, and also work on several articles and essays simultaneously. I have many projects that I started and are in a usable state, and which I multiplex between them, and do bits of each every time.

I've already set up a donation page, but I'm not sure PayPal donations can be directly translated into Israeli currency. Most of what I have in my account now is for commissions, but it's a start. I also placed some Google ads on my site, but I have yet to reach the 100 dollars mark.

I do not claim to be the inventor of Patronage and Self-Patronage. It is well known that some developers collected donations to sponsor them for a year or even more. And increasingly we've seen many professional bloggers or self-employed open source developers. But it is something that any creative person should consider.

Latest Month

July 2008
S M T W T F S
  12345
6789101112
13141516171819
20212223242526
2728293031  

Tags