参考サイト(GnuCash公式Wiki)
http://wiki.gnucash.org/wiki/Windows#Instructions_for_an_.28almost.29_automated_build
ビルド環境
Vista以降だとUAC切らないとビルド手順中のサイレントインストールでこけるのでXPで実施する。
XP環境がないなら、わざわざXP環境を用意するよりLinux環境でクロスコンパイルした方が良さげ。
作業手順
作業フォルダ作成
作業フォルダを決める。どこでも良いが、公式の手順通り"c:\soft"として記す。
Gitインストール
GitのGoogle CodeサイトからPortable版をダウンロードして、"c:\soft\git"に解凍する。
インストーラー版をダウンロードして普通にインストールしても良い。
MSYSのインストール
公式の説明では、MSYS-1.0.11.exeをダウンロード/実行してインストールする。
この際、インストール先は、"c:\soft\msys"とする。
*注意* C:\soft\msys\1.0 ではない。フォルダ選択時に"1.0"部分は削除すること。
MSYS環境でwgetを使えるようにする。
MinGWサイトからwget, libopenssl, libintl, libiconvを"c:\soft\downloads"にダウンロードする。
MSYSシェルを起動して、ダウンロードしたファイルを"/"以下に解凍する。
$ lzma -cd /c/soft/downloads/wget-1.12-1-msys-1.0.13-bin.tar.lzma | tar xvf - -C / bin/ bin/wget.exe etc/ etc/wgetrc $ lzma -cd /c/soft/downloads/libopenssl-1.0.0-1-msys-1.0.13-dll-100.tar.lzma |tar xvf - -C / bin/msys-crypto-1.0.0.dll bin/msys-ssl-1.0.0.dll lib/openssl/engines-1.0.0/ lib/openssl/engines-1.0.0/lib4758cca.so lib/openssl/engines-1.0.0/libaep.so lib/openssl/engines-1.0.0/libatalla.so lib/openssl/engines-1.0.0/libcapi.so lib/openssl/engines-1.0.0/libchil.so lib/openssl/engines-1.0.0/libcswift.so lib/openssl/engines-1.0.0/libgmp.so lib/openssl/engines-1.0.0/libgost.so lib/openssl/engines-1.0.0/libnuron.so lib/openssl/engines-1.0.0/libpadlock.so lib/openssl/engines-1.0.0/libsureware.so lib/openssl/engines-1.0.0/libubsec.so $ lzma -cd /c/soft/downloads/libintl-0.18.1.1-1-msys-1.0.17-dll-8.tar.lzma | tar xvf - -C / bin/msys-intl-8.dll $ lzma -cd /c/soft/downloads/libiconv-1.14-1-msys-1.0.17-dll-2.tar.lzma | tar xvf - -C / bin/msys-iconv-2.dll
flexを入れる
そのままだと、gitに含まれるflexが使用されるっぽい。
そしてgitに含まれるflexがフリーズするので別途msys用flexを入れる。
$ wget http://sourceforge.net/projects/mingw/files/MSYS/Extension/flex/flex-2.5.35-2/flex-2.5.35-2-msys-1.0.13-bin.tar.lzma $ lzma -cd flex-2.5.35-2-msys-1.0.13-bin.tar.lzma | tar xvf - -C / bin/ bin/flex.exe lib/ lib/libfl.a lib/libfl_pic.a include/ include/FlexLexer.h
fstab の作成
$ touch /etc/fstab
最新版のソースをチェックアウト
$ cd /c/soft/gnucash $ /c/soft/git/bin/git clone git://github.com/Gnucash/gnucash.git repos Cloning into 'repos'... remote: Counting objects: 164203, done. remote: Compressing objects: 100% (26965/26965), done. Receiving objects: 100% (164203/164203), 104.42 MiB | 228 KiB/s, done. remote: Total 164203 (delta 136834), reused 163942 (delta 136585) Resolving deltas: 100% (136834/136834), done. Checking out files: 100% (2548/2548), done. $
パッチをあてる
2013/04/03時点では、バグがあり。そのままではビルドできません。報告済みだが、修正前されるまでは添付のパッチを参考に修正する必要がある。
ビルドできるようになりました。
custom.shの編集
"C:\soft\gnucash\repos\packaging\win32\custom.sh"を作成する。
GLOBAL_DIR="c:\soft"
GIT_DIR="${GLOBAL_DIR}\\git"
ACTIVE_PERL_URL="http://downloads.activestate.com/ActivePerl/releases/5.14.4.1405/ActivePerl-5.14.4.1405-MSWin32-x86-296746.zip"
ビルド実行
ビルドを実行する。
$ /c/soft/gnucash/repos/packaging/win32/install.sh | tee /c/soft/build.txt
※HTML Help Workshopは、サイレントインストールができないので、途中でインストールダイアログが立ち上がる。
その際にインストール先を"c:\soft\hh"にしてインストールを実行する。