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

  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. 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…

    February 6, 2012 at 5:42 am

    • 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.

      February 6, 2012 at 12:00 pm

  4. 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

    February 10, 2012 at 11:50 pm

    • Hi Johan, what unit does it say is missing? It’ll be that there’s a directory missing from the path somewhere. I’ve found the following link helpful trying to resolve this kind of thing: http://wiki.lazarus.freepascal.org/Unit_not_found_-_How_to_find_units

      February 12, 2012 at 10:33 pm

      • Hi Mike,

        I gave up on the lazarus install, i’m now trying out the codetyphon, this runs without any problems at my work system (winXP) and installed correctly under ubuntu 11.10, but I need to test this further.

        Below is the link I used
        http://www.pilotlogic.com/sitejoom/index.php/codetyphon-help

        kind regards,
        Johan

        February 21, 2012 at 5:13 pm

        • I’ve tried codetyphon as well, it installs well (which is a great improvement) but the version of Lazarus it uses is flaky and the docking doesn’t work well. I wouldn’t use codetyphon over Lazarus at the moment.

          April 18, 2012 at 10:19 pm

    • Ilya

      Hello.
      I have missing file error, too:
      /usr/lib/lazarus/0.9.30/ide/lazarus.pp(1,1) Fatal: Can’t find unit anchordockpkg used by Lazarus
      Can you please write needed paths?

      March 19, 2012 at 1:47 pm

      • Hi Ilya, I’ve not edited any paths myself – not sure what I’d write or where I’d look. The one thing I have a vague memory of doing is adding the “AnchorDocking” package as as required package to “AnchorDockingDsgn” in the package editor.

        March 19, 2012 at 4:27 pm

      • Ilya

        I compiled anchordockpkg.lpk and it installed now. Single window mode works fine. Thank you Mike.

        March 19, 2012 at 5:10 pm

        • Great, glad to hear it’s sorted 🙂

          March 19, 2012 at 5:20 pm

  5. thierrybo

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

    and I loose the toolbar.

    March 17, 2012 at 1:44 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.

      March 19, 2012 at 12:48 pm

  6. thierrybo

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

    March 25, 2012 at 2:40 pm

    • Yeah, that’s the biggest problem with Lazarus. Too hard to install 😦

      March 26, 2012 at 9:54 pm

  7. Anonymous

    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

    August 8, 2012 at 1:55 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 🙂

      August 9, 2012 at 10:17 pm

  8. 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

    January 9, 2013 at 7:24 am

    • Feel free, although it’s quite out of date now – I’d recommend installing v1 over the 0.9 stuff

      January 11, 2013 at 11:51 am

  9. chritian

    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 .

    March 10, 2013 at 1:36 am

    • Probably the best thing to do is to upgrade to v1

      March 10, 2013 at 12:24 pm

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s