Mike MacDonagh's Blog

Somewhere in the overlap between software development, process improvement and psychology

Install single window Lazarus 0.9.30 in Ubuntu 11.10 step by step

I’ve previously blogged on installing lazarus on ubuntu but unfortunately upgrading to ubuntu 11.10 broke my lazarus installation 😦 Here’s how I fixed it all.

1. Totally remove previous Lazarus and fpc installations

sudo apt-get purge lazarus*
sudo apt-get purge fpc*
sudo rm -Rf /usr/lib/fpc
sudo rm -Rf /usr/lib/lazarus
sudo rm -Rf /usr/share/fpcsrc
sudo rm -f ~/.fpc
sudo rm -Rf ~/.lazarus
sudo rm -f /usr/bin/lazarus*
sudo rm -f /usr/bin/lazres*
sudo rm -f /usr/bin/lazbuild*
sudo rm -f ~/.local/share/applications/lazarus*

2. Install fpc so you can use it from the command line

sudo apt-get install fp-compiler-2.4.4

You can see if this has worked properly by writing a hello world command line app, comiling it and running it before you’ve even tried to install lazarus. Save the following in a file called cmdline_helloworld.pas:

begin

writeln('hello world!');

end.

Then compile using

fpc cmdline_helloworld.pas

and run using:

./cmdline_helloworld

Free Pascal Compiler use on the command line

3. Install lazarus

sudo apt-get install lazarus

You probably need to disable overlay scrollbars otherwise you can get problems using menus and dialogs in Lazarus and apps made with lazarus:

export LIBOVERLAY_SCROLLBAR=0

if you don’t want to make such a global change then just make a script to start lazarus like this:

#!/bin/sh
LIBOVERLAY_SCROLLBAR=0 lazarus-ide

4. Change IDE settings to make it easier to use with Unity

Unity is annoying for many reasons, but it doesn’t deal with multi-window apps like Lazarus very well. So here’s some suggestions to make it all behave a bit better.

First, if you use a taskbar plugin like tint you can have Lazarus only show one button rather than loads on the task bar (Environment -> Options -> Window and slect “Show single button in Taskbar” at the top.

Second, I recommend making lazarus use single window mode. This is a little experimental but I think it’s a major improvement over the old-fashioned pre-Delphi 2005 layout.

Normal layout:

Normal multi-window interface for Lazarus

To transform Lazarus into a single window mode application you need to install the AnchorDockingDsgn package which is helpfully installed with Lazarus. On ubuntu in a standard installation it’ll be in /usr/lib/lazarus/0.9.30/examples/anchordocking/design.

Do this as sudo otherwise the recompiling process doesn’t have enough rights to backup packages and wotnot. So start lazarus by doing

sudo lazarus-ide

In Lazarus File -> Open and browse to anchordockingdsgn.lpk

When the package editor comes up select the install button. Lazarus will ask for confirmation and tell you only static packages are supported so you need to rebuild lazarus (that really needs sorting out!), say yes and then sit back and enjoy the compilation process.

Next time you start Lazarus it’ll be in single window mode. For some reason the Object Inspector (F11) isn’t docked by default but you can easily add it yourself.

Lazarus as a single window IDE

Advertisements

22 responses to “Install single window Lazarus 0.9.30 in Ubuntu 11.10 step by step

  1. Pingback: I finally managed to install lazarus 0.9.30 and fpc 2.4.2 on Ubuntu « The Mac Daddy

  2. Pingback: Linux GUI Development: Lazarus 0.9.30 review and screenshots « The Mac Daddy

  3. Bravo.I February 6, 2012 at 5:42 am

    Thanks for the steps, but do you know how to install only fpc instead of lazarus. Fpc in the sense, the blue screen with the yellow text and all that…

    • mikemacd February 6, 2012 at 12:00 pm

      Hi, sorry I’ve not tried to just install fpc. Although I did by accident a couple of times while trying and failing to get Lazarus installed I didn’t write down what I did.

  4. Johan February 10, 2012 at 11:50 pm

    Hello,

    Tried the above and I get stuck on the actual cmd
    “In Lazarus File -> Open and browse to anchordockingdsgn.lpk

    When the package editor comes up select the install button. Lazarus will ask for confirmation and tell you only static packages are supported so you need to rebuild lazarus (that really needs sorting out!), say yes and then sit back and enjoy the compilation process.”

    During compilation lazarus tells me that I have a missing unit, I now some delphi, but actually never used lazarus. Can you help me. All unit for the anchorsockingdsgn.lpk exist in the directory, also no error during lazarus install concerning missing package. I do this on a 64bit

    kind regards
    Johan

  5. thierrybo March 17, 2012 at 1:44 pm

    I tried your advice and after build I do not have docking :

    and I loose the toolbar.

    • mikemacd March 19, 2012 at 12:48 pm

      Not sure what’s going on there… Try expanding the toolbar window if you can to get the menu you might need to go to Environment -> Options then under Environment -> Docking and set the top option to enable docking.

  6. thierrybo March 25, 2012 at 2:40 pm

    Thanks but I gave up, if I drag the toolbar to expand it, lazarus crashes.

  7. Anonymous August 8, 2012 at 1:55 pm

    Thanks a lot. Helped me to recover from a frustrating and lost morning when I thought Ubuntu had gone nuts.
    Tip: I didn’t have to reinstall FPC and Lazarus. Recompilation, however, needed a few trials and tweeks.
    H

    • mikemacd August 9, 2012 at 10:17 pm

      Lazarus is coming up to releasing a v1.0 (the release candidate is available now) so it might well be worth trying again. I’ll give it another go 🙂

  8. http://tinyurl.com/kovamrs51187 January 9, 2013 at 7:24 am

    I personally wish to bookmark this blog post, “Install
    single window Lazarus 0.9.30 in Ubuntu 11.10 step by step Mike MacDonagh’s Blog” on my very own web page. Do you really care if perhaps I personallydo? Thanks a lot -Philipp

  9. chritian March 10, 2013 at 1:36 am

    This is the error I get trying to compile anchordockingdsg


    Compiling registeranchordocking.pas
    Fatal: Can’t find unit AnchorDockStr used by RegisterAnchorDocking
    QuickFixUnitNotFoundPosition unit not found: RegisterAnchorDocking
    TExternalToolList.Run Exception: /usr/lib/lazarus/0.9.30.2/examples/anchordocking/design/registeranchordocking.pas(1,1) Fatal: Can’t find unit AnchorDockStr used by RegisterAnchorDocking

    Compiling anchordockingdsgn.pas
    Compiling registeranchordocking.pas
    Fatal: Can’t find unit AnchorDockStr used by RegisterAnchorDocking
    QuickFixUnitNotFoundPosition unit not found: RegisterAnchorDocking
    TExternalToolList.Run Exception: /usr/lib/lazarus/0.9.30.2/examples/anchordocking/design/registeranchordocking.pas(1,1) Fatal: Can’t find unit AnchorDockStr used by RegisterAnchorDocking

    when I search for that unit :

    christian-deskpro christian # find / -iname anchordockstr
    christian-deskpro christian #
    I get nothing

    Hope this could be usefull .

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: