Difference between revisions of "Getting Lazarus/ja"

From Free Pascal wiki
Jump to navigationJump to search
Line 157: Line 157:
  
 
[[user:Lightning|Lightning]]:
 
[[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.
+
これは、'''SVN'''から'''Lazarus'''をサブディレクトリにチェックアウトして更新し、基本的なエラー修正をおこなうwindowsのバッチファイルです。
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'''.
+
なぜなら、Lazarusがどこにインストールされているか分かる方法がなく、わからなければ、コンパイルできないし、コピーすることができないからです。
 +
このバッチファイルを'''getlaz.bat'''のような名前で、最初のテストディレクトリ(サブディレクトリにすでに'''lazarus'''がないところ)に保存してください。
 +
 
 +
注意:何の保証もしませんので、自己責任で利用してください。
 +
 
  
 
  @echo off
 
  @echo off
Line 196: Line 200:
  
 
[[user:Matthijs|Matthijs]]:
 
[[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.
+
私はLinuxで、最新のLazarusのSVNバージョンをダウンロードするために下記のシェルスクリプトを使っています。(これは、わかりにくくあまり洗練されていないかもしれません。)
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.
+
私のホームディレクトリに特別にcvsrootディレクトリがあります。このディレクトリにLazarusや他の興味のあるプロジェクトをダウンロードするスクリプトをおいています。Lazarusは/usr/share/lazarusにインストールしています。
 +
 
 +
現在のSVNが安定版ではないとき、SVNから新しいバージョンをビルドする前に、私はバックアップを作ります。これは、 /usr/share/lazarus directory /usr/share/lazarus.bu に移動することで済みます。
 +
 
 +
このスクリプトをあなたのシステムにカスタマイズするには、最初のほうにある定数の定義を変更するだけです。
 +
 
 +
注意:何の保証もしませんので、自己責任で利用してください。
  
 
  #!/bin/bash
 
  #!/bin/bash

Revision as of 02:08, 13 July 2008

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.

Ubuntuリポジトリから

www.hu.freepascal.orgに Ubuntuのリポジトリ(LazarusとFPCのdebs)があります。

短縮版

ここでは、Ubuntuシステムにおいて、Lazarusをダウンロードしてインストールするためにコンソールでキー入力する完全なリストがあります。 1行1行説明することはしませんが、ファイルを取得してインストールできるものを提供します。

スクリプトを選択して、コピーします。そして、ホームディレクトリにgetlazという名前で保存してください。

 #!/bin/sh
 gpg --keyserver hkp://pgp.mit.edu:11371 --recv-keys 6A11800F
 gpg --export 6A11800F | apt-key add -
 echo "deb http://www.hu.freepascal.org/lazarus/ lazarus-stable universe" \
     >/etc/apt/sources.list.d/lazarus.list
 apt-get update
 apt-get install lazarus

シェルプロンプトで、これらを入力して実行してください。(コピー後、シェルでShift+Insertキーで貼り付けできます。):

 chmod +x getlaz
 sudo ./getlaz

このプロセスはLazarusリポジトリから標準的なデータで100Mbくらいのデータをダウンロードします。 高速の環境でも、最低5分はかかるでしょう。 どんな段階でも、停止するかと尋ねられたときは、はいYと答えることでやめることができます。

終了してシェルプロンプトに戻ったとき、準備ができています。Ubuntuのメニューから"Development"セクションを見てください。そこにLazarusがあり、動作します。

完全主義の方々には、次から段階ごとに説明があります。インストールがちゃんと成功していれば無視してもかまいません。しかし、何かあれば、wikiに戻って、テストしたことや、信用性のある更新を書いてください。このセクションを明確なものにするために、協力してください。

キーを追加する

公開鍵サーバーから、キーを取得します。

 gpg --keyserver hkp://pgp.mit.edu:11371 --recv-keys 6A11800F

apt keyに加えます。

 gpg --export 6A11800F | sudo apt-key add -

次の命令でapt keyを確認できます。

 sudo apt-key list

リポジトリを追加する

安定版を取得するためにsynapticを使うことができます。または、直接 the /etc/apt/sources.list を編集してください。

 deb http://www.hu.freepascal.org/lazarus/ lazarus-stable universe

または、端末から次のようにしてください。

 echo "deb http://www.hu.freepascal.org/lazarus/ lazarus-stable universe">/etc/apt/sources.list.d/lazarus.list

テスト版を取得するためには:

 deb http://www.hu.freepascal.org/lazarus/ lazarus-testing universe

同様に端末から行う場合:

 echo "deb http://www.hu.freepascal.org/lazarus/ lazarus-testing universe">/etc/apt/sources.list.d/lazarus.list

apt-getでLazarusをインストール

これでaptでLazarusがインストールできるようになりました。

 apt-get update; apt-get install lazarus

FedoraでLazarusをインストール

LazarusはFedora version9からは、標準Fedoraリポジトリに入っています。 コマンドラインを使ってインストールすることができます。('yum install lazarus') または、'add/remove software'ウイザードを使うことができます。 もし、Fedoraのインストール中にLazarusをインストールしたいのであれば、インストール中にadditional repositoriesを有効にしてください。

インストールされたら、'Applications/Programming'メニューにLazarusがあります。

gtk2アプリケーションを作成したい場合は'gtk2-devel'もインストールしてください。

SVNでLazarusのバージョン開発

SVNを取得する

Windowsで開発しているのであれば、便利なGUIのSVNクライアント(ToritoiseSVN)をhttp://tortoisesvn.tigris.org/ から取得することができます。

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

Linuxでは、ディストリビューションのパッケージ管理システムを使ってsubversionをインストールすることをお勧めします。

SVNの使い方

コマンドラインで使う

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

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

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

To update Lazarus sources: 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を参照してください。)

WindowsでTortoiseSVNを使う

TortoiseSVNをインストールするとTortoiseSVNはWindowsのエクスプローラに統合され、ディレクトリやファイルを右クリックで 全てのコマンドを利用することができます。

TortoiseSVNを使ってワーキングコピーをチェックアウトし、実行へ行って、次のコマンドを貼り付けて下さい。 Check out a working copy using TortoiseSVN, go to Run and paste the command below:

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

(訳注:TortoiseSVNインストール後、Windowsのスタートメニューから、ファイル名を指定して実行、で上のコマンドを貼り付ければTortoiseSVNのチェックアウトダイアログが開きます。)

最初にLazarusを取得する

  • Windowsエクスプローラを開きます。
  • SVNサーバーからファイルを取得したい位置に、ディレクトリを作ります。
  • そのディレクトリを右クリックします。
  • ポップアップメニューからSVN チェックアウト...(英語の場合はSVN Checkout) を選択します。

TortoiseSVN Main Menu.png

  • 次のダイアログで、LazarusサーバーのソースのあるURLを入力します。:
http://svn.freepascal.org/svn/lazarus/trunk
  • TortoiseSVNがファイルツリーをサーバーからインポートする様子が表示されます。終了するまでに、少し時間がかかります。

Lazarusソースを最新のものにする:

  • Windowsエクスプローラを開きます。
  • 以前SVNからダウンロードしたソースディレクトリを右クリックします。
  • ポップアップメニューからSVN 更新(英語の場合はSVN Update) を選択します。

TortoiseSVN Main Menu Update.png

スクリプトで自動化

Lightning: これは、SVNからLazarusをサブディレクトリにチェックアウトして更新し、基本的なエラー修正をおこなうwindowsのバッチファイルです。 なぜなら、Lazarusがどこにインストールされているか分かる方法がなく、わからなければ、コンパイルできないし、コピーすることができないからです。 このバッチファイルをgetlaz.batのような名前で、最初のテストディレクトリ(サブディレクトリにすでに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: 私はLinuxで、最新のLazarusのSVNバージョンをダウンロードするために下記のシェルスクリプトを使っています。(これは、わかりにくくあまり洗練されていないかもしれません。)

私のシステムについてちょっと説明しましょう。 私のホームディレクトリに特別にcvsrootディレクトリがあります。このディレクトリにLazarusや他の興味のあるプロジェクトをダウンロードするスクリプトをおいています。Lazarusは/usr/share/lazarusにインストールしています。

現在のSVNが安定版ではないとき、SVNから新しいバージョンをビルドする前に、私はバックアップを作ります。これは、 /usr/share/lazarus directory を /usr/share/lazarus.bu に移動することで済みます。

このスクリプトをあなたのシステムにカスタマイズするには、最初のほうにある定数の定義を変更するだけです。

注意:何の保証もしませんので、自己責任で利用してください。

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

FPCコンパイラをインストールする

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!

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.

Browse the Source Repository with a Web Browser

The contents of the SVN archive can also be browsed with your web-browser through this viewcvs interface.

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

There are some unofficial sites where you can find Lazarus and Free Pascal too:

  • 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 and md5sum file is here 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.