Difference between revisions of "Getting Lazarus/sk"

From Free Pascal wiki
Jump to navigationJump to search
(→‎Getting Lazarus: -- update)
Line 1: Line 1:
 
{{Getting Lazarus}}
 
{{Getting Lazarus}}
  
=Getting Lazarus=
+
== 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 [http://subversion.tigris.org/ website] for many platforms including Linux and Windows.
  
== Via CVS ==
+
=== Using SVN ===
  
=== Getting CVS ===
+
==== Using the command line ====
You may download a CVS Client for Windows in: http://tortoisecvs.sourceforge.net/
 
  
=== Using CVS ===
+
To get Lazarus for the first time:
  
Open a command or cmd prompt and while in the directory where you want to place the lazarus source dir issue the following commands:  
+
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
 +
 
 +
==== Alternative URLs ====
 +
Sometimes the URL of repository given above does not work, because between the svn server there is a http-proxy server. That server usually claims to be a 'transparent' proxy, but still doesn't pass your svn commands correctly to the svn.freepascal.org server.
 +
 
 +
The svn.freepascal.org server also listens on port 8080. Maybe the proxy doesn't interfere with http trafic on that port, so you can try:
 +
svn co http://svn.freepascal.org:8080/svn/lazarus/trunk lazarus
 +
 
 +
The Lazarus svn repostory is mirrored on sourceforge with a delay of 15 minutes using [[fpsvnsync]]. The sourceforge repository uses the https protocol. Proxy servers usually don't interfere with that protocol. You can check out form sourceforge using the following command
 +
svn co https://svn.sourceforge.net/svnroot/lazarus/trunk lazarus
 +
 
 +
==== Using TortoiseSVN for Windows ====
 +
TortoiseSVN integrates itself with Windows Explorer. After installation, all commands are available from inside Windows Explorer through right-clicking on a directory or file.
 +
 
 +
 
 +
To get Lazarus for the first time:
 +
 
 +
* Open Windows Explorer
 +
* Create a directory where you want to put the files from the SVN server
 +
* Right click on the newly created directory
 +
* Select ''SVN Checkout...'' on the popup menu
 +
 
 +
[[Image:TortoiseSVN_Main_Menu.png]]
 +
 
 +
* In the next dialog you enter the URL for Lazarus server source:
 +
http://svn.freepascal.org/svn/lazarus/trunk
 +
* Watch how TortoiseSVN imports the file tree from the server. This can take some time to complete.
 +
 
 +
 
 +
To update Lazarus sources:
 +
 
 +
* Open Windows Explorer
 +
* Right click on the source directory
 +
* Select ''SVN Update'' on the popup menu
 +
 
 +
[[Image:TortoiseSVN_Main_Menu_Update.png]]
 +
 
 +
''Tip: There seems to be a resource hog bug somewhere in TortoiseSVN (1.24). After you've finished with TortoiseSVN and closed Windows Explorer, it may help to kill process TSVNCache.exe from Task Manager. --[[User:Prognatus|Prognatus]] 18:28, 26 Sep 2005 (CEST)''
 +
 
 +
 
 +
==== Scripts ====
 +
 
 +
[[user:Lightning|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.
 +
Please save the script as '''getlaz.bat''' or some other name, however there is no warranty of any kind, use at your own risk, put it in a test directory first and make sure there is no subdirectory already called '''lazarus'''.
 +
 
 +
@echo off
 +
REM Script for checkout and update Lazarus from SVN
 +
echo.
 +
 +
REM Check if lazarus directory exists to update or checkout first
 +
if exist lazarus (
 +
echo Updating Lazarus, please wait ...
 +
cd lazarus
 +
svn update
 +
if %errorlevel% NEQ 0 goto CleanupLaz
 +
cd ..
 +
goto Exit
 +
)
 +
 +
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 %errorlevel% NEQ 0 (
 +
cd ..
 +
echo.
 +
echo Cleanup Failed ! Please check or delete/move/rename the lazarus subdirectory ...
 +
goto Exit
 +
)
 +
 +
cd ..
 +
echo.
 +
echo Cleanup complete please run the script again.
 +
:Exit
 +
 
 +
 
 +
[[user:Matthijs|Matthijs]]:
 +
In Linux I use a script (it is not very sophisticated, but does the trick) to download the latest SVN-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 SVN I make a backup, just in case the current svn 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
 +
 +
# before you can use this script you have to checkout all files
 +
# so first do a
 +
# svn checkout http://svn.freepascal.org/svn/lazarus/trunk lazarus
 +
 +
#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 -fr
 +
else
 +
  date +"%T %tNo backup to remove"
 +
fi
 +
 +
date +"%T %tCreating copy of lazarus dir"
 +
cp -R $LAZDIR $LAZBACKUP
 
   
 
   
export CVSROOT=:pserver:cvs@cvs.freepascal.org:/FPC/CVS <br>
+
#Getting stuff from svn
cvs login  // (type "cvs" for the password)
+
date +"%T %tUpdate lazarus"
 +
svn update lazarus > ~/cvs_update.log
 
   
 
   
Hint: To do a fresh download of all files enter:
+
#Copying cvs-files to our laz dir.
cvs -z3 checkout lazarus
+
date +"%T %tcopying files"
 +
cp -Rf $LAZCVSDIR $BASEDIR --reply=yes
 
   
 
   
Hint: To do an update on an existing directory do:
+
#Make and building of lazarus
cvs -z3 update 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 ==
+
=== Installing the compiler ===
  
If you don't want to use cvs directly, a daily snapshot of the current cvs is available from the [ftp://ftp.freepascal.org/pub/fpc/source/lazarus.zip FPC ftp server].
+
[[user:Jouke|Jouke]]: If you are starting from scratch with the above, you won't have the FPC compiler installed. In other words the compiler is not included in the Lazarus SVN. It is possible to use a SVN version of FPC also, but generally it is better to use the latest stable release (at this moment v2.0.4). In my opinion it is preferable to try to rebuild the directory structure of a standard Lazarus install. Here is how I installed it (on WinXP):
  
== Downloading binaries ==
+
* Download the binary for your system from this page: http://www.freepascal.org/download.html.
 +
* Also download the source code from the same page.
 +
* Install the binaries by running a 'full install' and accepting all defaults.
 +
* Unpack the source files to the same directory as the binaries (c:\fpc\2.0.4\).
 +
* In your base Lazarus directory, create two new directories: 'pp' and 'fpcsrc'.
 +
* From the fpc directory c:\fpc\2.0.4\, select the directories 'bin, 'msg' and 'units' and copy them completely into the 'pp' directory you just created.
 +
* From the fpc source directory c:\fpc\2.0.4\fpc\, select the directories 'fcl', 'rtl' and 'packages'. Copy these three directories to the directory 'fpcsrc'.
 +
* While leaving out all directories which were already there and also leaving out the underlying directories, the Lazarus tree should now look like this:
 +
  C:\Lazarus\pp\bin
 +
                \msg
 +
                \units
 +
            \fpcsrc\fcl
 +
                    \packages
 +
                    \rtl
 +
* If you want, you can now delete the fpc sources and uninstall the fpc binaries.
 +
* Make sure the new path to the ppc386 executable is in your environment.
 +
* From the C:\lazarus\tools\install\win32 directory copy the file 'samplefpc.cfg' to the C:\lazarus\pp\bin\i386-win32 directory and rename it to fpc.cfg (first delete/rename the old fpc version).
 +
* Edit this file and replace all occurencies of '$1' by 'C:\lazarus\pp'.
  
Binaries for various platforms are also available via the [http://sourceforge.net/project/showfiles.php?group_id=89339 Lazarus Sourceforge download area] and via the main Lazarus [http://www.lazarus.freepascal.org/ homepage].
+
That's it. You should now be able to make Lazarus and start using it!
  
 
=Original contributors and changes=
 
=Original contributors and changes=
  
 
This page has been converted from the epikwiki [http://lazarus-ccr.sourceforge.net/index.php?wiki=GettingLazarus version].
 
This page has been converted from the epikwiki [http://lazarus-ccr.sourceforge.net/index.php?wiki=GettingLazarus version].

Revision as of 15:56, 16 June 2007

Deutsch (de) English (en) español (es) français (fr) 日本語 (ja) polski (pl) português (pt) русский (ru) slovenčina (sk)

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

Using the command line

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

Alternative URLs

Sometimes the URL of repository given above does not work, because between the svn server there is a http-proxy server. That server usually claims to be a 'transparent' proxy, but still doesn't pass your svn commands correctly to the svn.freepascal.org server.

The svn.freepascal.org server also listens on port 8080. Maybe the proxy doesn't interfere with http trafic on that port, so you can try:

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

The Lazarus svn repostory is mirrored on sourceforge with a delay of 15 minutes using fpsvnsync. The sourceforge repository uses the https protocol. Proxy servers usually don't interfere with that protocol. You can check out form sourceforge using the following command

svn co https://svn.sourceforge.net/svnroot/lazarus/trunk lazarus

Using TortoiseSVN for Windows

TortoiseSVN integrates itself with Windows Explorer. After installation, all commands are available from inside Windows Explorer through right-clicking on a directory or file.


To get Lazarus for the first time:

  • Open Windows Explorer
  • Create a directory where you want to put the files from the SVN server
  • Right click on the newly created directory
  • Select SVN Checkout... on the popup menu

TortoiseSVN Main Menu.png

  • In the next dialog you enter the URL for Lazarus server source:
http://svn.freepascal.org/svn/lazarus/trunk
  • Watch how TortoiseSVN imports the file tree from the server. This can take some time to complete.


To update Lazarus sources:

  • Open Windows Explorer
  • Right click on the source directory
  • Select SVN Update on the popup menu

TortoiseSVN Main Menu Update.png

Tip: There seems to be a resource hog bug somewhere in TortoiseSVN (1.24). After you've finished with TortoiseSVN and closed Windows Explorer, it may help to kill process TSVNCache.exe from Task Manager. --Prognatus 18:28, 26 Sep 2005 (CEST)


Scripts

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. Please save the script as getlaz.bat or some other name, however there is no warranty of any kind, use at your own risk, put it in a test directory first and make sure there is no subdirectory already called lazarus.

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

REM Check if lazarus directory exists to update or checkout first
if exist lazarus (
echo Updating Lazarus, please wait ...
cd lazarus
svn update
if %errorlevel% NEQ 0 goto CleanupLaz
cd ..
goto Exit
)

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 %errorlevel% NEQ 0 (
cd ..
echo.
echo Cleanup Failed ! Please check or delete/move/rename the lazarus subdirectory ...
goto Exit
)

cd ..
echo.
echo Cleanup complete please run the script again.
:Exit


Matthijs: In Linux I use a script (it is not very sophisticated, but does the trick) to download the latest SVN-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 SVN I make a backup, just in case the current svn 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

# before you can use this script you have to checkout all files
# so first do a
# svn checkout http://svn.freepascal.org/svn/lazarus/trunk lazarus

#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 -fr
else
  date +"%T %tNo backup to remove"
fi

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

#Getting stuff from svn
date +"%T %tUpdate lazarus"
svn update lazarus > ~/cvs_update.log

#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"

Installing the compiler

Jouke: If you are starting from scratch with the above, you won't have the FPC compiler installed. In other words the compiler is not included in the Lazarus SVN. It is possible to use a SVN version of FPC also, but generally it is better to use the latest stable release (at this moment v2.0.4). In my opinion it is preferable to try to rebuild the directory structure of a standard Lazarus install. Here is how I installed it (on WinXP):

  • Download the binary for your system from this page: http://www.freepascal.org/download.html.
  • Also download the source code from the same page.
  • Install the binaries by running a 'full install' and accepting all defaults.
  • Unpack the source files to the same directory as the binaries (c:\fpc\2.0.4\).
  • In your base Lazarus directory, create two new directories: 'pp' and 'fpcsrc'.
  • From the fpc directory c:\fpc\2.0.4\, select the directories 'bin, 'msg' and 'units' and copy them completely into the 'pp' directory you just created.
  • From the fpc source directory c:\fpc\2.0.4\fpc\, select the directories 'fcl', 'rtl' and 'packages'. Copy these three directories to the directory 'fpcsrc'.
  • While leaving out all directories which were already there and also leaving out the underlying directories, the Lazarus tree should now look like this:
  C:\Lazarus\pp\bin
               \msg
               \units
            \fpcsrc\fcl
                   \packages
                   \rtl
  • If you want, you can now delete the fpc sources and uninstall the fpc binaries.
  • Make sure the new path to the ppc386 executable is in your environment.
  • From the C:\lazarus\tools\install\win32 directory copy the file 'samplefpc.cfg' to the C:\lazarus\pp\bin\i386-win32 directory and rename it to fpc.cfg (first delete/rename the old fpc version).
  • Edit this file and replace all occurencies of '$1' by 'C:\lazarus\pp'.

That's it. You should now be able to make Lazarus and start using it!

Original contributors and changes

This page has been converted from the epikwiki version.