2009年10月22日木曜日

dia 0.97 インストールの記録

要約

Debian の dia パッケージでなんら不足は無かったのだが、 ためしに最新バージョンをビルドしてみた。

ビルド環境

Debian 5.0.3 "lenny" でビルド。

必要なパッケージ

Dia 本家よりリンクをたどり、 dia-0.97.tar.bz2 をダウンロードする。 他にも各種パッケージが必要だったが、それについては、その都度インストールした。

結局インストールしたものは次のとおり。

  • libart-2.0-dev パッケージ
  • libEMF
  • libgnome2-dev パッケージ
  • libgnomeui-dev パッケージ
  • python2.5-dev パッケージ
  • swig1.3 パッケージ
  • libwmf-dev パッケージ
  • libwmf-bin パッケージ
  • docbook-utils パッケージ
  • dblatex パッケージ

作業内容

configure

configure 1回目

ソースパッケージを展開後、 とりあえず何もオプションを指定せずに configureを実行してみた。 するとエラーが出た。 つまり「intltool-update というコマンドが見つからない」というわけである。

調べてみると、このコマンドは妙なところにあった。

$ locate  intltool-update
/usr/share/intltool-debian/intltool-update

$ file /usr/share/intltool-debian/intltool-update
/usr/share/intltool-debian/intltool-update: a /usr/bin/perl -w script text executable
このような場所はコマンドの検索パスに無いから見つからなくて当然である。

configure 2回目

そこで以下を実行した。

$ PATH=/usr/share/intltool-debian:$PATH ./configure

結果は次のようになった。

Configuration:
 Source code location: .
 Compiler:  gcc

 Gnome support:    no
 Python support:    no
 Libart support (PNG export):  no
 Cairo support (PNG, PDF, print): yes
 Dia Python bindings with SWIG  no
 WMF plug-in with libEMF:                no
 html doc:                               no
 pdf and ps doc:                         no

libart の開発環境インストール

これではあまりに寂しいので、まずは libart の開発環境をインストール。

$ sudo aptitude install libart-2.0-dev

libEMF のインストール

このライブラリは Debian のパッケージに無かったので、自前でインストールした。 libEMF 本家からリンクをたどり、ECMA-234 Metafile Library のページから libEMF-1.0.4.tar.gz をダウンロードする。

あとは、パッケージ付属のドキュメントを読んでから、以下のように構築。

$ ./configure --enable-editing
$ make
$ sudo make install
$ sudo /sbin/ldconfig

configure 3回目

以下を実行

$ PATH=/usr/share/intltool-debian:$PATH ./configure
結果は、
Configuration:
 Source code location: .
 Compiler:  gcc

 Gnome support:    no
 Python support:    no
 Libart support (PNG export):  yes
 Cairo support (PNG, PDF, print): yes
 Dia Python bindings with SWIG  no
 WMF plug-in with libEMF:                no
 html doc:                               no
 pdf and ps doc:                         no

configure 4回目

以下を実行 すると libgnome2.0 not found になった。

libgnome2-dev 開発環境のインストール

そこで libgnome2-dev をインストール。

configure 5回目

以下を実行。 すると No package 'libgnomeui-2.0' found となった。

libgnomeui-dev 開発環境のインストール

そこで libgnomeui-dev をインストール。

configure 6回目

以下を実行。 すると、以下のエラーになった。

checking for python module gtk... yes
checking for headers required to compile python extensions... not found
checking for libpython2.5.a... not found
configure: error: could not find files required to build python plugin

python2.5-dev 開発環境のインストール

そこで python2.5-dev をインストール。

$ sudo aptitude install python2.5-dev

configure 7回目

以下を実行。 すると以下のエラーとなった。

checking for swig... no
configure: WARNING: cannot find 'swig' program. You should look at http://www.swig.org
configure: error: could not find SWIG required to generate the bindings

swig1.3 のインストール

そこで swig1.3 をインストール。

$ sudo aptitude install swig1.3

configure 8回目

以下を実行。 結果は次のとおり。

Configuration:
 Source code location: .
 Compiler:  gcc

 Gnome support:    yes
 Python support:    yes
 Libart support (PNG export):  yes
 Cairo support (PNG, PDF, print): yes
 Dia Python bindings with SWIG  yes
 WMF plug-in with libEMF:                no
 html doc:                               yes
 pdf and ps doc:                         yes
WMF plug-in with libEMF の部分だけが no のままである。

libwmf-dev と libwmf-bin のインストール

そこで libwmf-devlibwmf-bin をインストールしてみる。

$ sudo aptitude install libwmf-dev libwmf-bin

configure 9回目

以下を実行。 しかし、まだダメである。

Configuration:
        Source code location:   .
        Compiler:               gcc

        Gnome support:                          yes
        Python support:                         yes
        Libart support (PNG export):            yes
        Cairo support (PNG, PDF, print):        yes
        Dia Python bindings with SWIG           yes
        WMF plug-in with libEMF:                no
        html doc:                               yes
        pdf and ps doc:                         yes
そこで config.log を調べてみると、 /usr/local/include/libEMF/emf.h が検出されていないことが分かった。

configure 10回目

そこで以下のように CPPFLAGS の定義を追加して実行。 結果は次のとおり。

Configuration:
 Source code location: .
 Compiler:  gcc

 Gnome support:    yes
 Python support:    yes
 Libart support (PNG export):  yes
 Cairo support (PNG, PDF, print): yes
 Dia Python bindings with SWIG  yes
 WMF plug-in with libEMF:                yes
 html doc:                               yes
 pdf and ps doc:                         yes

make

これで全部 yes になったので make してみる。

$ make
結果は
Writing index.html for book(index)
touch dia_html
no -t pdf -T  native \
                -P 'latex.unicode.use=1' \
                -P latex.encoding='utf8' \
                -P 'latex.class.options=oneside' \
                dia.xml
make[3]: no: コマンドが見つかりませんでした
make[3]: [dia.pdf] エラー 127 (無視されました)
make[3]: *** `.epsfigures' に必要なターゲット `ps/graphics/color_selector.eps' 
を make するルールがありません.  中止.
make[3]: ディレクトリ `/home/fumi/src/dia/dia-0.97/doc/en' から出ます
make[2]: *** [all-recursive] エラー 1
make[2]: ディレクトリ `/home/fumi/src/dia/dia-0.97/doc' から出ます
make[1]: *** [all-recursive] エラー 1
make[1]: ディレクトリ `/home/fumi/src/dia/dia-0.97' から出ます
make: *** [all] エラー 2
configure の結果には以下の箇所があった。
checking for dblatex... no
checking for jw... no

docbook-utils のインストール

そこで、ひょっとして、と思い、docbook-utils をインストール。

$ sudo aptitude install docbook-utils
以下の新規パッケージがインストールされます:
  docbook-dsssl{a} docbook-utils jadetex{a} libostyle1c2{a} 
  libsgmls-perl{a} libsp1c2{a} openjade{a} sgmlspl{a} sp{a} 

configure 11回目

以下を実行。 すると、以下の箇所でまだ検出されないものがあった。

checking for dblatex... no
checking for jw... /usr/bin/jw

dblatex のインストール

そこで dblatex をインストール。

$ sudo aptitude install dblatex
以下の新規パッケージがインストールされます:
  dblatex doc-base{a} libfreezethaw-perl{a} libmldbm-perl{a} 
  libuuid-perl{a} preview-latex-style{a} texlive-generic-extra{a} 
  texlive-humanities{a} texlive-humanities-doc{a} texlive-lang-cyrillic{a} 
  texlive-latex-extra{a} texlive-latex-extra-doc{a} texlive-pictures{a} 
  texlive-pictures-doc{a} texlive-xetex{a} texpower{a} texpower-manual{a} 

configure 12回目

以下を実行。 これでいずれも検出された。

checking for dblatex... /usr/bin/dblatex
checking for jw... /usr/bin/jw

make 2回目

configure がうまくいくようになったので、 最初からやり直す。 結果は以下のとおり。

Found png for 'graphics/preferences-gridlines'
Found png for 'graphics/file-preferences-tree'
'dia.pdf' successfully built
make[3]: *** `.epsfigures' に必要なターゲット `ps/graphics/color_selector.eps' 
を make するルールがありません.  中止.
make[3]: ディレクトリ `/home/fumi/src/dia/dia-0.97/doc/en' から出ます
make[2]: *** [all-recursive] エラー 1
make[2]: ディレクトリ `/home/fumi/src/dia/dia-0.97/doc' から出ます
make[1]: *** [all-recursive] エラー 1
make[1]: ディレクトリ `/home/fumi/src/dia/dia-0.97' から出ます
make: *** [all] エラー 2
make するルールが無いのではいかんともしがたいので、 やむなく --with-hardbooks オプションを削除。

make 3回目

再度やり直し。 これで、ようやくビルド完了。単純だが面倒だった。

0 件のコメント:

コメントを投稿