Thursday, April 30, 2009

lazarus.on.ubuntu.jaunty.64bit

Being a big fan of Delphi I've been wanting to port my apps to Linux...unfortunately Kylix (Borland's RAD tool for Linux) is no longer supported since...well years ago, the obvious path would be to use free pascal and Lazarus. Free pascal is an open-source Pascal compiler with two notable features: a high degree of Delphi compatibility and availability on a variety of platforms, including Windows, Mac OS X, and Linux, Lazarus on the other hand, is an open-source development system that builds on the Free Pascal compiler by adding an integrated development environment (IDE) that includes a syntax-highlighting code editor and visual form designer, as well as a component library that's highly compatible with Delphi's Visual Component Library (VCL).

In Intrepid, I found that Lazarus and fpc is best compiled from the svn repo, however this is not the case with Jaunty (9.04) or at least with Jaunty 64bit. I have not installed Lazarus or fpc on Jaunty's 32bit edition so I can't say for sure but in the 64bit version it won't compile, I'm pretty sure its a dependency issue but as of the moment I don't have the time or the patience to trace all of it, enter CodeTyphon (shouldn't it be CodeTyphoon?) a distribution of FPC and Lazarus with a nice graphical build tool that makes building (to any OS) easier. Until the Lazarus wiki reflects a nice howto here's an easier way to install and build fpc and lazarus.

  1. Download CodeTyphon here
  2. Extract CodeTyphon zip to a folder of your choice
  3. Double-click CodeTyphon_ln64.ex (a CodeTyphon window should show up)

  4. Go to main menu FreePascal -> FPC Extract Source (it should automatically extract the FPC source to its own directory...usually /usr/share/fpsrc)
  5. Next select FreePascal -> FPC 64bit Build Compiler (could take a few minutes)
  6. Go to main menu Lazarus -> Lazarus Extract Source(it should automatically extract the Lazarus source to its own directory...usually /usr/lib/lazarus)

  7. *Step 7 actually failed in my first attempt, I found out that later after looking at the error logs that a few dependencies have to be satisfied first (so much for no time and patience hehehe). So fire-up your terminal and type this:

    sudo aptitude install libX11-dev libgtk2.0-dev

  8. Next select Lazarus -> Lazarus 64bit Build IDE
  9. Create a link or launcher that points to /usr/lib/lazarus/startlazarus
  10. Start coding!



Hope this helps! :)

No comments: