4. 必要な開発ツールについて
1.Cygwin
2.GNU Make(LibreOfce patched version)
3.Java SE Development Kit 7
4.Apache Ant
5.Visual Studio Express 2012 for Windows Desktop
※ 一部の機能を無効にしてビルドすることで環境構築を簡略化します
4
LibreOffice Productivity Suite
5. ビルドする LibreOfce のバージョンを選ぶ
4.2 か master を選択 (2013 年 12 月時点 )
4.2 以降はビルドもデバッグも楽
依存している開発ツール類が減り、ビルド環境構築が楽になった
日本語環境でのビルドや日本語 UI のビルドがやりやすい
ビルド環境はどんどん改善される
古いバージョンをビルドするのは時間の無駄(?)
恐らく、このスライドの内容 (2013 年 12 月時点 ) も、あっという間に古くな
ります
Building LibreOfce from an IDE,etc...
5
LibreOffice Productivity Suite
6. 用意する OS 、ハードウェア
OS は Windows 7 / 8 / 8.1 どれでもビルド可
32 ビット OS / 64 ビット OS のどちらもビルド可
ハードウェアは、いまどきの一般的な PC を想定
CPU はマルチコア、搭載メモリは 4GB 以上、ストレージの空きも 100GB く
らいありますよね ...
6
LibreOffice Productivity Suite
8. ビルド環境構築手順の概観
Cygwin のインストール
② GNU Make(LibreOfce patched version) のインストール
③ Java SE Development Kit 7 のインストール
④ Apache Ant のインストール
⑤ Visual Studio Express 2012 for Windows Desktop のイン
ストール
⑥ LibreOfce のソースコード取得
①
8
LibreOffice Productivity Suite
9. ① Cygwin のインストール
Cygwin のサイトからインストーラー (setup-x86.exe か
setup-x86_64.exe) をダウンロード
-P オプションを付けてコマンドプロンプトからインストー
ラーを実行
インストールするパッケージのリストを指定して楽します
パッケージのリストは TDF Wiki に書かれている方が汎用的かも ...
GUI のインストーラーが起動するので続けて操作
REM コマンドプロンプト上で実行してください
REM 実際は一行です
C:¥tmp> setup-x86.exe -P
autoconf,automake,bison,doxygen,flex,gcc4-g++,git,gperf,
make,patch,perl,python,pkg-config,unzip,zip,curl,wget,
perl-Archive-Zip
C:¥tmp>
9
LibreOffice Productivity Suite
10. ② GNU Make(LibreOfce patched version) のイン
ストール
dev-www.libreofce.org で配布されているバイナリをダウン
ロードして /opt/lo/bin 等へ配置
http://dev-www.libreofce.org/bin/cygwin/make
このバイナリは 64 ビット版の cygwin で使えないので注意(自分でソースか
らビルドする)
;; Cygwin Terminal 上で実行してください
$ mkdir -p /opt/lo/bin
$ cd /opt/lo/bin
$ curl -O http://dev-www.libreoffice.org/bin/cygwin/make
$ chmod +x make
$ /opt/lo/bin/make -v
GNU Make 4.0
…
LibreOffice patched version
$
10
LibreOffice Productivity Suite
11. ③ Java SE Development Kit 7 のインストール
Oracle のサイトから Windows x86 用 ( 必ず 32 ビット版 ) を
ダウンロードしてインストール
http://www.oracle.com/technetwork/java/javase/downloads/index.html
11
LibreOffice Productivity Suite
12. ④ Apache Ant のインストール
Apache のサイトからバイナリをダウンロードして、解凍して
適当なフォルダに配置
http://ant.apache.org/
12
LibreOffice Productivity Suite
13. ⑤ Visual Studio Express 2012 for Windows
Desktop のインストール
マイクロソフトのダウンロードセンターからダウンロードし
てインストール
http://www.microsoft.com/ja-jp/download/details.aspx?id=34673
Visual Studio 2012 の更新プログラムを適用
ビルドしてできたバイナリを XP 上で実行したいなら必須
なぜ Visual Studio Express 2012 for Windows Desktop ?
SDK 類が一緒にインストールされるので楽
Windows SDK 、 DirectX SDK 、 .NET Framework
Express 版でもごく一部の機能を除けばビルド可能
13
LibreOffice Productivity Suite
18. ② make
先ほどダウンロードした LibreOfce patched version の
make を実行
Cygwin 標準の make ではエラー!!
実は make すれば必要な処理が実行される
autogen.sh
サブモジュールの取得
ダウンロード
パッケージ、翻訳ファイル、辞書、ヘルプ
LibreOfce のビルドが始まる
時間が掛かるのでしばし待つ
$ /opt/lo/bin/make
…
$
18
LibreOffice Productivity Suite
19. ③ 実行とデバッグ
ビルドできたら instdir/program/sofce.exe を実行
LibreOfce が起動する
Visual Studio を起動し、 sofce.bin プロセスにアタッチしてデバッグする
ソースコードデバッグが可能なはず
インストーラー (msi) は
workdir/installation/LibreOfce_Dev/msi/install/en-US_ja_qtz 配下にある
$ ./instdir/program/soffice.exe
…
19
LibreOffice Productivity Suite
20. ④ ビルドエラーが発生したら
エラーメッセージやログを見て修正
時々コミットが原因で Windows のビルドが壊れることがある
最近は、あっという間に修正される(?)
Tinderbox のビルド状況を見る
http://tinderbox.libreofce.org/MASTER/status.html
ビルドエラー修正のコミットがないかリポジトリを見る
http://cgit.freedesktop.org/libreofce/core/
20
LibreOffice Productivity Suite
24. その 2
ウイルス対策ソフトが反応してビルドに失敗する
BitDefender / other security tools breaking the build
https://wiki.documentfoundation.org/Development/Windows_Build_De
pendencies
※Wiki ページの最後の方
対策
Cygwin のテンポラリに作られる該当ファイルをウイルス対策ソフトのス
キャン対象から除外する
autogen.sh のオプションに --disable-cve-tests を指定
24
LibreOffice Productivity Suite
25. その 3
インストーラー作成時のエラー対策
mergemodule.pm を 1 行だけ修正
confgure.ac か mergemodule.pm の不具合(多分)
可能な方は修正お願いします ( 私もします )
diff --git a/solenv/bin/modules/installer/windows/mergemodule.pm
b/solenv/bin/modules/installer/windows/mergemodule.pm
index 8922f7c..4ba2a88 100644
--- a/solenv/bin/modules/installer/windows/mergemodule.pm
+++ b/solenv/bin/modules/installer/windows/mergemodule.pm
@@ -75,7 +75,7 @@ sub merge_mergemodules_into_msi_database
foreach $mergemodule ( @{$mergemodules} )
{
my $filename = $mergemodule->{'Name'};
my $mergefile = $ENV{'MSM_PATH'} . $filename;
+
my $mergefile = $ENV{'MSM_PATH'} . $installer::globals::separator
. $filename;
if ( ! -f $mergefile ) { installer::exiter::exit_program("ERROR:
msm file not found: $filename ($mergefile)!", "mer
my $completesource = $mergefile;
25
LibreOffice Productivity Suite
26. Thank you …
みんなでデバッグしよう!!
All text and image content in this document is licensed under the Creative Commons Attribution-Share Alike 3.0 License
(unless otherwise specified). "LibreOffice" and "The Document Foundation" are registered trademarks. Their respective logos
and icons are subject to international copyright laws. The use of these therefore is subject to the trademark policy.
26
LibreOffice Productivity Suite
27. 参考文献 / Web ページ
Windows Build Dependencies(TDF Wiki)
https://wiki.documentfoundation.org/Development/Windows_Build_Depe
ndencies
Tinderbox Status Page
http://tinderbox.libreofce.org/MASTER/status.html
http://tinderbox.libreofce.org/libreofce-4-2/status.html
libreofce/core main, development code repository
http://cgit.freedesktop.org/libreofce/core/
Dev-tools misc. useful libreofce development tools
http://cgit.freedesktop.org/libreofce/contrib/dev-tools/
27
LibreOffice Productivity Suite