Getting Lazarus

From Free Pascal wiki
Revision as of 13:06, 22 September 2005 by Lightning (talk | contribs) (→‎Using SVN)
Jump to navigationJump to search

Via SVN

Getting SVN

You may download a SVN Client for Windows in http://tortoisesvn.tigris.org/ A SVN command line client is available from the official SVN website for many platforms including Linux and Windows.

Using SVN

To get Lazarus for the first time:

Open a terminal/command prompt, change to the directory you wish the Lazarus folder to be created in and type:

 svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus

To update Lazarus sources:

Open a terminal/command prompt, change to the lazarus directory and type:

 svn update


Lightning: Here is a windows batch script that takes care of checking out and updating Lazarus from SVN to a subdirectory and even basic error fixing, because i have no way of knowing where Lazarus is installed it cannot compile or copy the files to your working Lazarus instalation.

@REM Script for checkout and update Lazarus from SVN
@echo.

@REM Check if lazarus directory exists to update or checkout first
@if not exist lazarus goto CheckoutLaz
@echo Updating Lazarus, please wait ...
@cd lazarus
svn update
@if not %errorlevel% == 0 goto CleanupLaz
@cd..
@goto Exit

:CheckoutLaz
@echo Checking out Lazarus for the first time, this might take a while ...
svn checkout http://svn.freepascal.org/svn/lazarus/trunk lazarus
@goto Exit

:CleanupLaz
@echo.
@echo Something went wrong, trying to fix any problems if possible  ...
svn cleanup
@if not %errorlevel% == 0 goto CleanupFailedLaz
@cd..
@echo.
@echo Cleanup complete please run the script again.
goto Exit
:CleanupFailedLaz
@cd..
@echo.
@echo Cleanup Failed ! Please check or delete/move/rename the lazarus subdirectory ...

:Exit


Matthijs: WARNING: This script is still assuming lazarus has its source in a CVS repository In Linux I use a script (it is not very sophisticated, but does the trick) to download the latest CVS-version for Lazarus. Before I copy it here I'll explain my system. In my home-directory I have a special cvsroot-directory. In this directory I have a script for downloading Lazarus and other interesting projects. Lazarus is installed in /usr/share/lazarus. Before building a new version from CVS I make a backup, just in case the current cvs is unstable. This is done by moving the /usr/share/lazarus directory to /usr/share/lazarus.bu To adapt the script to your system you only need to alter the constants defined at the start of the script. But without further ado, here is the script. But (big but) it is given without any guarantee. :) If things break you are on your own.

#!/bin/bash

#Define some directories
BASEDIR=/usr/share/
LAZCVSDIR=~/cvsroot/lazarus/
LAZDIR=/usr/share/lazarus/
LAZBACKUP=/usr/share/lazarus.bu

#Remove old backup if it exists
date +"%T %tStart"
if [ -d $LAZBACKUP ]
then 
  date +"%T %tRemoving old backup"
  rm $LAZBACKUP -r
else
  date +"%T %tNo backup to remove"
fi

date +"%T %tCreating copy of lazarus dir"
cp -R $LAZDIR $LAZBACKUP

#Getting stuff from cvs
export CVSROOT=:pserver:cvs:cvs@cvs.freepascal.org:/FPC/CVS
date +"%T %tLogin to cvs server"
cvs login > /dev/null
date +"%T %tUpdate lazarus"
cvs -z3 update -dP lazarus > ~/cvs_update.log
date +"%T %tLogout of cvs-server"
cvs logout > /dev/null

#Copying cvs-files to our laz dir.
date +"%T %tcopying files"
cp -Rf $LAZCVSDIR $BASEDIR --reply=yes

#Make and building of lazarus
date +"%T %tmake lazarus" 
cd $LAZDIR
make > /dev/null
date +"%T %tmake the packages"
make idepkg > /dev/null
date +"%T %tFinished"

Daily Snapshot method

If you don't want to use svn directly, a daily snapshot of the current cvs is available from the lazarus snapshot site or one of its mirrors.

Downloading releases

Binary releases for various platforms are also available via the Lazarus Sourceforge download area.

Original contributors and changes

This page has been converted from the epikwiki version.