Difference between revisions of "Getting Lazarus/ja"

From Free Pascal wiki
Jump to navigationJump to search
(→‎Development versions from Git: Updated Git repo/mirror in English - already needed translation to Japanese)
 
(23 intermediate revisions by 5 users not shown)
Line 3: Line 3:
 
{{Japanese Menu}}
 
{{Japanese Menu}}
  
== リリースファイルをダウンロードする ==
+
== リリース版のダウンロードとインストール ==
  
 
=== SourceForgeから ===
 
=== SourceForgeから ===
Line 10: Line 10:
 
[http://sourceforge.net/project/showfiles.php?group_id=89339 Lazarus Sourceforge download area].
 
[http://sourceforge.net/project/showfiles.php?group_id=89339 Lazarus Sourceforge download area].
  
=== Ubuntuリポジトリから ===
+
=== プラットフォーム別 ===
  
www.hu.freepascal.orgに Ubuntuのリポジトリ(LazarusとFPCのdebs)があります。
+
Lazarus for Windows の取得 - 上記の Sourceforge へのリンクから取得してください。
  
==== 短縮版 ====
+
[[Lazarus release version for Ubuntu|Lazarus for Ubuntu の取得]]
ここでは、Ubuntuシステムにおいて、Lazarusをダウンロードしてインストールするためにコンソールでキー入力する完全なリストがあります。
 
1行1行説明することはしませんが、ファイルを取得してインストールできるものを提供します。
 
  
スクリプトを選択して、コピーします。そして、ホームディレクトリに'''getlaz'''という名前で保存してください。
+
[[Install_on_Fedora|Lazarus for Fedora の取得]]
  
  <nowiki>#!/bin/sh</nowiki>
+
[[Lazarus release version for Suse|Lazarus for Suse の取得]]
  <nowiki>gpg --keyserver hkp://pgp.mit.edu:11371 --recv-keys 6A11800F</nowiki>
 
  <nowiki>gpg --export 6A11800F | apt-key add -</nowiki>
 
  <nowiki>echo "deb http://www.hu.freepascal.org/lazarus/ lazarus-stable universe" \</nowiki>
 
  <nowiki>    >/etc/apt/sources.list.d/lazarus.list</nowiki>
 
  <nowiki>apt-get update</nowiki>
 
  <nowiki>apt-get install lazarus</nowiki>
 
  
シェルプロンプトで、これらを入力して実行してください。(コピー後、シェルでShift+Insertキーで貼り付けできます。):
+
[[Lazarus release version for Mandriva|Lazarus for Mandriva の取得]]
  
  <nowiki>chmod +x getlaz</nowiki>
+
[[Installing Lazarus on macOS|Lazarus for Mac の取得]]
  <nowiki>sudo ./getlaz</nowiki>
 
  
このプロセスはLazarusリポジトリから標準的なデータで100Mbくらいのデータをダウンロードします。
+
== SVN からの取得 ==
高速の環境でも、最低5分はかかるでしょう。
 
どんな段階でも、停止するかと尋ねられたときは、はい''Y''と答えることでやめることができます。
 
  
終了してシェルプロンプトに戻ったとき、準備ができています。Ubuntuのメニューから"Development"セクションを見てください。そこにLazarusがあり、動作します。
+
=== TortoiseSVN クライアント ===
  
完全主義の方々には、次から段階ごとに説明があります。インストールがちゃんと成功していれば無視してもかまいません。しかし、何かあれば、wikiに戻って、テストしたことや、信用性のある更新を書いてください。このセクションを明確なものにするために、協力してください。
+
Windows なら TortoiseSVN クライアントが使えます。 http://tortoisesvn.tigris.org/ からダウンロードして下さい。
  
==== キーを追加する ====
+
[[TortoiseSvn|こちら]] で、SVN からのソースのダウンロードやアップデートのやり方について紹介しています。Lazarus だけでなく、FPC についても同じやり方で SVN からソースを取得できます。
  
公開鍵サーバーから、キーを取得します。
 
  
  gpg --keyserver hkp://pgp.mit.edu:11371 --recv-keys 6A11800F
+
=== Other clients ===
  
apt keyに加えます。
+
その他の多くのプラットホーム用に、SVNコマンドラインクライアントがオフィシャルSVNサイト[http://subversion.tigris.org/ website]から提供されていますので、利用してください。
  gpg --export 6A11800F | sudo apt-key add -
 
  
次の命令でapt keyを確認できます。
+
Linuxでは、ディストリビューションのパッケージ管理システムを使ってsubversionをインストールすることをお勧めします。例えば次のようなコマンドを使います。
  sudo apt-key list
 
  
==== リポジトリを追加する ====
+
sudo apt-get install subversion
  
You can use synaptic for this or edit the /etc/apt/sources.list directly. For the stable repository, add the line:
 
  <nowiki>deb http://www.hu.freepascal.org/lazarus/ lazarus-stable universe</nowiki>
 
Or using a console app. do:
 
  <nowiki>echo "deb http://www.hu.freepascal.org/lazarus/ lazarus-stable universe">/etc/apt/sources.list.d/lazarus.list</nowiki>
 
For the testing repository:
 
  <nowiki>deb http://www.hu.freepascal.org/lazarus/ lazarus-testing universe</nowiki>
 
Or similarly, using a console app. do:
 
  <nowiki>echo "deb http://www.hu.freepascal.org/lazarus/ lazarus-testing universe">/etc/apt/sources.list.d/lazarus.list</nowiki>
 
  
==== apt-getでLazarusをインストール ====
+
==Lazarus SVN 開発版の取得==
  
これでaptでLazarusがインストールできるようになりました。
+
=== コマンドラインで使う ===
  <nowiki>apt-get update; apt-get install lazarus</nowiki>
 
  
=== FedoraでLazarusをインストール ===
+
最初にLazarusを取得するには:
  
Lazarus is part of the standard Fedora-repositories since Fedora version 9. You can install it using the command-line ('yum install lazarus') or by using the 'add/remove software' wizard. If you want to install Lazarus during the installation of Fedora, you have to enable the additional repositories during install.
+
端末か、コマンドプロンプトを開いて、カレントディレクトリを、インストールしたい場所にLazarusディレクトリを作ってそこに移っておいてください。そして次のようにタイプします。:
 +
  <nowiki>svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus</nowiki>
 +
 
 +
Lazarusのソースをアップデートするには:
 +
 
 +
端末かコマンドプロンプトを開いて、Lazarusディレクトリに移った後、次のようにタイプします。:
 +
  <nowiki>svn update</nowiki>
 +
 
 +
コンパイルについては、[[#Compiling_and_installing_Lazarus|こちら]]を参照してください。
 +
 
 +
=== そのほかのリポジトリのURL ===
 +
時々、先ほどのリポジトリはうまく動かないことがあります。なぜならsvnサーバーとの間にhttpプロクシサーバーがありからです。そのサーバーは通常'透過'プロクシとして動作するはずですが、あなたのsvnコマンドを正しくsvn.freepascal.orgサーバーへ渡さないことがあります。
 +
 
 +
一方、svn.freepascal.orgサーバーは8080ポートでもソケットを受け付けます。おそらくプロクシはそのポートのhttpトラフィックにたいして関与しません。ですから、プロクシ経由で上手くいかないばあい、次を試してみてください。
 +
<nowiki>svn co http://svn.freepascal.org:8080/svn/lazarus/trunk lazarus</nowiki>
 +
 
 +
Lazarus svnリポジトリは[[fpsvnsync]を使って15分後にsourceforgeにミラーされています。sourceforgeリポジトリはhttpsプロトコルを使います。sourceforgeを使う場合、次のコマンドを使います。
 +
<nowiki>svn co https://svn.sourceforge.net/svnroot/lazarus/trunk lazarus</nowiki>
 +
 
 +
FPCとLazarusのsvnリポジトリは、さらに svn2.freepascal.org へミラーされています。svn2.freepascal.org からチェックアウトする場合は次のコマンドを使います。
 +
<nowiki>svn co http://svn2.freepascal.org/svn/lazarus/trunk lazarus</nowiki>
 +
 
 +
もし、独自のプロクシサーバーがある場合や、友人のプロクシサーバーを借りてアクセスしている時は、プロクシにsvnコマンドを通過するように設定してください。設定の方法は次のとおりです。:
 +
 
 +
http://subversion.tigris.org/faq.html#proxy
 +
 
 +
ここにはsquidの例があります。クライアントにもproxyを使うように設定してください。(TortoiseSVNの場合は settings / networkを参照してください。)
 +
 
 +
=== スクリプト ===
 +
 
 +
Lazarus を自動的にダウンロード、ビルドする、Windows と Linux 用のスクリプト:
 +
[[LazarusScripts|Scripts for Lazarus]]
 +
 
 +
==Lazarus のコンパイルとインストール==
 +
 
 +
[[Installing Lazarus]] を参照してください - 詳しいインストールガイドです。または、 http://www.stack.nl/~marcov/buildfaq.pdf - さらに詳細なガイドです。
 +
 
 +
===Using the command-line===
 +
 
 +
Lazarus is shipped with Makefile for gnu make util. (Be warned, if you also have Codegear (or Borland) tools installed, it might conflict with gnu "make" util).
 +
 
 +
The tool allows you to compile the lazarus from command-line easily.
 +
You need to have fpc and fpc-packages installed and configured first.
 +
 
 +
To compile go to Lazarus directory in your terminal and type
 +
  make
 +
 
 +
This should rebuild LCL and Lazarus IDE (with basic packages installed).
 +
 
 +
===Make targets===
 +
Following compiling targets can be specified for the make tool:
 +
 
 +
* '''clean''' - the command will clean all compiled LCL and IDE units. Warning, this might make your project uncompilable (even though IDE still run, since binary is not deleted). For example: "''make clean''"
 +
 
 +
* '''bigide''' - the command rebuilds LCL and IDE with additional packages. For example: "''make bigide''"
 +
 
 +
* '''lcl''' - the command rebuild LCL only. IDE is left untouched. The command is very useful if you're making changes to LCL and need to test the changes on your project without breaking Lazarus. Rebuild LCL only is faster than rebuilding both LCL and IDE. For example: "''make lcl''"
 +
 
 +
* '''components'''
 +
* '''packager/registration'''
 +
* '''ideintf'''
 +
* '''packager'''
 +
* '''bigidecomponents'''
 +
* '''ide'''
 +
* '''idepkg'''
 +
* '''idebig'''
 +
* '''bigide'''
 +
* '''starter''' - the command rebuilds startlazarus binary.
 +
* '''lazbuilder'''
 +
* '''tools'''
 +
* '''all'''
 +
* '''cleanide'''
 +
* '''purge'''
 +
* '''examples''' - the command rebuilds examples lazarus
 +
* '''install'''
 +
* '''lazbuild'''
 +
 
 +
 
 +
If no target is specified LCL and IDE Lazarus (with basic set of components) is rebuilt.
 +
 
 +
===Make parameters===
 +
There're also additional parameters, can be used for 'making' Lazarus.
 +
 
 +
* '''OPT'''=%compiler_switches
 +
the %compiler_switches is passed to each fpc call. The option is useful for specifying defines
 +
 
 +
For example:
 +
  make bigide OPT="-dNoGdkPixBufLib -gw2"
 +
makes LCL and ide with NoGdkPixBufLib defined and dwarf2 debug info.
 +
 
 +
* '''LCL_PLATFORM'''=%platform
 +
%platform is the target Widgetset. It can be win32,gtk,gtk2,qt,carbon or cocoa.
 +
 
 +
For example:
 +
  make LCL_PLATFORM=gtk2
 +
Rebuilds LCL and IDE for gtk2 widgetset
 +
 
 +
* '''FPC'''=%compiler_path
 +
%compiler_path is the path to a custom compiler binary you want to build the target with.
 +
 
 +
==Getting FPC SVN development version==
 +
 
 +
Here are some hints how to get and install the development version of FPC (at the moment 2.5.1), which contains new features, bug fixes but is less stable and contains new bugs.
 +
The compiler is not included in the Lazarus SVN, but has its own FPC SVN. You ''must'' install first the latest released FPC. Download it from here http://sourceforge.net/projects/freepascal/ and install, or see more details here: [[Installing_Lazarus#Installing_The_Free_Pascal_Compiler|Installing the Free Pascal Compiler]].
 +
 
 +
Then create a directory and download FPC from SVN:
 +
 
 +
mkdir -p ~/freepascal
 +
cd ~/freepascal
 +
svn co http://svn.freepascal.org/svn/fpc/trunk fpc
 +
 
 +
This will take some time.
 +
 
 +
You can also use TortoiseSVN client on Windows as explained earlier.
 +
 
 +
==FPC のコンパイルとインストール==
 +
 
 +
FPC のコンパイルとインストール方法はいくつかあります。
 +
 
 +
* Use plain ''make''.
 +
* Build a FPC package for your Linux distribution (.deb or .rpm file). The package allows to easily uninstall, upgrade and downgrade FPC and makes sure that all files are installed at the common places. So if something goes wrong, other users know how to help you.
 +
 
 +
In either case Lazarus must finally be configured for the new FPC.
 +
 
 +
===Building and installing Free Pascal in UNIXe===
 +
 
 +
The following instructions work in UNIX platforms, such as Linux, but also Mac OS X.
 +
 
 +
Building Free Pascal from source code can be useful in a number of situations. One example is when debugging a problem in the compiler, in the RTL or in the FCL. The distributed FPC installs come without debug info, but the install created from the makefiles constains debug info by default. Another use is testing the development version of the compiler, although often there are also snapshots available for that.
 +
 
 +
<b>Step 1 - Make sure you have a compatible starting compiler installed.</b>
 +
 
 +
Usually this will mean having installed the latest stable release.
 +
 
 +
<b>Step 2 - Download the source of the new compiler</b>
  
Once installed you can find Lazarus in the 'Applications/Programming' menu.
+
The first thing to do is downloading the Free Pascal source code for the version you desire to build. For example, to download the latest fixes 2.4 branch do:
  
Note that if you want to develop gtk2 applications, you also have to install 'gtk2-devel'.
+
svn checkout http://svn.freepascal.org/svn/fpc/branches/fixes_2_4 fpcfixes2_4
  
== SVNでバージョン開発 ==
+
<b>Step 3 - Build the compiler</b>
=== 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.
 
  
On Linux, it is recomended to use the package management system offered by your distribution to install subversion.
+
Now enter the newly created directory and build and install Free Pascal:
  
=== SVNの使い方 ===
+
  cd fpcfixes2_4
 +
  make clean all install INSTALL_PREFIX=~
  
==== コマンドラインで使う ====
+
This will compile the compiler in 3 cycles, first using the already installed compiler and then using the newly compiled compiler.
  
To get Lazarus for the first time:
+
It install all needed files in the specified directory. You can install to any other directory if needed. You just have to use the root account if the directory does not allow writing with your normal user account.
  
Open a terminal/command prompt, change to the directory you wish the Lazarus folder to be created in and type:
+
<b>Step 4 - Update your fpc.cfg file</b>
  <nowiki>svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus</nowiki>
+
 
 +
Then create a file
 +
  ~/.fpc.cfg
 +
 
 +
It is a hidden file (note the first dot). Enter the following contents to the file. If you installed to another directory, use that instead of your home dir.
  
To update Lazarus sources:
+
  #include /etc/fpc.cfg
 +
  -Fu~/lib/fpc/$fpcversion/units/$fpctarget
 +
  -Fu~/lib/fpc/$fpcversion/units/$fpctarget/*
 +
  -Fu~/lib/fpc/$fpcversion/units/$fpctarget/rtl
  
Open a terminal/command prompt, change to the lazarus directory and type:
+
This allows installing any future fpc versions into PREFIX=~ without touching that config file.
  svn update
 
  
==== そのほかのURLなど ====
+
To run fpc, ~/bin must be in PATH environment variable. Usually it is there by default.
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.
+
You also must add path ~/lib/fpc/2.5.1 to PATH because the actual compiler binary is located there.
 +
Most Linux systems now use bash shell and this configuration can be added to ~/.bashrc (a hidden file again) :
 +
  export PATH=~/lib/fpc/2.5.1:$PATH
  
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:
+
Note that path separator is ":" under Linux (";" under Windows). Now see "Configure Lazarus for the new fpc" below for the next step.
<nowiki>svn co http://svn.freepascal.org:8080/svn/lazarus/trunk lazarus</nowiki>
 
  
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
+
===Build a debian/ubuntu package===
<nowiki>svn co https://svn.sourceforge.net/svnroot/lazarus/trunk lazarus</nowiki>
 
  
The FPC and Lazarus svn repostories are also mirrored to svn2.freepascal.org. You can check out from svn2.freepascal.org with
+
'''Important''': This script does not create the official debian/ubuntu packages. It creates a fpc package that contains the compiler and all packages.  
<nowiki>svn co http://svn2.freepascal.org/svn/lazarus/trunk lazarus</nowiki>
 
  
If you own the proxy server, or are friends with the person who does, there are details of setting up a proxy to pass svn commands here: http://subversion.tigris.org/faq.html#proxy This contains an example for squid.  Remember to set up the client to use the proxy !  (For TortoiseSVN, see settings/network)
+
To build the package you need to install some packages:
  
==== WindowsでTortoiseSVNを使う ====
+
sudo apt-get install libgpmg1-dev fakeroot libncurses5-dev build-essential
TortoiseSVN integrates itself with Windows Explorer. After installation, all commands are available from inside Windows Explorer through right-clicking on a directory or file.
 
  
Check out a working copy using TortoiseSVN, go to Run and paste the command below:
+
Go into your lazarus source directory. The directory must be writable.
<nowiki>tsvn:http://svn.freepascal.org/svn/lazarus/trunk</nowiki>
 
  
To get Lazarus for the first time:
+
cd ~/freepascal/lazarus/tools/install
 +
./create_fpc_deb.sh fpc ~/freepascal/fpc
  
* Open Windows Explorer
+
If you get an error about a missing file or tool you may have to install a missing package. If you get a compilation error your installed fpc is not the released compiler or you were unlucky and fetched a fpc svn reversion that contains a bug. Search help on the mailing list, forum or chat.
* Create a directory where you want to put the files from the SVN server
+
If it ran through you now have a deb file, which you can install:
* Right click on the newly created directory
 
* Select ''SVN Checkout...'' on the popup menu
 
  
[[Image:TortoiseSVN_Main_Menu.png]]
+
  sudo dpkg -i fpc_2.5.1-091121_i386.deb
  
* In the next dialog you enter the URL for Lazarus server source:
+
The file name is different for you.
<nowiki>http://svn.freepascal.org/svn/lazarus/trunk</nowiki>
 
* Watch how TortoiseSVN imports the file tree from the server. This can take some time to complete.
 
  
 +
===Build a RPM package===
  
To update Lazarus sources:
+
ToDo...
  
* Open Windows Explorer
+
===Configure Lazarus for the new FPC===
* Right click on the source directory
 
* Select ''SVN Update'' on the popup menu
 
  
[[Image:TortoiseSVN_Main_Menu_Update.png]]
+
Now fpc is installed either by "make install" or by using a distro specific package.
 +
The next step is to compile lazarus svn with the new compiler and tell the IDE to use the directory ''/home/username/freepascal/fpc'' as ''FPC source directory''.
  
==== スクリプトで自動化 ====
+
If you have not yet downloaded the lazarus svn, do it now: [[Getting_Lazarus#Development_versions_from_SVN|Development versions from SVN]]. For example:
  
[[user:Lightning|Lightning]]:
+
cd ~/freepascal
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.
+
svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus
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
+
This will take some time, continue with:
REM Script for checkout and update Lazarus from SVN
+
  cd ~/freepascal/lazarus
echo.
+
  make clean all
 
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
 
  
 +
If this gives linker errors, you have to install some packages (build-essential, libgtk2.0-dev,libgdk-pixbuf-dev).
 +
Start the IDE:
 +
cd ~/freepascal/lazarus
 +
./lazarus
  
[[user:Matthijs|Matthijs]]:
+
This is a minimal IDE without any extra packages. Now the IDE must be setup and can be built with packages:  
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
+
* Go to Environment / Options / Environment
+
* Set lazarus directory to ''/home/username/freepascal/lazarus''
# before you can use this script you have to checkout all files
+
* Set ''FPC source directory'' to ''/home/username/freepascal/fpc''
# so first do a
+
* Click ''Ok'' to close the dialog
# svn checkout http://svn.freepascal.org/svn/lazarus/trunk lazarus
+
* Tools / Configure Build Lazarus / Quick Build Options / Build IDE with packages
+
* Click ''Build''.
#Define some directories
+
* Restart the IDE
BASEDIR=/usr/share/
+
* Now you have the latest and greatest IDE built with the latest and greatest FPC.
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"
 
  
=== FPCコンパイラをインストールする ===
+
== Getting Lazarus from the GitLab 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):
+
Development version of Lazarus[edit]
 +
To get Lazarus for the first time, using command line:
 +
git clone https://gitlab.com/freepascal.org/lazarus/lazarus.git lazarus
 +
A new directory "lazarus" is then created under the current directory.
  
* Download the binary for your system from this page: http://www.freepascal.org/download.html.
+
== Development versions from Mercurial ==
* Also download the source code from the same page.
+
<s>There is a Hg mirror of the official SubVersion repository being maintained on [http://florianklaempfl.de:8000/lazarustrunk/ florianklaempfl.de].</s>
* 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!
+
This mirror does not exist any more. See the [http://lists.freepascal.org/lists/fpc-devel/2010-June/020442.html message] from Florian Klämpfl.
  
 
== Daily Snapshotの方法 ==
 
== Daily Snapshotの方法 ==
  
If you don't want to use svn directly, you can try a daily snapshot. For a list of mirrors see the [[Lazarus Snapshots Downloads]] page.
+
もし、svnディレクトリを使いたくない場合、daily snapshotを使ってみてください。
 +
[[Lazarus Snapshots Downloads]]ページに、ミラーのリストがあります。
  
==Browse the Source Repository with a Web Browser==
+
==ソースリポジトリをWebブラウザで見る==
  
The contents of the SVN archive can also be browsed with your web-browser through [http://www.freepascal.org/cgi-bin/viewcvs.cgi/?root=lazarus this viewcvs] interface.
+
SVNアーカイブの内容はWebブラウザから、
 +
[http://www.freepascal.org/cgi-bin/viewcvs.cgi/?root=lazarus this viewcvs]
 +
を通して見ることができます。
  
 
==Lazarus ディストリビューション==
 
==Lazarus ディストリビューション==
  
There are some unofficial sites where you can find Lazarus and Free Pascal too:
+
LazarusとFree Pascalが含まれるいくつかの非公式なディストリビューションを見つけることができます。
  
*You can get a Ubuntu LiveCD from Austrian University of Applied Sciences hosting
+
*オーストリア大学 応用科学部
 
http://www.sigma-server.com/liveCD/Ubuntu-7.10-NTC-Lazarus.iso
 
http://www.sigma-server.com/liveCD/Ubuntu-7.10-NTC-Lazarus.iso
and md5sum file is here http://www.sigma-server.com/liveCD/Ubuntu-7.10-NTC-Lazarus.iso.md5.
+
 
 +
上記のmd5sumファイル
 +
http://www.sigma-server.com/liveCD/Ubuntu-7.10-NTC-Lazarus.iso.md5.
  
 
==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].
 +
 +
[[Category:Lazarus/ja]]

Latest revision as of 07:28, 13 January 2022

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

日本語版メニュー
メインページ - Lazarus Documentation日本語版 - 翻訳ノート - 日本語障害情報

リリース版のダウンロードとインストール

SourceForgeから

いろいろなプラットホームのバイナリリリースが、SourceForgeのダウンロードエリアで配布されています。 Lazarus Sourceforge download area.

プラットフォーム別

Lazarus for Windows の取得 - 上記の Sourceforge へのリンクから取得してください。

Lazarus for Ubuntu の取得

Lazarus for Fedora の取得

Lazarus for Suse の取得

Lazarus for Mandriva の取得

Lazarus for Mac の取得

SVN からの取得

TortoiseSVN クライアント

Windows なら TortoiseSVN クライアントが使えます。 http://tortoisesvn.tigris.org/ からダウンロードして下さい。

こちら で、SVN からのソースのダウンロードやアップデートのやり方について紹介しています。Lazarus だけでなく、FPC についても同じやり方で SVN からソースを取得できます。


Other clients

その他の多くのプラットホーム用に、SVNコマンドラインクライアントがオフィシャルSVNサイトwebsiteから提供されていますので、利用してください。

Linuxでは、ディストリビューションのパッケージ管理システムを使ってsubversionをインストールすることをお勧めします。例えば次のようなコマンドを使います。

sudo apt-get install subversion


Lazarus SVN 開発版の取得

コマンドラインで使う

最初にLazarusを取得するには:

端末か、コマンドプロンプトを開いて、カレントディレクトリを、インストールしたい場所にLazarusディレクトリを作ってそこに移っておいてください。そして次のようにタイプします。:

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

Lazarusのソースをアップデートするには:

端末かコマンドプロンプトを開いて、Lazarusディレクトリに移った後、次のようにタイプします。:

 svn update

コンパイルについては、こちらを参照してください。

そのほかのリポジトリのURL

時々、先ほどのリポジトリはうまく動かないことがあります。なぜならsvnサーバーとの間にhttpプロクシサーバーがありからです。そのサーバーは通常'透過'プロクシとして動作するはずですが、あなたのsvnコマンドを正しくsvn.freepascal.orgサーバーへ渡さないことがあります。

一方、svn.freepascal.orgサーバーは8080ポートでもソケットを受け付けます。おそらくプロクシはそのポートのhttpトラフィックにたいして関与しません。ですから、プロクシ経由で上手くいかないばあい、次を試してみてください。

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

Lazarus svnリポジトリは[[fpsvnsync]を使って15分後にsourceforgeにミラーされています。sourceforgeリポジトリはhttpsプロトコルを使います。sourceforgeを使う場合、次のコマンドを使います。

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

FPCとLazarusのsvnリポジトリは、さらに svn2.freepascal.org へミラーされています。svn2.freepascal.org からチェックアウトする場合は次のコマンドを使います。

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

もし、独自のプロクシサーバーがある場合や、友人のプロクシサーバーを借りてアクセスしている時は、プロクシにsvnコマンドを通過するように設定してください。設定の方法は次のとおりです。:

http://subversion.tigris.org/faq.html#proxy

ここにはsquidの例があります。クライアントにもproxyを使うように設定してください。(TortoiseSVNの場合は settings / networkを参照してください。)

スクリプト

Lazarus を自動的にダウンロード、ビルドする、Windows と Linux 用のスクリプト: Scripts for Lazarus

Lazarus のコンパイルとインストール

Installing Lazarus を参照してください - 詳しいインストールガイドです。または、 http://www.stack.nl/~marcov/buildfaq.pdf - さらに詳細なガイドです。

Using the command-line

Lazarus is shipped with Makefile for gnu make util. (Be warned, if you also have Codegear (or Borland) tools installed, it might conflict with gnu "make" util).

The tool allows you to compile the lazarus from command-line easily. You need to have fpc and fpc-packages installed and configured first.

To compile go to Lazarus directory in your terminal and type

 make

This should rebuild LCL and Lazarus IDE (with basic packages installed).

Make targets

Following compiling targets can be specified for the make tool:

  • clean - the command will clean all compiled LCL and IDE units. Warning, this might make your project uncompilable (even though IDE still run, since binary is not deleted). For example: "make clean"
  • bigide - the command rebuilds LCL and IDE with additional packages. For example: "make bigide"
  • lcl - the command rebuild LCL only. IDE is left untouched. The command is very useful if you're making changes to LCL and need to test the changes on your project without breaking Lazarus. Rebuild LCL only is faster than rebuilding both LCL and IDE. For example: "make lcl"
  • components
  • packager/registration
  • ideintf
  • packager
  • bigidecomponents
  • ide
  • idepkg
  • idebig
  • bigide
  • starter - the command rebuilds startlazarus binary.
  • lazbuilder
  • tools
  • all
  • cleanide
  • purge
  • examples - the command rebuilds examples lazarus
  • install
  • lazbuild


If no target is specified LCL and IDE Lazarus (with basic set of components) is rebuilt.

Make parameters

There're also additional parameters, can be used for 'making' Lazarus.

  • OPT=%compiler_switches

the %compiler_switches is passed to each fpc call. The option is useful for specifying defines

For example:

 make bigide OPT="-dNoGdkPixBufLib -gw2" 

makes LCL and ide with NoGdkPixBufLib defined and dwarf2 debug info.

  • LCL_PLATFORM=%platform

%platform is the target Widgetset. It can be win32,gtk,gtk2,qt,carbon or cocoa.

For example:

 make LCL_PLATFORM=gtk2

Rebuilds LCL and IDE for gtk2 widgetset

  • FPC=%compiler_path

%compiler_path is the path to a custom compiler binary you want to build the target with.

Getting FPC SVN development version

Here are some hints how to get and install the development version of FPC (at the moment 2.5.1), which contains new features, bug fixes but is less stable and contains new bugs. The compiler is not included in the Lazarus SVN, but has its own FPC SVN. You must install first the latest released FPC. Download it from here http://sourceforge.net/projects/freepascal/ and install, or see more details here: Installing the Free Pascal Compiler.

Then create a directory and download FPC from SVN:

mkdir -p ~/freepascal
cd ~/freepascal
svn co http://svn.freepascal.org/svn/fpc/trunk fpc

This will take some time.

You can also use TortoiseSVN client on Windows as explained earlier.

FPC のコンパイルとインストール

FPC のコンパイルとインストール方法はいくつかあります。

  • Use plain make.
  • Build a FPC package for your Linux distribution (.deb or .rpm file). The package allows to easily uninstall, upgrade and downgrade FPC and makes sure that all files are installed at the common places. So if something goes wrong, other users know how to help you.

In either case Lazarus must finally be configured for the new FPC.

Building and installing Free Pascal in UNIXe

The following instructions work in UNIX platforms, such as Linux, but also Mac OS X.

Building Free Pascal from source code can be useful in a number of situations. One example is when debugging a problem in the compiler, in the RTL or in the FCL. The distributed FPC installs come without debug info, but the install created from the makefiles constains debug info by default. Another use is testing the development version of the compiler, although often there are also snapshots available for that.

Step 1 - Make sure you have a compatible starting compiler installed.

Usually this will mean having installed the latest stable release.

Step 2 - Download the source of the new compiler

The first thing to do is downloading the Free Pascal source code for the version you desire to build. For example, to download the latest fixes 2.4 branch do:

svn checkout http://svn.freepascal.org/svn/fpc/branches/fixes_2_4 fpcfixes2_4

Step 3 - Build the compiler

Now enter the newly created directory and build and install Free Pascal:

 cd fpcfixes2_4
 make clean all install INSTALL_PREFIX=~

This will compile the compiler in 3 cycles, first using the already installed compiler and then using the newly compiled compiler.

It install all needed files in the specified directory. You can install to any other directory if needed. You just have to use the root account if the directory does not allow writing with your normal user account.

Step 4 - Update your fpc.cfg file

Then create a file

 ~/.fpc.cfg

It is a hidden file (note the first dot). Enter the following contents to the file. If you installed to another directory, use that instead of your home dir.

 #include /etc/fpc.cfg
 -Fu~/lib/fpc/$fpcversion/units/$fpctarget
 -Fu~/lib/fpc/$fpcversion/units/$fpctarget/*
 -Fu~/lib/fpc/$fpcversion/units/$fpctarget/rtl

This allows installing any future fpc versions into PREFIX=~ without touching that config file.

To run fpc, ~/bin must be in PATH environment variable. Usually it is there by default. You also must add path ~/lib/fpc/2.5.1 to PATH because the actual compiler binary is located there. Most Linux systems now use bash shell and this configuration can be added to ~/.bashrc (a hidden file again) :

 export PATH=~/lib/fpc/2.5.1:$PATH

Note that path separator is ":" under Linux (";" under Windows). Now see "Configure Lazarus for the new fpc" below for the next step.

Build a debian/ubuntu package

Important: This script does not create the official debian/ubuntu packages. It creates a fpc package that contains the compiler and all packages.

To build the package you need to install some packages:

sudo apt-get install libgpmg1-dev fakeroot libncurses5-dev build-essential

Go into your lazarus source directory. The directory must be writable.

cd ~/freepascal/lazarus/tools/install
./create_fpc_deb.sh fpc ~/freepascal/fpc

If you get an error about a missing file or tool you may have to install a missing package. If you get a compilation error your installed fpc is not the released compiler or you were unlucky and fetched a fpc svn reversion that contains a bug. Search help on the mailing list, forum or chat. If it ran through you now have a deb file, which you can install:

 sudo dpkg -i fpc_2.5.1-091121_i386.deb

The file name is different for you.

Build a RPM package

ToDo...

Configure Lazarus for the new FPC

Now fpc is installed either by "make install" or by using a distro specific package. The next step is to compile lazarus svn with the new compiler and tell the IDE to use the directory /home/username/freepascal/fpc as FPC source directory.

If you have not yet downloaded the lazarus svn, do it now: Development versions from SVN. For example:

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

This will take some time, continue with:

cd ~/freepascal/lazarus
make clean all

If this gives linker errors, you have to install some packages (build-essential, libgtk2.0-dev,libgdk-pixbuf-dev). Start the IDE:

cd ~/freepascal/lazarus
./lazarus

This is a minimal IDE without any extra packages. Now the IDE must be setup and can be built with packages:

  • Go to Environment / Options / Environment
  • Set lazarus directory to /home/username/freepascal/lazarus
  • Set FPC source directory to /home/username/freepascal/fpc
  • Click Ok to close the dialog
  • Tools / Configure Build Lazarus / Quick Build Options / Build IDE with packages
  • Click Build.
  • Restart the IDE
  • Now you have the latest and greatest IDE built with the latest and greatest FPC.

Getting Lazarus from the GitLab server

Development version of Lazarus[edit] To get Lazarus for the first time, using command line:

git clone https://gitlab.com/freepascal.org/lazarus/lazarus.git lazarus

A new directory "lazarus" is then created under the current directory.

Development versions from Mercurial

There is a Hg mirror of the official SubVersion repository being maintained on florianklaempfl.de.

This mirror does not exist any more. See the message from Florian Klämpfl.

Daily Snapshotの方法

もし、svnディレクトリを使いたくない場合、daily snapshotを使ってみてください。 Lazarus Snapshots Downloadsページに、ミラーのリストがあります。

ソースリポジトリをWebブラウザで見る

SVNアーカイブの内容はWebブラウザから、 this viewcvs を通して見ることができます。

Lazarus ディストリビューション

LazarusとFree Pascalが含まれるいくつかの非公式なディストリビューションを見つけることができます。

  • オーストリア大学 応用科学部

http://www.sigma-server.com/liveCD/Ubuntu-7.10-NTC-Lazarus.iso

上記のmd5sumファイル http://www.sigma-server.com/liveCD/Ubuntu-7.10-NTC-Lazarus.iso.md5.

Original contributors and changes

This page has been converted from the epikwiki version.