Sign in Join
Wiki copytemporary

Installing Lazarus/ja: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11## 概要
22
33すぐにでも Lazarus をインストールしプログラミングをはじめたい人たちのための、最も手軽な手法としては、 安定版としてリリースされている最新のバイナリーをダウンロードしてインストールすることです(Linux なら RPM パッケージ、Windows ならインストーラ、Mac OS X なら dmg パッケージなど)。Linux や Windows 環境のセクションにある“FPC バイナリ”と、Linux や Windows 環境への Lazarus のインストールのセクションの最初のパラグラフを読んでください:それ以外の箇所は読まなくても大丈夫です。 ただ、コンパイラや IDE の開発に参加しようとする方、最新のツールにアップデートしたい方は、ソースからのインストールが必要となり、残りの情報が関連してきます。
44
55Lazarus は次の2つで構成されています。:
66
77- LCL - Lazarus コンポーネントライブラリ
88- IDE - RAD ツール(グラフィカルな開発統合環境)
99
1010下の略語は次のような意味です:
1111
1212- FPC - FreePascal コンパイラ
1313- FCL - FreePascal コンパイラのライブラリ。Lazarus で使用するグラフィカルでないコンポーネントのほとんどが含まれています。
1414
1515### Lazarus システム要件
1616
17171. FreePascal コンパイラ、パッケージ、ソースファイル。(*重要*: 同じバージョンで同じ日付のもの)
18182. ウィジェットツールキット
1919 :;Win32: The native Win32 API can be used
2020
2121 :;Linux/xxxBSD: GTK+ 1.2.x : ほとんどの Linux ディストリビューションや *BSD(FreeBSDやNetBSDなど)はあらかじめ GTK+ 1.2.x ライブラリがインストールされています。またそれらは <http://www.gtk.org> から見つける事が出来ます。\
2222 また gdk-pixbuf についても 0.13 以降のもの(できれば 0.18 以降のもの)があった方がいいでしょう。これらは過去2年から最も新しいディストリビューションから探し出すことができます。ソースは <ftp://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/> から入手することが出来ます。
2323
2424 :;Mac OS X: GTK+ 1.2.x : Apple のデベロッパーツール、X11、GTK1.2 が必要です。Mac OS X でのインストールの箇所を参照して下さい。
2525
2626 :;GTK+ 2.x: 注意 : (lazarus の)GTK インターフェースはまだコンパイルされておらず、まだテスト段階です。\
2727 最近のディストリビューションから見つける事が出来ます。ソースについては、http://www.gtk.org を参照して下さい。
2828
2929The FAQ - FAQ(Frequently Asked Questions <file:よくある質問>) は <http://www.lazarus.freepascal.org> から参照できます。幾つかの質問はローカルファイルの'FAQ'から見つけることが出来ます。
3030
3131以降のセクションは FreePascal の取得の方法と、Lazarus をどのように適切にインストールするかについて述べます。
3232
3333## Free Pascal コンパイラのインストール
3434
3535この <http://www.stack.nl/~marcov/buildfaq.pdf> では、Free Pascal コンパイラをどのように構築し、どのようにインストールするかについて行われた膨大な議論を参照できます - これはおそらく何人かのユーザにはとても細かいことかもしれませんが、とても総合的なことです。
3636
3737Lazarus は fpc (FreePascal) の 2.2.2 バージョン以降が必要ですが、さらに fpc ライブラリ(バイナリ)と同じバージョンの fpc ソースについても必要となります。
3838
3939### Linux 環境での Free Pascal のインストール
4040
4141#### FPC バイナリ
4242
4343FreePascal の最新版のリリースは version 3.0.4 です。これは FreePascal の Web サイト(http://www.freepascal.org/download.html, ミラーサイトを選択します) 、もしくは SourceForge (http://sourceforge.net/projects/lazarus) から入手す出来ます。
4444
4545Lazarus のダウンロードセクション (http://www.lazarus.freepascal.org )では、パッケージ化された Free Pascal コンパイラ(linux用)の RPM や DEB ファイルを入手することが出来ます。もし RPM ベースのDebianディストリビューションでないのなら、 <http://www.freepascal.org> から tar ファイル(ソースファイル) をダウンロードしてインストールすることができます。もし、自分でコンパイルしたい方は、BSD のセクションを参照して下さい。
4646
4747操作方法の説明: 注意: もし RPM を使っていないなら(もし alien を使う計画であるなら)、最善の方法は、最新の安定版の fpc (現時点では3.0.4)を入手し、ソースから Lazarus をインストールすることです。
4848
4949Linux を起動し、root でログインしてください。
5050
5151<http://sourceforge.net/project/showfiles.php?group_id=89339> から最新のファイルを取得してください。(例)
5252
5353`       * fpc-2.2.2-0.i386.rpm`\
5454`       * fpc-src-2.2.2-081004.i386.rpm`\
5555`       * lazarus-0.9.26-0.i386.rpm`
5656
5757次に、これらを下記のようにしてインストールします:
5858
5959`       * rpm -Uvh fpc-2.2.2-0.i386.rpm`\
6060`       * rpm -Uvh fpc-src-2.2.2-0.i386.rpm`\
6161`       * rpm -Uvh lazarus-0.9.26-0.i386.rpm`
6262
6363Debian ユーザは alien もしくはソースからのインストールを行なう必要があります。 (注意:alien を使った場合、fpc.cfg は生成されません)
6464
6565#### FPC ソース
6666
6767バージョン2.0リリース版以降、FPC は Subversion(SVN)に移行しました。これは CVS ミラーを使用していません。FPC ソースを入手するには SVN を使用しなければなりません。
6868
6969##### 開発ツリーから 日次更新ソーススナップショットをダウンロードする(version 2.3.x)
7070
7171SVN ソースリポジトリから、2.3.x 系の開発バージョンの今日の日次スナップショットをダウンロードできます: これらのスナップショットは基本的に毎日更新され、ソースリポジトリに反映されます。これらのファイルはSVNアーカイブとしてサイト内で保管されます。 v2.3.x の公開ソースのアーカイブ: [fpc.zip](ftp://ftp.freepascal.org/pub/fpc/snapshot/v23/source/fpc.zip) (24 MB)
7272
7373##### リリースツリーからの日次ソーススナップショットのダウンロード (version 2.2.x)
7474
7575SVN ソースリポジトリから、2.2.x 系のリリースバージョンの今日の日次スナップショットをダウンロードできます: これらのスナップショットは基本的に毎日更新され、ソースリポジトリに反映されます。これらのファイルはSVNアーカイブとしてサイト内で保管されます。 v2.2.x の公開ソースのアーカイブ[fpc.zip](ftp://ftp.freepascal.org/pub/fpc/snapshot/v22/source/fpc.zip) (24 MB)
7676
7777##### SVNのソースリポジトリへの接続 (CVS 接続のセクションから移動)
7878
7979SVN ソースコードの zip ファイルの取得とは別の入手方法があります。SVN リポジトリへは、読み取り専用ですが誰でもアクセスできるようになっています。つまり、zip で圧縮されたものではなく、取得するタイミングの直前のコードを直接取得することができるということです。一度のダウンロードを行えば(SVN のコマンド checkout をすれば)、少ない帯域で取得ができるということでもあります。
8080
8181##### Development snapshots
8282
8383下に手順を述べます。 (当然、SVNをインストールしておく必要があります。一連のやり方については [here](http://subversion.tigris.org/) を見てください)
8484
8585開発に使用する領域の親ディレクトリに(cd コマンドで)移動してください。例えば次のようにします。
8686
8787`[]$ cd /home/username/FreePascal`
8888
8989全てのソースリポジトリ、全ての公開されたモジュールを取得するには、次のようにタイプします。
9090
9191`[]$ svn checkout `[`http://svn.freepascal.org/svn/fpc/trunk`](http://svn.freepascal.org/svn/fpc/trunk)` fpc`
9292
9393普通はこのステップだけで済むはずです。
9494
9595上述でダウンロードしたソースをアップデートする場合は次のようにします。
9696
9797`[]$svn update fpc`
9898
9999##### 2.2.x への修正
100100
101101修正を行なうには別のディレクトリを作成する必要があります。'fixes'という別のディレクトリを作成し、そこに移動します。そして修正用の URL <http://svn.freepascal.org/svn/fpc/branches/fixes_2_2> を引数にして、上述のチェックアウトコマンドを実行します。
102102
103103`[]$ cd mysvn/fixes`\
104104`[]$ svn checkout `[`http://svn.freepascal.org/svn/fpc/branches/fixes_2_2`](http://svn.freepascal.org/svn/fpc/branches/fixes_2_2)` fpc`
105105
106106アップデートするには次のようにします:
107107
108108`[]$ svn update fpc`
109109
110110ドキュメントのソースは fpcdoc と呼ばれるリポジトリの方に置かれています。これは次のコマンドで入手できます。
111111
112112`[]$ svn checkout `[`http://svn.freepascal.org/svn/fpcdocs/trunk`](http://svn.freepascal.org/svn/fpcdocs/trunk)` fpcdocs`
113113
114114Subversion についてもっと学びたいのなら、フォーマットが異なるのですがオンラインで自由に読むことが可能な、すばらしい [Subversion book](http://svnbook.red-bean.com/) を読んでください。
115115
116116好奇心旺盛の方へ: 読み取り専用です。間違ってもコミットしようとしないように。
117117
118118より多くの情報については、この Web サイト[FreePascal](http://www.freepascal.org/develop.html) をご覧下さい。
119119
120120### Windows 環境での Free Pascal のインストール
121121
122122#### Windows 用 FPC バイナリ
123123
124124Free Pascal を最も手軽にインストールする方法は、Sourceforge リポジトリから Lazarus のカレントバージョンの Windows バイナリインストーラをダウンロードすることです。このインストーラには、lazarus IDE だけでなくカレントバージョンの FreePascal コンパイラと FreePascal ライブラリが含まれています。 もしソースからのインストールを希望するなら、ここを読んでください!
125125
126126Free Pascal のダウンロードセクション(http://www.freepascal.org/download.html, ここからミラーを選んでください)から fpc 2.2.2 の zip インストーラを入手できます。 ソースからのインストール -- 取得の方法について知りたいのなら次のセクションを見てください。初心者向きではありません。また始めるにはコンパイラが必要となります。
127127
128128#### Windows 用 FPC ソース
129129
130130\<\<\<\< 上述の Linux 用の FPC ソース を見て下さい。ここでは SVN の使い方について述べています \>\>\>\>
131131
132132Fee Pascal のソースを取得するのに最も簡単な方法は、SVN を利用することです。これ以上については、次のセクションを見てください。パッケージの全てを取得することが出来ます -- 2.3.x デイリースナップショットのツリーについては <http://www.freepascal.org/develop.html> を見てください。
133133
134134SVN を介した Windows 用の FPC ソースの取得
135135
136136まず、TortoiseSVN のような SVN クライアントをインストールする必要があります。正確なコマンドは svn クライアントによって変わります。The exact commands vary between SVN clients; the ones given below are to be used under SVN home's client, which is available for download here.
137137
138138まず、ソースを置く用のディレクトリを作成します。通常のユーザであればこれを実行するだけで構いません。fpc用のディレクトリ(例 c:\Source)を作成し、コマンドプロンプトで次のように実行します:
139139
140140` C:\Source> svn co `[`http://svn.freepascal.org/svn/fpc/trunk`](http://svn.freepascal.org/svn/fpc/trunk)` fpc`
141141
142142ヒント: 最新の状態のものをダウンロード/アップデートしたいなら、次のようなシンプルな方法で出来ます
143143
144144` C:\> cd Source\FPC`\
145145` C:\Source\FPC> svn up`
146146
147147*ToDo: Write me.*
148148
149149<http://www.freepascal.org/down-win32.html> を参照して下さい。http://www.freepascal.org/sdown.html ではミラーのリストを見つけることが出来ます。FPC は大きなファイルですが、これをダウンロードして、unzip で解凍し、install.exe を実行して下さい。
150150
151151fpc ディレクトリにパスを通して下さい:
152152
153153- Win98: autoexec.bat を編集し、PATH=%PATH%;C:\pp\bin\bin\win32 を加えて下さい
154154- WinXP/2k: マイコンピュータを右クリックし、プロパティー-\>詳細設定-\>環境変数を選択し、システム環境変数にある PATH の項目に、"C:\pp\bin\bin\win32" を追加して下さい
155155
156156設定後、Windows を再起動します。
157157
158158*ToDo: Explain how to download fpc sources and build the compiler*
159159
160160### FreeBSD 環境への Free Pascal のインストール(自動)
161161
162162最新の FreeBSD ports コレクションは、ports/lang/fpc2 に 2.0.2(もうすぐ2.0.4)の安定バージョンが登録されています。殆どの場合、この port をインストールする必要があります。もし Lazarus を使用とするなら"gtk"をまずインストールする必要があるのですが。
163163
164164手動でするなら root で次のように実行します:
165165
166166`[]# cd /usr/ports/lang/fpc2 && make install && make clean`
167167
168168他の手法は portinstall を使うことです。
169169
170170`[]# portinstall fpc2`
171171
172172一度 fpc をインストールすれば、シンプルなコマンドを実行することで動作チェックをすることができます。
173173
174174`[]$ fpc`
175175
176176しかしながら、FreeBSD と FPC の間には1つ問題があります。port はすべてのパッケージと FCL をインストールするのですが、(lazarus で必要となる)glib と gtk の最新の ports ツリーでは名称変更がなされているのです。これは lazarus でリンク処理をする際に、"cannot find library -lglib" というエラーメッセージが発生することを意味しています。次の2つの方法のうちどちらか1つで修正することができます。
177177
1781781\. fpc ソースの中の該当箇所を修正し、りコンパイルする\[推奨しません\]\
1791792\. 従来のライブラリ名称へのシンボリックリンクを作成する
180180
1811812\. の方法については、次のように行ないます。
182182
183183`[]$ cd /usr/local/lib && ln -s libglib-12.so libglib12.so`\
184184`[]$ cd /usr/X11R6/lib && ln -s libgtk-12.so libgtk12.so`
185185
186186この変更をしてから、Lazarus でコンパイル・リンクを行なって下さい。
187187
188188### BSD 環境 での Free Pascal のインストール(手動)
189189
190190Effectively, you need
191191
192192A file with all sources, or two (fpc and lazarus)
193193
1941941\. e.g. for fpc <ftp://ftp.freepascal.org/fpc/dist/Linux/separate/sources.tar> preferably an export (no CVS/ dirs). The above file misses this.\
1951952\. Lazarus のソースのスナップショット
196196
197197- _any_ starting compiler from the 2.0.2 branch) You can do a check by parsing the output of ppc386 -i if it is 2.0.2 .. 2.1.x it is ok.
198198- \- dependant packages. (for FreeBSD that is gtk12, glib12 and gdk_pixbuf and GNU make, iconv and gettext)
199199
200200FPC の構築:
201201
2022021\. (fetch) necessary files (FPC source, starting compiler)\
2032032\. (extract) Then de-tgz in work directory,\
2042043\. (build) enter work/fpc/ and run\
205205
206206` $MAKE all OPT='-gl'  PP=/path/to/startingcompiler-name-ppc386`\
207207`(/path/to/ can be omitted when ppc386 is in the path)`\
208208`($MAKE is make on linux and gmake on BSD)`
209209
2102104\. (install) then, again in work/fpc, run\
211211
212212`$MAKE install PP=compiler/ppc386 PREFIX=$THEPREFIX`\
213213`(THEPREFIX= usually is /usr/lcoal, but e.g. on NetBSD it is /usr/pkg for ports)`\
214214`Create a symlink:`\
215215`  ln -s $THEPREFIX/lib/fpc/2.0.2/ppc386 $THEPREFIX/bin/ppc386`\
216216`     install sourceinstall PREFIX=$THEPREFIX`
217217
2182185\. (configure) run compiler/utils/samplecfg \$THEPREFIX/lib/fpc/2.0.1 \$ETCDIR\
2192196\. (optional, test), see if ppc386 -i gives output, else give a warning that user need to add \$PREFIX/bin to his current path. Try to compiler a program with -viwn, and see if that gives errors. Notes:
220220
221221- If you need fpcmake package lists, you need to generate or supply them yourself, (in the port, or in an extra archive) either way, do a dummy install to /tmp/pack and determine the files installed with find . \>ll
222222
223223- \$THEPREFIX and \$ETCDIR should be user configurable. Otherwise local installs aren't possible.
224224
225225- BSDHIER=1 on all make commands forces BSD hierarchy conventions.
226226
227227### Mac OS X 環境での Free Pascal のインストール
228228
229229Mac OS X の場合、他に Apple Developer tools、X11、GTK 1.2 が必要となります。
230230
231231Apple Developer-tools
232232OS X のインストレーション CD(DVD) の中に含まれています。もしくは、Apple の ADC(無償だが要登録)に参加し、ダウンロードするという方法があります。http://developer.apple.com/ 参照。
233233
234234Apple X11
235235- 新しいシステムの場合: インストールダイアログの中で"カスタマイズ"を選び、"X11"にチェックを入れて下さい。
236236- インストール済みのMac OS Xに追加する場合:
237237 - Mac OS X 10.3: 次のサイトからダウンロードして下さい。
238238
239239 <http://www.apple.com/downloads/macosx/apple/x11formacosx.html>
240240 - MacOSX 10.4: 付属の DVD から X11 をインストールして下さい。
241241
242242GTK 1.2
243243GTKパッケージをダウンロードし正しくインストールするには、かなり時間がかかる場合があります。そのため、さまざまなパッケージマネジャがあります。そのうちの一つがfinkです。finkによってGTK 1.2をインストールするには次のようにします:
244244
245245
246246fink をURL <http://fink.sourceforge.net/download/index.php?phpLang=en> からダウンロードし、ターミナル上で次のコマンドを実行して下さい。
247247
248248`       sudo /sw/bin/apt-get install gdk-pixbuf gtk+ gtk+-data gtk+-shlibs gtk-doc gtk-engines`
249249
250250X11 アプリケーションは /Applications/Utilities/X11 にインストールされます。ドラッグ&ドロップでドックに置いておけば、いつでもクリック1回で起動できます。
251251
252252Tip: Lazarus を含めてほとんどの X11 プログラムは、ユーザが Window 上をクリックした際にフォーカスが取得できることを前提にしています。MacOSX 上では、この機能は非アクティブにされています。ターミナル上で次のコマンドを実行することで、すべての X11 アプリケーションでこれをアクティブにすることができます。
253253
254254`       defaults write com.apple.x11 wm_click_through -bool true`
255255
256256Free Pascal Compiler
257257次の URL から Free Pascal Compiler (バージョン2.0.2) をダウンロードし、インストールします:
258258
259259
260260<https://sourceforge.net/project/showfiles.php?group_id=89339>
261261
262262GTK 関連のソフトウェアをコンパイルする時には、次の2行を fpc.cfg ファイルに追加してライブラリを有効にする必要があります:
263263
264264`-Fl/sw/lib`\
265265`-Fl/usr/X11R6/lib`
266266
267267Lazarusを利用するためには、FPCのソースも必要です:
268268
269269- MacOSX 用の SVN のインストール: おすすめのパッケージがこのサイト [Martin Ott](http://www.codingmonkeys.de/mbo/) から配布されています。
270270
271271 ディレクトリを作成し、ソースをそこに置きます。root権限 でこれをする必要はありません。普通のユーザアカウントで構いません。
272272
273273 1. 最初に fpc 用のディレクトリを作成します (例 /Users/username/freepascal)
274274 2. そしてターミナルを開き次のコマンドを実行します。
275275
276276`[]$ svn co `[`http://svn.freepascal.org/svn/svn/trunk`](http://svn.freepascal.org/svn/svn/trunk)` fpc`
277277
278278
279279
280280これにより 'fpc' という名前のディレクトリが作成されます。これは後で IDE から使用されます。
281281
282282ヒント: 最新のダウンロード/アップデートに更新するには、次のようなシンプルな方法で実施します
283283
284284`[]$ cd /Users/username/freepascal/fpc`\
285285`[]$ svn up`
286286
287287## Lazarus のインストール
288288
289289### Linux 環境での Lazarus のインストール
290290
291291#### Ubuntu / Debian
292292
293293Lazarusをインストールする最も簡単な方法はSourceForgeのリポジトリからFreePascalとLazarusのdebファイルをダウンロードすることです。
294294
295295説明はこちら: [[Getting Lazarus/ja]].
296296
297297Note that installing from the default Ubuntu sources will not install the Free Pascal Source Libraries - use the method above.
298298
299299UbuntuデフォルトのインストールではFree Pascalのソースライブラリがインストールされないことに注意してください。
300300
301301追記: Debian系Linux(Ubuntu等)ではRPMパッケージからのインストールはできません。 debパッケージを使用してインストールすることをお勧めします。 特にUbuntu DeskTopではソフトウェアセンターからのインストールが非常に簡単です。 UbuntuソフトウェアセンターでLazarusをインストール後、同様にUbuntuソフトウェアセンターでfpc-sourceをインストールしてください。 (Lazarusのインストールで一緒にfpcもインストールされますが、fpc-sourceは別途インストールする必要があります。 ※Ubuntu10.10の場合)
302302
303303##### Building debs the easy way
304304
305305The easiest way to get a current working installation of Lazarus is to download build your own .deb packages by following the instructions at:
306306
307307[[How to setup a FPC and Lazarus Ubuntu repository]]
308308
309309##### Problems compiling GTK2 apps with FPC 2.2.2
310310
311311From this [post](http://lists.freepascal.org/lists/fpc-pascal/2009-January/019838.html) by Michalis Kamburelis:
312312
313313In case someone wonders how to workaround this [bug](http://mantis.freepascal.org/view.php?id=11837) (occurs with GTK \>= 2.13.4, e.g. on Ubuntu 8.10 we have GTK 2.14):
314314
315315I found that the quick workaround that works is to pass --noinhibit-exec to ld, that is "-k--noinhibit-exec" to FPC command-line. The ld will then treat unresolved references as mere warnings, and will produce working executable (assuming your program doesn't actually call obsoleted GTK2 functions).
316316
317317Of course, you can also upgrade to FPC from SVN. Above workaround is useful only if you have to stick to released FPC 2.2.2.
318318
319319#### RPM を用いたインストール
320320
321321Lazarus の現行のインストーラを取得することが最も簡単な方法で、それは SourceForge のリポジトリから FreePascal と Lazarus の RPM をダウンロードすることです。
322322
323323指定のバージョンをダウンロードする必要があります
324324
325325- コンパイラ (例: fpc-2.2.4-0.i586.rpm)
326326- pascal ソースライブラリ (例: fpc-src-2.2.4-0.i386.rpm)
327327- lazarus パッケージ (例: lazarus-0.9.28-0.i386.rpm).
328328
329329次のスクリプトは0.9.28をダウンロードしてインストールもしくはアップデートする例です。"InstallLazarus.sh"などと名前を付けて保存し、実行パーミッションを与え、suでroot権限をとってから実行してください。新規インストールでrpm evに際し、"インストールされていません"とのメッセージが出ても問題ありません。
330330
331331` #!/bin/sh`\
332332` URL=`[`http://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20i386%20RPM/Lazarus%200.9.28`](http://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20i386%20RPM/Lazarus%200.9.28)\
333333` wget $URL/fpc-2.2.4-0.i386.rpm/download`\
334334` wget $URL/fpc-src-2.2.4-0.i386.rpm/download`\
335335` wget $URL/lazarus-0.9.28-0.i386.rpm/download`\
336336` rpm -ev lazarus`\
337337` rpm -ev fpc`\
338338` rpm -ev fpc-src`\
339339` rpm -ivh fpc-*`\
340340` rpm -ivh lazarus-*`
341341
342342#### Installing on Mandriva
343343
344344##### Lazarus 0.9.26 on Mandriva 2009 (2009.0) (i386) (GTK-1)
345345
346346Not much has changed compared to Mandriva 2007. The following instruction shall not differ for an x86_64 architecture.
347347
3483481/ Do not install FPC from Drake. If you have done so, desinstall it. Since Mandriva does not provide the complete set of tools (FPC+sources+documentation+Lazarus) it is better, in my opinion, to have complete control on all of them through rpms.
349349
3503502/ Collect fresh rpms on sourceforge (http://sourceforge.net/project/showfiles.php?group_id=89339): select the RPM version of the latest lazarus release compatible with your architecture and download fpc, fpc-src, fpc-docs and lazarus RPMs.
351351
3523523/ Browse the directory where you downloaded the RPMs (with Nautilus or whatever file browser your using) and double click on the RPMs in this ordrer:
353353
354354`  (a) fpc-<version>-<arch>.rpm`\
355355`  (b) fpc-docs-<version>-<arch>.rmp`\
356356`  (c) fpc-src-<version>-<arch>.rpm`\
357357`  (d) lazarus-<version>-<arch>.rpm`
358358
3593594/ It is possible that the Drake (the software that will manage your RPMs) will complain about missing libraries or tools. Use Drake to collect them. For instance, you shall have installed developpement tools such as "GNU Make". Search and if necessary install "GNU Make". You might be missing the ld (the linkage utility), you can install for instance the "gcc" package.
360360
3613615/ As before, it is possible to search for and install "galaxy-gnome" and "gtk-switch" with Drake. Nonetheless, they are not required for Lazarus to work properly. Gnome Galaxy are a set of cool themes you can use in the System menu-\>Preferences-\>Themes.
362362
3633636/ Lazarus might complain about the FPC sources that are not correctly set. Go to Configuration-\>Environement then set the FPC sources directory to your local installation (it should be /usr/local/fpcsrc/\<version\>/).
364364
3653657/ When launched, the libcanberra-module-gtk might not be found. I tried to build a symlink (ln -s) but if Lazarus manages to find this library... it crashes. It might be safer to ignore this error.
366366
3673678/ Have fun with the coolest RAD of the Free World.
368368
369369##### Lazarus 0.9.26 on Mandriva 2007 (2007.0) (i386) (GTK-1)
370370
371371Installation in Mandriva is very easy. However, there are a few points to check as the installation proceeds. Here is a typical installation using the .tar modules (see the trick for the theme at the end of the procedure!):
372372
373373\- During the Mandriva installation, select the "Gnome desktop" group. Although you will use lazarus in KDE or other desktop, this will install some GTK modules needed by the lazarus environment.
374374
375375\- Install the FPC 2.2.2 compiler using either the .rpm or .tar, modules. Using the .tar modules you would type: "sh install.sh" then RETURN many times. I do this in superuser mode.
376376
377377\- Install the compiler source code. just untar the file "fpc-src-2.2.2.source.tgz" in the folder /usr/local/src/fpc/ then rename the created folder "fpc" to "2.2.2" . When complete, you have the folder /usr/local/src/fpc/2.2.2/ that contains all the source code. The source code is only needed by lazarus editor, but you can recompile FPC and have an optimized version of the libraries, and show that everything is working well:
378378
379379\- If you want to compile FPC (optional), then go to the FPC source directory (/usr/local/src/fpc/2.2.2/) and type "./configure", "make clean","make all","make install","make clean". FPC is now installed. Check the content of "/etc/fpc.cfg". This file has to be modified when the make fails.
380380
381381\- Lazarus can be installed in user mode: just unzip/untar the file "lazarus-0.9.26.0.tar.gz" in your user directory. Then just type "make clean all" in the user mode. The last phase of the process (link) usually fails due to missing library files:
382382
383383\- Check in the directory /usr/lib/ for the following symbolic links:
384384
385385libglib.so -\> libglib-1.2.so.0
386386
387387libgtk.so -\> libgtk-1.2.so.0.9.1
388388
389389libgdk.so -\> libgdk-1.2.so.0.9.1
390390
391391libgdk_pixbuf.so -\> libgdk_pixbuf.so.2.0.0
392392
393393The file "libgdk_pixbuf.so.2.0.0" is included in the module "libgdk_pixbuf-2.0.22.0-10mdv2007.0.rpm" This file name is critical. In particular, DO NOT use "libgdk_pixbuf-2.0.so.0" (misleading isn't!).
394394
395395After all the links have been fixed, the "Linking ../lazarus" stage will not crash any more and the "./lazarus" command should start the program!
396396
397397\- Go to the "environment/environment options" menu and change the "FPC source directory" to /user/local/src/fpc/2.2.2
398398
399399USEFUL TO KNOW:
400400
401401\- The last step is to fix the theme. The package "galaxy-gnome-1.0.4-3mdv2007.0" is available in the Mandriva control center. Install it.
402402
403403\- The package "gtk-theme-switch-1.0.1-4mdv2007.0.i586.rpm" is available on the web! (strangely it did not show in the control center) Install it manually by typing "rpm -iv --test gtk-theme-switch-1.0.1-4mdv2007.0.i586.rpm" then retype the line without the "--test" in my case there was a warning message related to the signature. I decided to ignore it!
404404
405405\- in the USER MODE, type "switch", then chose "galaxy" theme.
406406
407407The Lazarus / FPC tool is now installed!
408408
409409##### Lazarus 0.9.26 on Mandriva 2007/or -2006 32 bit
410410
411411Write this urpmi-command as root:
412412
413413 urpmi http://surfnet.dl.sourceforge.net/sourceforge/lazarus/lazarus-0.9.26-0.i386.rpm http://surfnet.dl.sourceforge.net/sourceforge/lazarus/fpc-2.2.2-0.i386.rpm http://surfnet.dl.sourceforge.net/sourceforge/lazarus/fpc-docs-2.2.2-0.i386.rpm http://surfnet.dl.sourceforge.net/sourceforge/lazarus/fpc-src-2.2.2-0.i386.rpm
414414
415415Lazarus 0.9.26 depends on fpc 2.2.2 and Mandriva 2007 is shipped with fpc-2.1.1-0.2mdk.i586. To prevent your system to upgrade to fpc-2.1.1 or newer in the future, when you run commands as urpmi --auto-select, you can write fpc in /etc/urpmi/skip.list.
416416
417417##### Lazarus 0.9.26 on Mandriva 2009 32 bit
418418
419419Installation needs similar action as above. Because the distribution comes with fpc-2.2.2-1, it is necessary to uninstall this package. Write following commands as root:
420420
421421 rpm -e fpc
422422 urpmi http://surfnet.dl.sourceforge.net/sourceforge/lazarus/lazarus-0.9.26-0.i386.rpm http://surfnet.dl.sourceforge.net/sourceforge/lazarus/fpc-2.2.2-0.i386.rpm http://surfnet.dl.sourceforge.net/sourceforge/lazarus/fpc-docs-2.2.2-0.i386.rpm http://surfnet.dl.sourceforge.net/sourceforge/lazarus/fpc-src-2.2.2-081004.i386.rpm
423423
424424And place fpc in /etc/urpmi/skip.list.
425425
426426##### Lazarus untested snapshot on Mandriva 2007 32 bit
427427
428428 urpmi $(for RPM in $(lynx --source http://michael-ep3.physik.uni-halle.de/Lazarus/ | grep i386.rpm | cut -d '"' -f 4-4) ; do echo -n http://michael-ep3.physik.uni-halle.de/Lazarus/$RPM ' '; done )
429429
430430##### Installing Lazarus + fpc For Mandriva X86_64
431431
432432This has worked for Mandriva 2007.0 X86_64 (AMD X2 4800+).
433433
434434- Download the X86_64 snapshots from <http://michael-ep3.physik.uni-halle.de/Lazarus/> Lazarus Snapshots
435435- I used these:
436436
437437 fpc-2.2.2-0.x86_64.rpm
438438 fpc-src-2.2.2-081004.x86_64.rpm
439439 lazarus-0.9.26-0.x86_64.rpm
440440
441441- To download and install the current snapshot:
442442
443443`urpmi $(for RPM in $(lynx --source `[`http://michael-ep3.physik.uni-halle.de/Lazarus/`](http://michael-ep3.physik.uni-halle.de/Lazarus/)` | grep 64.rpm | cut -d '"' -f 4-4) ; do echo -n `[`http://michael-ep3.physik.uni-halle.de/Lazarus/$RPM`](http://michael-ep3.physik.uni-halle.de/Lazarus/$RPM)` ' '; done )`\
444444You might have to install lynx and make first:`urpmi lynx make`.
445445
446446- Once the RPMs have been installed. Run lazarus for the first time. It will pop up a dialog complaining that the "/usr/bin/ppc386" and "/usr/lib/lazarus" are not valid. Accept ("OK") the alternate choices it suggests.
447447- When compiling your first project, you may find that lazarus complains of missing libs (e.g. gdk, glib, etc.). Install the necessary libs as needed, I installed these (that I recall, YMMV):
448448
449449 glib-devel
450450 lib64gtk+1.2-devel
451451 lib64gtk+2.0_0-devel
452452 lib64gdk-pixbuf2
453453 lib64gdk-pixbuf2-devel
454454
455455#### Installing on Slackware
456456
457457##### Installing Lazarus 0.9.26, for Slackware 12.0 users
458458
459459This have worked in Slackware-12.0 on a Pentium-3 computer:
460460
461461- The Free Pascal Compiler (FPC) is installed in SUPERUSER mode
462462- The lazarus in installed in USER mode
463463- The FPC compiler will be recompiled
464464- The lazarus Integrated Development Environment (IDE) source code is loaded from the SVN server
465465- The GTK-2 widget set is used ("LCL_PLATFORM=gtk2")
466466
467467-- Download "fpc-2.2.2.i386-linux.tar" in a user folder and install it. Go to this folder and type:
468468
469469` bash-3.1$ tar -xvf fpc-2.2.2.i386-linux.tar`\
470470` bash-3.1$ su `\
471471` bash-3.1$ password:xxxxxx`\
472472` bash-3.1# sh install.sh`\
473473` ...`\
474474` (use the default answers for the next 6 questions: press "return" 6 times)`\
475475` ...`\
476476` bash-3.1# exit`\
477477` bash-3.2$ fpc`\
478478` free pascal compiler version 2.2.2 [] for i386 `\
479479` Copyright (c) 2008 ...`\
480480` ...`\
481481` ...`
482482
483483You have installed the compiler. You may want to recompile it or not, but in any case you will need to download the source code as it is required by the lazarus IDE.
484484
485485-- Download "fpc-2.2.2.source.tar.gz" in a temporary folder. If you do not want to recompile the source then just skip this section. If you would like to run your own compiled version of FPC, then just type:
486486
487487` bash-3.1$ tar -xvzf fpc-2.2.2.source.tar.gz`\
488488` bash-3.1$ cd fpc-2.2.2`\
489489` bash-3.1$ make clean all`\
490490` bash-3.1$ su`\
491491` bash-3.1$ password: xxxxxxxx`\
492492` bash-3.1# make install`\
493493` bash-3.1# exit`\
494494` bash-3.1$ fpc`\
495495` free pascal compiler version 2.2.2 [...] for i386 `\
496496` Copyright (c) 2008 ...`\
497497` ...`\
498498` ...`
499499
500500Now you have your own compiled version working.
501501
502502-- The lazarus IDE editor needs to look at the FPC source code. Even if you do not want to recompile FPC, you need its source code. However, in order to save some space, I only keep a clean (not compiled) copy of the source code. I start from the file "fpc-2.2.2.source.tar.gz" again and I copy it to the /usr/local/src/FPC folder:
503503
504504` bash-3.1$ su`\
505505` bash-3.1$ password: xxxxxxxx`\
506506` bash-3.1# cp fpc-2.2.2.source.tar.gz /usr/local/src/`\
507507` bash-3.1# cd /usr/local/src/`\
508508` bash-3.1# tar -xvzf fpc-2.2.2.source.tar.gz`\
509509` bash-3.1# rm fpc-2.2.2.source.tar.gz`\
510510` bash-3.1# exit`
511511
512512The version number is included in the folder name "fpc-2.2.2". This way I can keep many versions the the compiler source and eventually switch between them.
513513
514514-- The lazarus IDE is kept in my USER "~/lazarus" folder and always compiled in USER mode. I usually download the "lazarus-0.9.26-0.tar.gz" file, but here we can also get the latest development version from the SVN server:
515515
516516`  bash-3.1$ svn co `[`http://svn.freepascal.org/svn/lazarus/trunk`](http://svn.freepascal.org/svn/lazarus/trunk)` lazarus`
517517
518518This is for the first time you load it. Next time you will only need to type:
519519
520520`  bash-3.1$ svn update`
521521
522522If you do not have SVN installed on your computer, here is how to get it quickly:
523523
524524--Download the two files: "subversion-1.4.6.tar.gz" and "subversion-deps-1.4.5.tar.gz" (or later versions). Type:
525525
526526`  bash-3.1$ tar -xvzf subversion-1.4.6.tar.gz`\
527527`  bash-3.1$ tar -xvzf subversion-deps-1.4.6.tar.gz`\
528528`  bash-3.1$ cd subversion-1.4.6`\
529529`  bash-3.1$ ./configure`\
530530`  bash-3.1$ make`\
531531`  bash-3.1$ su`\
532532`  bash-3.1$ password:xxxxxx`\
533533`  bash-3.1# make install`\
534534`  bash-3.1$ exit`
535535
536536-- At this point you have the folder "~/lazarus" containing the source code. You should compile it very simply:
537537
538538`  bash-3.1$ make clean all LCL_PLATFORM=gtk2`
539539
540540The "LCL_PLATFORM=gtk2" means of course that you will develop your applications in GTK-2. The default widget set for lazarus is GTK-1 but you will not be able to use it in Slackware 12.0. I strongly recommend that you use the "LCL_PLATFORM=gtk2" option now. After a few minutes, the compiler stops:
541541
542542`  ...`\
543543`  ...`\
544544`  Linking ../Lazbuild`\
545545`  987 linescompiled ...`\
546546`  make [2] leaving ...`\
547547`  make [1] leaving ...`\
548548`  bash-3.1$`
549549
550550-- Just type:
551551
552552`  bash-3.1$ ./lazarus`
553553
554554WOW! You get a message: "Free Pascal sources not found". Just follow the instructions and indicate your Free Pascal Compiler source directory in the panel: "Environment-\>Environment_Options-\>Files". As explained earlier, on my computer this should point to "/usr/local/src/fpc-2.2.2". Note that when you change this folder, you should click on "Environment / Rescan_FPC_source_directory".
555555
556556Voila!
557557
558558#### openSUSEへのインストール
559559
560560##### openSUSE 11.1 ユーザのためのLazarus 0.9.28 のインストール
561561
562562Free Pascal コンパイラには次のものが必要です: - Gnu バイナリ (gnu as, gnu ld, gnu make) 次のコマンドで簡単にそれらをインストールできます。
563563
564564` # zypper in -t pattern devel_basis`
565565
566566バイナリファイルをダウンロードします(RPM)
567567
568568:* fpc-2.2.4-0.i386.rpm
569569
570570:* fpc-src-2.2.4-0.i386.rpm
571571
572572ターミナルを開き、それをインストールします(マウスの右ボタン -\> Menu: terminal を開く)
573573
574574` # rpm -Uvh fpc-2.2.4-0.i386.rpm`\
575575` # rpm -Uvh fpc-src-2.2.4-0.i386.rpm`\
576576` # rpm -Uvh lazarus-0.9.28-0.i386.rpm`
577577
578578#### ソースからのインストール
579579
580580ソースからの自分自身でコンパイルしてインストールするのがお好みでしたら、以下のように行って下さい。lazarus関連のファイルはすべて一つのディレクトリに保存されるため、アンインストールはきわめて簡単で、インストールするのにrootになる必要もありません。ダウンロードページからfpcとfpcsrcとlazarusのtgzファイルをダウンロードできますし、svnから直接ダウンロードすることもできます。
581581
582582以下は0.9.18をUbuntu 6.06にインストールする場合の例です。Linuxのコマンドやbashスクリプトをある程度ご存知でしたら、何をすればよいのかおわかりでしょう。スクリプトをコピーし(新しいバージョンが出ていたら番号を書き換え), テキストエディタに貼り付けて"install_lazarus.sh"などと名前を付けて保存してください。そのshファイルに実行許可を与え、コンソールで実行してください。 注意:この例ではfpcは/optにインストールされますので、'Install prefix'を聞かれたら'/opt/fpc'と入力してください。
583583
584584` #!/bin/sh`\
585585` `\
586586` #installing required packages`\
587587` sudo apt-get install build-essential`\
588588` sudo apt-get install libgtk2.0-dev`\
589589` sudo apt-get install libgdk-pixbuf-dev`\
590590` `\
591591` #installing FreePascal source`\
592592` cd /opt`\
593593` sudo wget `[`http://nchc.dl.sourceforge.net/lazarus/fpc-src-2.0.4.source.tgz`](http://nchc.dl.sourceforge.net/lazarus/fpc-src-2.0.4.source.tgz)\
594594` sudo tar -xvf fpc-src-2.0.4.source.tgz`\
595595` sudo mv fpc fpcsrc`\
596596` `\
597597` #installing FreePascal`\
598598` sudo mkdir fpc`\
599599` cd fpc`\
600600` sudo wget `[`http://nchc.dl.sourceforge.net/lazarus/fpc-2.0.4.i386-linux.tar`](http://nchc.dl.sourceforge.net/lazarus/fpc-2.0.4.i386-linux.tar)\
601601` sudo tar -xvf fpc-2.0.4.i386-linux.tar`\
602602` sudo sh install.sh`\
603603` `\
604604` #adding fpc path to the PATH`\
605605` echo "#FPC PATH" >> ~/.bash_profile`\
606606` echo "if [ -d /opt/fpc/bin ] ; then" >> ~/.bash_profile `\
607607` echo PATH=/opt/fpc/bin:"${PATH}" >> ~/.bash_profile`\
608608` echo "fi" >> ~/.bash_profile`\
609609` `\
610610` #installing Lazarus`\
611611` cd ../`\
612612` sudo wget `[`http://nchc.dl.sourceforge.net/lazarus/lazarus-0.9.18-0.tar.gz`](http://nchc.dl.sourceforge.net/lazarus/lazarus-0.9.18-0.tar.gz)\
613613` sudo tar -zxvf lazarus-0.9.18-0.tar.gz`\
614614` PATH=/opt/fpc/bin:"${PATH}"`\
615615` sudo chmod -R 777 lazarus`\
616616` cd lazarus`\
617617` make clean all`\
618618` ./lazarus`
619619
620620注意:環境オプションでfpc-srcのパスを手動で指定する必要があります。 注意:UIの日本語が文字化けしています。さしあたり[こちらの方法](http://wiki.lazarus.freepascal.org/Lazarus_Faq/ja#Ubuntu_6.06.E3.81.A7IDE.E3.81.AE.E3.83.95.E3.82.A9.E3.83.B3.E3.83.88.E3.81.8C.E6.96.87.E5.AD.97.E5.8C.96.E3.81.91.E3.81.99.E3.82.8B.E3.81.AE.E3.81.A7.E3.81.99.E3.81.8C)で対処してください。
621621
622622##### Lazarus SVN のダウンロード
623623
624624lazarusレポジトリはcvsからsvn(のサブバージョン)に移行しました。SVNを使用することにより、修正箇所のみをダウンロードして簡単にソースを最新版に保つことができます。相当な時間の節約になり、お薦めします。これにはインターネットへの接続が必要です。rootになる必要はありません。Lazarusはインストール時にも実行時にも特別なパーミッションは必要ありません。
625625
626626移行にともない私達はlazarusソースのディレクトリ構成を変えました。最も大きな違いは全てのIDEソースが主ディレクトリ(root)から別々のサブディレクトリに移ったことです。おわかりのように、このことはMakefilesやサーチパスなどに影響を与えます。私達はここからくる諸問題に取り組んでいますので、もし何かがうまく機能しない場合はどうぞお知らせ下さい。
627627
628628では、最も大事なこと....ソースを入手しましょう
629629
630630` []$ svn checkout `[`http://svn.freepascal.org/svn/lazarus/trunk/`](http://svn.freepascal.org/svn/lazarus/trunk/)` lazarus`
631631
632632(あるいはソースを置きたい任意のディレクトリ)
633633
634634アップデートしたい時には、ただ次のようにタイプしてください
635635
636636` []$ svn update lazarus`
637637
638638サブバージョンに関するより詳細な情報: <http://subversion.tigris.org/>
639639
640640注意: CVSにもまだアクセスできますが、アップデートが停止しています。
641641
642642##### コンパイルと実行
643643
644644cvs もしくは svn のどちらからのチェックアウトであっても、次のステップとなります:
645645
646646lazarus をコンパイルする
647647
648648`[]$ cd lazarus`\
649649`[]$ make  (gmake on BSD)`
650650
651651fpc が正しくインストールされていれば、コンパイラは問題なく動くはずです。そうでなければ FAQ を見て下さい。
652652
653653lazarus を起動する
654654
655655`[]$ ./lazarus`
656656
657657IDEが起動するはずです。ターミナルからlazarusを起動した場合、いくつかの足りない設定についての注意書きが表示されます。初回の起動においてはそれが当り前です。IDEは自動的に最もよく使われるディレクトリを探すことにより、FreePascalコンパイラとそのソースがどこにあるかを見つけます。
658658
659659パスを確認して下さい
660660IDE メニューを使って次の通り進みます
661661
662662
663663Environment -\> Environment Options -\> Files
664664
665665'FPCソースディレクトリ'にあなたのfpcソースディレクトリを指定してください。このディレクトリはふつう/fpc/や/fpcsrc/ (例えば/usr/src/fpcsrcや/home/username/freepascal/fpc)が末尾につき、'compiler', 'docs', 'fcl', 'rtl','packages'などのディレクトリを含みます。
666666
667667ヒント
668668
669669lazarus をアップデートするなら次の通りにします
670670
671671`[]$ svn update lazarus`
672672
673673それからどのアップデート経路であろうとも:
674674
675675`[]$ make clean all   (BSDならばgmake)`
676676
677677これによりlazarusが再構築され、IDEがlazarusパッケージなしに作成されます。あなたがインストールしたパッケージをインストールするには上記の**後**に:
678678
679679`[]$ make idepkg`
680680
681681#### Debian GNU/Linux 環境への Lazarus のインストール
682682
683683There are preliminary Debian packages for lazarus available for download. They are not the latest versions, however. Make sure you read /usr/share/doc/lazarus/README.Debian carefully before you start using it. Feedback is needed and appreciated; please send your comments to Carlos Laviola \<claviola@debian.org\>.
684684
685685Note that for a fully working Lazarus install, no older or incompatible versions of, for example, the fpc source or fpc compiler must be installed. Remove them by typing
686686
687687` dpkg -r <package name>   `
688688
689689without .deb extension. And then install the newest versions as described.
690690
691691##### Debian 環境への Lazarus をインストールする別の方法
692692
693693Added by User:Kirkpatc.
694694
695695Debian 環境で簡単に Lazarus をインストールする方法です
696696
697697(assume new Debian installation, without development libraries loaded)
698698
699699SourceForge のリポジトリから fpc、fpclib、lazarus リリース版の最新をダウンロードします; <http://lazarus.freepascal.org> にアクセスして、"downloads" をマウスの左ボタンでクリックし、"binaries" をクリック、次に "linux"、次に "Current Lazarus RPM" をクリックします。This will bring you to
700700
701701
702702<http://sourceforge.net/project/showfiles.php?group_id=89339>
703703
704704そして次のファイルをダウンロードします(より新しいものがあればそれをダウンロードして下さい)
705705
706706- fpc-2.0.0-0.i586.rpm
707707- fpcsrc-2.0.0-0.i386.rpm
708708- lazarus-0.9.8-fpc_2.0.0_0.i386.rpm
709709
710710cd to the directory where these files are stored, then become root (su) and type:
711711
712712`alien -c fpc*     //this will convert both the fpc and fpcsrc files to debian format and convert the install scripts`\
713713`alien -c laz*`
714714
715715そして、作成された Debian パッケージ(.deb)を root 権限でインストールします:
716716
717717`dpkg -i fpc*.deb laz*.deb`
718718
719719or use kpackage or a similar utility to install the generated fpc, fpcsrc and lazarus .deb files.
720720
721721もし alien がインストールされていないのなら次のようにします:
722722
723723`apt-get install alien `
724724
725725Please note that, on Linux distributions like Ubuntu, you'll have to add 'sudo' in front of all commands. In Ubuntu previous command would be
726726
727727`sudo apt-get install alien`
728728
729729You need to produce a configuration file, which will reside in /etc/fpc.cfg. Still as root, cd to the main fpc directory /usr/lib/fpc/2.0.0 and then type
730730
731731`sh ./samplecfg /usr/lib/fpc/2.0.0 /etc`
732732
733733Check the contents of your new configuration file (cat /etc/fpc.cfg) and make any changes you want using vi or another text editor. Also make sure that there are no old configuration files in for example your home directory (~/.fpc.cfg).
734734
735735GTK と pixbuf ライブラリの開発パッケージをインストールする必要があります。
736736
737737`apt-get install libgtk2.0-dev`\
738738`apt-get install libgdk-pixbuf-dev`
739739
740740これでプログラミングをはじめることが出来ます!
741741
742742### Windows 環境での Lazarus のインストール
743743
744744Windows 版 Lazarus の現行バージョンのインストールは非常に簡単です。本体のハードディスク以外にもインストールできます。
745745
746746もし使用する Windows 上にソフトウェアをインストールすることが許されていないか、管理者権限がなくてインストールできないといった場合、256 MB 以上の USB ドライブに Lazarus/FPC パッケージをインストールして使用することも可能です。この場合、コンパイラや環境設定オプション、fpc.cfg ファイルなどで、パスの指定に注意する必要があります。また USB ドライブ上にテスト用のディレクトリを用意し、保持しておいた方がいいと思います。
747747
748748\<\< Q:DOES ANYONE KNOW HOW TO SET UP RELATIVE PATHS IN THESE TAGS AND FILES, SO THAT THE ADDRESSING WORKS WHEN YOU MOVE THE USB DEVICE TO ANOTHER MACHINE WHERE IT HAS A DIFFERENT DRIVE LETTER?
749749
750750A: This is what I do. It's relatively convoluted, but it's the best solution I've found. I have a "bin" directory on my USB drive, where I have several scripts and utilities installed. Inside that directory is a batch file called "setenv.bat" which sets an environment variable called THUMBDRIVE. It is set by using this command in the batch file:
751751
752752`  set THUMBDRIVE=%CD:~0,2%`
753753
754754This is used in setenv.bat to set some paths to other things I have installed on the USB drive. I also have a link in the root directory of the thumb drive with this property:
755755
756756` %SystemRoot%\system32\cmd.exe /k bin\setenv`
757757
758758so that when I click on that link when the thumb drive folder is diplayed after inserting it, it will open a command prompt at the thumb drive with the environment variables set from setenv.bat.
759759
760760Also inside the bin directory is [sed](http://sed.sf.net) (the actual binary is one I obtained from the mingw distribution). So I created another batch file called fixlaz.bat which takes one argument, the drive letter which is currently in the Lazarus/fpc settings files that you want to change (note that this is the previous drive letter the last time you ran fixlaz.bat, not the current one of your USB drive which fixlaz.bat already knows). You will need to create this batch file to fit where you installed Lazarus in the root directory structure of the drive if you didn't install it directly in the root folder, and then repeat these lines also for the editoroptions.xml and fpc.cfg files (fpc.cfg is the the fpc bin directory, which might be buried deep in the lazarus folder):
761761
762762` copy %THUMBDRIVE%\lazarus\environmentoptions.xml %THUMBDRIVE%\lazarus\environmentoptions.bak`\
763763` sed -e 's/%1/%THUMBDRIVE%/g' %THUMBDRIVE%\lazarus\environmentoptions.bak > %THUMBDRIVE%\lazarus\environmentoptions.xml`
764764
765765So to use it, I would type at the command prompt of the USB drive:
766766
767767` fixlaz G:`
768768
769769if "G:" was the previous drive letter used the last time I ran it. This will then scan the file(s) and replace "G:" with the current drive letter of the USB drive, which is in the %THUMBDRIVE% environment variable (after running setenv.bat). Note that you could write it to save the current drive letter in a separate file, so that you wouldn't have to remember it yourself the next time. But this works well enough for me right now. \>\>
770770
771771Linux 用、Windows 用のバイナリーパッケージは次の URL からダウンロードできます。
772772
773773<http://sourceforge.net/project/showfiles.php?group_id=89339>
774774
775775最新のリリースのもの(現在は Lazarus-0.9.26-fpc-2.2.2-win32.exe)をダウンロードし、これを実行して下さい。
776776
777777典型的な Windows インストールでインストールできます。以前のバージョンの Lazarus と FPC(多くの場合 c:\pp ディレクトリにあります)をアンインストールしておけば、特に致命的な問題もなく、FPC コンパイラとソースライブラリが Lazarus のディレクトリ構成と同じディレクトリの中にインストールされ、IDE が起動します。
778778
779779Windows 用のスナップショットを利用することが出来ます。[[Lazarus Snapshots Downloads|Lazarus Snapshots Downloadsからダウンロードできます]]。
780780
781781#### ソースからのインストール
782782
783783もしソースからのインストールを行いたい場合、これらの説明を見て下さい (Thanks to Joe for the initial Step-by-step description)
784784
785785まず、lazarus のソースを [[Lazarus Snapshots Downloads]] からダウンロードする必要があります:
786786
787787次に、c:\lazarus などのディレクトリに解凍して下さい。なお、fpc-2.2.2 をインストールしておく必要があります。fpc-2.3.1 のスナップショットでも構いません。 私はこのようにコンパイルして、lazarus.exe を実行しています。私の fpc のパスは c:\pp\bin\win32 です。このディレクトリには沢山の実行ファイル(make, grep, ppc386 など)が置かれています。
788788
789789コマンドプロンプトを起動します。スタートメニュー-\>全てのプログラム-\>...-\>MS-DOS のアイコンのコマンドプロンプトを選択します。
790790
791791次のようにタイプして下さい:
792792
793793`cd c:\lazarus`\
794794`set path=c:\pp\bin\win32;c:\lazarus  //もちろん、ここはあなたの環境に合わせて`\
795795`                                     //書き換えて下さい`\
796796`windres -i lazarus.rc -o lazarus.res`\
797797`make`
798798
799799幸運にも無事コンパイルができたら、lazarus.exe と入力して下さい。ソースエディタ、ダイアログ、プロパティエディタが起動してきます。しかし、これで完璧ではありません。引き続き操作を行って下さい。
800800
801801サンプルは次の手順でコンパイルします:
802802
803803`cd examples`\
804804`make`
805805
806806もし、他のドライブ(例えば D ドライブなど)に lazarus をインストールしている場合、make をする際に GNU ユーティリティーが必要になってきます。もし、既にインストールしてあるのなら、環境変数の PATH にパスを通すことで(例えば set PATH=%PATH%;\<gmakepath\>)、解決します。でも d:\\ を選ばない方が簡単です。
807807
808808これで全てです。
809809
810810### Installing Lazarus under FreeBSD
811811
812812**FreeBSD 5+**
813813
814814The latest version of Lazarus into FreeBSD port tree is 0.9.26. We can to install lazarus using FreeBSD ports.
815815
816816`[]# cd /usr/ports/editors/lazarus && make install clean clean-depends`
817817
818818If you get the messages about missing source files, go to \[menu bar \>\> Environment \>\> Environment Options \>\> Files Tab: FPC source library\] and enter the directory of the FPC source files. It can be obtained from /usr/ports/distfiles/freepascal
819819
820820Good luck, that worked for me. --Jrmarino 21:29, 4 Jan 2006 (CET)
821821
822822**FreeBSD 4.10+**
823823
824-上のテキストでも述べていますが、まず GTK+ 1.2 をインストールしておく必要があります。私はそれをしていなかったので、まず最初に root になってこれをインストールしました: <code>
824+上のテキストでも述べていますが、まず GTK+ 1.2 をインストールしておく必要があります。私はそれをしていなかったので、まず最初に root になってこれをインストールしました:
825825
826826`> pkg_add -r gtk`\
827827`> pkg_add -r gdk-pixbuf`\
828828`> cd /path-to-lazarus`\
829829`> gmake`\
830830`> ./startlazarus`
831831
832-</code> もしソースファイルがないというメッセージがでたら、\[menu bar \>\> Environment \>\> Environment Options \>\> Files Tab: FPC source library\] に進み、FPC のソースファイルのあるディレクトリに移ってください。私は上で述べたように SVN からそれを入手しました。
832+もしソースファイルがないというメッセージがでたら、\[menu bar \>\> Environment \>\> Environment Options \>\> Files Tab: FPC source library\] に進み、FPC のソースファイルのあるディレクトリに移ってください。私は上で述べたように SVN からそれを入手しました。
833833
834834Good luck, that worked for me. --Jrmarino 21:29, 4 Jan 2006 (CET)
835835
8368366.0 でも同じ方法です。しかし、これには2つの潜在的な問題があります。
837837
8388381\. 起動後、lazarus のソースエディタでいくつかの壊れたフォントがあるように見えます。これはフォントの指定が間違っているためです。修正は簡単です。エディタオプションに進み、他の他のフォントを選択してください。(clean works for me).
839839
8408402\. もしパッケージとlazarus のセルフビルド機能を使用したいのなら、Linux とは異なり、自分で環境オプションでgmake (make ではなく) のパスを明示的に指定しなければなりません。
841841
842842### PC-BSD 1.0rc1+ 環境でのLazarusにインストール
843843
844844[PBI Dir](http://www.pbidir.com/)から Lazarus PBI をダウンロードして、PB-BSD 上にインストールすることが出来ます。
845845
846846注意として、/usr/port/devel/glib* にある glib* ポート、もしくは pkg_add -r glib12 glib20 を実行して glib パッケージをインストールする必要があります。 私は新しい PBI リリースでこれを修正するつもりです。
847847
848848You can install Lazarus on PB-BSD by simply downloading the Lazarus PBI from [PBI Dir](http://www.pbidir.com/)
849849
850850Note that you must install glib* port from /usr/port/devel/glib* or glib packages by pkg_add -r glib12 glib20. I will fix this in new PBI releases.
851851
852852**\[他の OpenBSD/NetBSD/DragonFlyBSD はここから\]**
853853
854854### Installing Lazarus under Mac OS X
855855
856856作業的には Linux 環境でのインストールとよく似ています。しかし、予め Apple developer ツールと X11 と GTK 1.2 をインストールしておく必要があります。
857857
858858[[Lazarus Snapshots Downloads|snaphot servers]] を利用して、Lazarus のスナップショットを簡単にインストールすることができます。
859859
8608603つの .dmg スナップショットファイルをインストールすれば、それで FPCコンパイラ、FPCのソース、Larazusのソースもまた全てインストールしたことになります。後は Lazarus を実行して、ご自身のアプリケーションを開発するだけです。前記のような方法で FPC や Lazarus のソースを別にインストールする必要はありません。Lazarus をリビルドする必要があったり、Lazarus 自体の開発に参加したかったりするなら、前記のような方法で Lazarus ソースを read-write パーミッションを持ったフォルダにインストールする必要があります。
861861
862862Carbon ウィジェットセットインターフェースのテストや開発については、 [[Carbon Interface|Carbon Interfaceを]]参照のこと。
863863
864864OS Xで Lazarus を起動するには、少なくとも二つの方法があります:
865865
866866
867867X11を起動し、ターミナルウィンドウで次のようにタイプします:
868868
869869`cd /usr/local/share/lazarus`\
870870`./lazarus`
871871
872872
873873また、Lazarus を X11 メニューから起動することもできます。Applications \| Customize を選択し、Add Item をクリックし、Nameの下に Lazarus と、Command の下に:
874874
875875`open -a /usr/local/share/lazarus/lazarus`
876876
877877
878878と入力します。Doneをクリックすれば、Applications \| Lazarus を選択することで Lazarus を起動することができるようになります。
879879
880880### Additional experiences and advice on installing FPC and Lazarus
881881
882882On linux, getting Lazarus to work can be complicated if you have an older version installed. If you have already installed earlier versions of FPC and/or Lazarus, you have to take great care that the PATHS are adjusted so that only your new versions are called.
883883
884884私が SuSE Linux 上で様々な試みから経験した落とし穴についてです:
885885
886886rpm バージョンは場合によっては FPC を /bin や /usr/bin に、ライブラリを /lib や /usr/lib にインストールします。もし .tar.gz を使ってソースバージョンからインストールしたら、デフォルトでは実行ファイルを /usr/local/bin に、ライブラリを /usr/local/lib にインストールします。
887887
888888Pitfalls that I have experienced in various attempts with SuSE linux include:
889889
890890The rpm versions often install FPC in /bin or /usr/bin, with the libraries in /lib or /usr/lib.
891891
892892If you perform a make install on a source version or use a .tar.gz, the compiler is usually installed in /usr/local/bin with the libraries in /usr/local/lib.
893893
894894So if earlier versions have been installed from rpm, make sure all links are changed to reflect the directory structure of your new compiler. The place to make the changes is in /etc/fpc.cfg ; make sure there are no remnant configuration files in your home directory or in your FPC download directory. Typically they are found in ~/.fpc.cfg
895895
896896Make sure the links in /etc/fpc.cfg point to the correct versions of the libraries (particularly if you have older versions still lurking around).
897897
898898In /usr/local/bin or /usr/bin there is a file called fpc ; this is the executable that is called when you invoke the compiler. One of the first things it does is to open ppc386 in the same directory. This has to be the same version as the fpc file, or can be a link pointing to the true ppc386 in some other directory (such as a library directory, or the fpc directory in your own development space); be sure to update your link if you install a newer version of the compiler.
899899
900900Try running the compiler from the command line using one of the simple example programs or one which you wrote yourself.
901901
902902Turning to Lazarus:
903903
904904If you use a downloaded snapshot (.tar.gz) or get the source from CVS, enter your lazarus directory and type
905905
906906`make`\
907907`./lazarus `
908908
909909and hopefully the IDE should load. There may be a message saying it can't find the sources; if so, go to the menu at the top and select Environment -\> Environment options and insert the name of the directory where you expect to find your lazarus files (eg ~/FreePascal/lazarus), your compiler (e.g. /usr/local/bin/ppc386), the FreePascal source directory (e.g. /usr/local/lib/fpc/\$version/fpc or a directory in your own space e.g. ~/FreePascal/fpc). Then close the dialog and start programming.
910910
911911You may find further problems when you start programming or compiling; most of these will be related to PATH selection.
912912
913913Many of the difficulties are dealt with in the Lazarus FAQ, found either on this WiKi site, or a more complete list on the main Lazarus site
914914
915915<http://www.lazarus.freepascal.org/modules.php?op=modload&name=FAQ&file=index>
916916
917917From the top menu select Run -\> Compiler Options (or Project -\> Compiler Options in more recent releases of Lazarus) and select the Paths tab on the resulting dialog. There are several boxes for entry of paths for Unit files, Include files, Other source files, Libraries etc. For each of these, it is worth pressing the ... (ellipsis) button on the right, and you will be given a blank window for inserting path information, and a lower window giving some suggestions. Select as many as you like (or ALL!) and press the ADD button to transfer the selections to the upper window. When your selection is complete, press OK and move on to the next box. If you know of other paths which need to be followed, press the Browse button associated with each box, and insert the additional paths.
918918
919919When you think you have got your paths right, try to compile your application. If there are further path-related errors ('can't find unit .......') then go back and check your paths, both in /etc/fpc.cfg and in your Run -\> Compiler Options dialog (or Project -\> Compiler Options depending on your version).
920920
921921Once you have got the environment and PATHS correct, it is worth saving the settings to a file, otherwise you will have to go through this process for each new project. In the Run -\> Compiler options dialog there is a Load/Save button; select this and then save the setings to the filename of your choice: mine is ~/FreePascal/default.cfg. Then each time I start a new project, I can go to the Run -\> Compiler Options dialog (or Project -\> Compiler Options), select Load/Save, and load my default.cfg file to the new project. You can, of course, modify the options for each new project if you so desire.
922922
923923---
924924*From the Free Pascal wiki, page "Installing Lazarus/ja", as it stood on 2024-03-27 after a change by Ariben, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
925925Category: FPC/ja
926926Category: Install/ja
927927Category: Japanese
928928Category: Lazarus/ja

Back to history