#author("2017-12-31T14:56:57+09:00","default:shinkai","shinkai")
DCSS(英語版)を手元でソースコードからビルドするための覚え書き。
** 環境
Windows 10 Home (Windows 10 Fall Creators Update適用)
* 準備
** Git for Windows SDK 1.0.6をインストール
https://github.com/git-for-windows/build-extra/releases からgit-sdk-installer-1.0.6-64.7z.exeをダウンロードして実行。
c:\git-sdk-64が生成されるので、エクスプローラ等で開いてgit-bash.exeを実行する。
出てきた黒い画面に「git version」と入力し、Enterを押して「git version 2.9.3.windows.2」等と帰ってくればOK。(細かい数字は異なるかも)
&ref(git-bash1.png);
** ソースコードをダウンロード
本家からソースコードをDLし、目的のバージョンに切り替える。(この例ではstone_soup-0.16ブランチ)
$ git clone --recursive https://github.com/crawl/crawl.git dcss-0.16
$ cd dcss-0.16
$ git checkout --track origin/stone_soup-0.16
** ビルド
タイル版をビルドする。
$ cd crawl-ref/source
$ make TILES=y
** 実行
生成されたcrawl.exeを実行するとDCSSタイル版が起動する。
** トラブルシュート
*** sdl2のコンパイルエラーが起こるとき
↓こういうエラーが出るとき。
In file included from src/core/windows/SDL_xinput.c:24:0:
src/core/windows/SDL_xinput.h:115:3: error: conflicting types for 'XINPUT_GAMEPAD_EX'
} XINPUT_GAMEPAD_EX;
^~~~~~~~~~~~~~~~~
In file included from src/core/windows/SDL_xinput.h:29:0,
from src/core/windows/SDL_xinput.c:24:
C:/git-sdk-64/mingw64/x86_64-w64-mingw32/include/xinput.h:182:3: note: previous declaration of 'XINPUT_GAMEPAD_EX' was here
} XINPUT_GAMEPAD_EX, *PXINPUT_GAMEPAD_EX;
^~~~~~~~~~~~~~~~~
In file included from src/core/windows/SDL_xinput.c:24:0:
src/core/windows/SDL_xinput.h:123:3: error: conflicting types for 'XINPUT_STATE_EX'
} XINPUT_STATE_EX;
^~~~~~~~~~~~~~~
In file included from src/core/windows/SDL_xinput.h:29:0,
from src/core/windows/SDL_xinput.c:24:
C:/git-sdk-64/mingw64/x86_64-w64-mingw32/include/xinput.h:192:3: note: previous declaration of 'XINPUT_STATE_EX' was here
} XINPUT_STATE_EX, *PXINPUT_STATE_EX;
crawl-ref/source/contrib/sdl2/src/core/windows/SDL_xinput.hを開いて~
(0.20以前などの場合で、存在しなければcontrib/sdl2/src/joystick/windows/SDL_dxjoystick.h)
ifndef HAVE_XINPUT_GAMEPAD_EX
typedef struct
{
WORD wButtons;
BYTE bLeftTrigger;
BYTE bRightTrigger;
SHORT sThumbLX;
SHORT sThumbLY;
SHORT sThumbRX;
SHORT sThumbRY;
DWORD dwPaddingReserved;
} XINPUT_GAMEPAD_EX;
#endif
#ifndef HAVE_XINPUT_STATE_EX
typedef struct
{
DWORD dwPacketNumber;
XINPUT_GAMEPAD_EX Gamepad;
} XINPUT_STATE_EX;
#endif
の箇所を削除するかコメントアウトする。
*** pacman -S (パッケージ名)して"database file for 'git-for-windows-mingw32' does not exist"とか表示された場合
$ pacman -Syy
でデータベースを同期させる。