Multiple Lazarus

From Free Pascal wiki
Revision as of 05:36, 6 September 2010 by Chronos (talk | contribs)
Jump to navigationJump to search

Deutsch (de) English (en) español (es) français (fr) polski (pl) português (pt) русский (ru)

Who needs multiple lazarus and who does not?

You need multiple lazarus versions ...

  • to have several versions of lazarus
  • to have one lazarus compiled with several different versions of FPC

You don't need multiple versions ...

  • to test your project with different widgetsets
  • to cross compile

The config directory

All IDE options are saved to its config directory. Under Linux, Mac OS X and BSD the default config directory is ~/.lazarus.

The config directory can be shared between different lazarus. The config format does not change that often. But of course it is always a good idea to make a backup of your configs from time to time for the case you changed something weird and don't know what it was.

The config directory can be given at command line with the --primary-config-path parameter. For example

 lazarus --primary-config-path=~/.lazarus2

will start an IDE using ~/.lazarus2 as config directory. This way you can have an arbitrary number of config directories and start several independent lazarus. If you use this often, then a small bash script can be created:

 #!/bin/sh
 /path/to/lazarus --primary-config-path=~/.lazarus2

The lazarus files

The normal Lazarus is only one directory. Just copy this directory and get a whole new lazarus. The normal lazarus can be downloaded as zip or from svn. When you compile this lazarus all files will be created in sub directories of this directory.

You don't need to 'install lazarus. But if you install lazarus you get some nice shortcuts on your desktop and some files are associated. These things are platform dependent and there is always only one lazarus installed. The official installers do not support to install lazarus multiple times. But you can add another lazarus manually quite easily.

Linux

Example 1 : A normal installed lazarus plus the svn version

Download and install the lazarus packages as normal.

Then download the lazarus svn to a directory of your choice, preferably somewhere in your home directory. See here Installing_Lazarus#Downloading_Lazarus_SVN.

Example 2 : A normal installed lazarus plus a copy in the home directory

Download and install the lazarus packages as normal.

Then copy lazarus to your home directory and change the ownership of the files:

cp -a /usr/lib/lazarus $(HOME)/
chown $USER:$USER -R $(HOME)/lazarus

(Note: The chown line assumes that your group has the same name as your username. If not, replace $USER:$USER with your username:groupname)

Then change your lazarus desktop/menu shortcut to start

 /home/username/lazarus/startlazarus

Then start the IDE and change the environment options: Menu / Environment / Environment options ... / Lazarus directory to

 /home/username/lazarus

Now you have a local copy, that you can edit and recompile. Don't forget to close source files of /usr/lib/lazarus.