このドキュメントでは、Simutrans のすべての依存ライブラリとその詳細を説明します。
このドキュメントは以下の目的で作成されています:
対象読者:
Ubuntu/Debian:
sudo apt-get install zlib1g-dev
Arch Linux:
sudo pacman -S zlib
macOS:
brew install zlib
Windows (vcpkg):
vcpkg install zlib:x64-windows-static
Ubuntu/Debian:
sudo apt-get install libpng-dev
Arch Linux:
sudo pacman -S libpng
macOS:
brew install libpng
Windows (vcpkg):
vcpkg install libpng:x64-windows-static
Ubuntu/Debian:
sudo apt-get install libfreetype6-dev
Arch Linux:
sudo pacman -S freetype2
macOS:
brew install freetype
Windows (vcpkg):
vcpkg install freetype:x64-windows-static
注意: bzip2 と zstd のどちらか一方が必要です。
vcpkg を使用する場合: vcpkg.json では zstd が指定されているため、Windows で vcpkg を使用する場合は zstd が自動的にインストールされます。
Ubuntu/Debian:
sudo apt-get install libbz2-dev
Arch Linux:
sudo pacman -S bzip2
macOS:
brew install bzip2
Windows (vcpkg):
vcpkg install bzip2:x64-windows-static
Ubuntu/Debian:
sudo apt-get install libsdl2-dev
Arch Linux:
sudo pacman -S sdl2
macOS:
brew install sdl2
Windows (vcpkg):
vcpkg install sdl2:x64-windows-static
Ubuntu/Debian:
sudo apt-get install libzstd-dev
Arch Linux:
sudo pacman -S zstd
macOS:
brew install zstd
Windows (vcpkg):
vcpkg install zstd:x64-windows-static
Ubuntu/Debian:
sudo apt-get install libminiupnpc-dev
Arch Linux:
sudo pacman -S miniupnpc
macOS:
brew install miniupnpc
Windows (vcpkg):
vcpkg install miniupnpc:x64-windows-static
Ubuntu/Debian:
sudo apt-get install libfluidsynth-dev
Arch Linux:
sudo pacman -S fluidsynth
macOS:
brew install fluid-synth
注意: SoundFont ファイル(.sf2)も別途必要
Ubuntu/Debian:
sudo apt-get install libsdl2-mixer-dev
Arch Linux:
sudo pacman -S sdl2_mixer
macOS:
brew install sdl2_mixer
Windows (vcpkg):
vcpkg install sdl2-mixer:x64-windows-static
Ubuntu/Debian:
sudo apt-get install libfontconfig1-dev
Arch Linux:
sudo pacman -S fontconfig
macOS:
brew install fontconfig
インストール:
# Ubuntu/Debian
sudo apt-get install autoconf
# Arch Linux
sudo pacman -S autoconf
# macOS
brew install autoconf
インストール:
# Ubuntu/Debian
sudo apt-get install cmake
# Arch Linux
sudo pacman -S cmake
# macOS
brew install cmake
# Windows
# CMake公式サイトからインストーラーをダウンロード
インストール:
# Ubuntu/Debian
sudo apt-get install pkg-config
# Arch Linux
sudo pacman -S pkgconf
# macOS
brew install pkg-config
インストール:
# Ubuntu/Debian
sudo apt-get install build-essential
# Arch Linux
sudo pacman -S base-devel
# macOS
xcode-select --install
インストール:
# Ubuntu/Debian
sudo apt-get install clang
# Arch Linux
sudo pacman -S clang
# macOS(デフォルト)
xcode-select --install
ダウンロード:
プロジェクトルートに配置:
{
"version-string": "1.0.0",
"dependencies": ["freetype", "miniupnpc", "pthread", "zstd", "sdl2", "zlib"],
"builtin-baseline": "3c76dc55f8bd2b7f4824bcd860055094bfbbb9ea"
}
CMake と vcpkg を使用する場合、依存関係は自動的にビルド・インストールされます:
cmake .. -DCMAKE_TOOLCHAIN_FILE=[vcpkg-root]/scripts/buildsystems/vcpkg.cmake
cmake --build .
| ライブラリ | Linux | macOS | Windows (SDL2) | Windows (GDI) |
|---|---|---|---|---|
| zlib | ✓ | ✓ | ✓ | ✓ |
| libpng | ✓ | ✓ | ✓ | ✓ |
| FreeType | ✓ | ✓ | ✓ | ✓ |
| bzip2/zstd | ✓ | ✓ | ✓ | ✓ |
| SDL2 | ✓ | ✓ | ✓ | ✗ |
| pthread | システム | システム | vcpkg | システム |
| バックエンド | 必要なライブラリ | プラットフォーム |
|---|---|---|
| SDL2 | SDL2, SDL2_mixer (opt) | すべて |
| GDI | - | Windows 専用 |
| Server | - | すべて(GUI 無し) |
| 機能 | なし | bzip2 | zstd |
|---|---|---|---|
| セーブファイル圧縮 | zlib | 高圧縮率 | 高速 |
| ファイルサイズ | 基準 | 小さい | 中程度 |
| 圧縮速度 | 基準 | 遅い | 速い |
| 解凍速度 | 基準 | 中程度 | 速い |
| 機能 | なし | FluidSynth | SDL2_mixer |
|---|---|---|---|
| MIDI 再生 | ✗ | 高品質 | 標準 |
| 効果音 | ✗ | - | ✓ |
| セットアップ | 簡単 | 複雑 | 簡単 |
| SoundFont | - | ✓ | ✓ |
すべての依存ライブラリは、Simutrans のライセンス(Artistic License 1.0)と互換性があります:
| ライブラリ | ライセンス | 互換性 |
|---|---|---|
| zlib | zlib License | ✓ OSI 承認 |
| libpng | libpng License | ✓ OSI 承認 |
| FreeType | FreeType License | ✓ BSD-style |
| bzip2 | BSD-style | ✓ OSI 承認 |
| SDL2 | zlib License | ✓ OSI 承認 |
| zstd | BSD License | ✓ OSI 承認 |
| miniUPnPc | BSD License | ✓ OSI 承認 |
| FluidSynth | LGPL | ✓ 動的リンク |
| SDL2_mixer | zlib License | ✓ OSI 承認 |
| fontconfig | MIT License | ✓ OSI 承認 |
注意: FluidSynth は LGPL ですが、動的リンクにより使用可能です。
症状: configureやcmakeが依存関係を検出できない
解決方法:
pkg-config のパスを確認:
pkg-config --variable pc_path pkg-config
ライブラリが実際にインストールされているか確認:
dpkg -l | grep libsdl2 # Ubuntu/Debian
pacman -Q | grep sdl2 # Arch Linux
brew list | grep sdl2 # macOS
開発パッケージがインストールされているか確認:
症状: 異なるバージョンのライブラリが競合
解決方法:
インストール済みバージョンを確認:
pkg-config --modversion sdl2
古いバージョンを削除:
sudo apt-get remove --purge libsdl2-dev
sudo apt-get autoremove
再インストール:
sudo apt-get update
sudo apt-get install libsdl2-dev
症状: ビルドは成功するが実行時にライブラリが見つからない
解決方法:
共有ライブラリのパスを確認 (Linux):
ldd ./build/default/sim
LD_LIBRARY_PATH を設定:
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
ldconfig を実行 (要 root 権限):
sudo ldconfig
症状: vcpkg がライブラリをビルドできない
解決方法:
vcpkg を最新に更新:
cd [vcpkg-root]
git pull
.\bootstrap-vcpkg.bat
キャッシュをクリア:
.\vcpkg remove --outdated
.\vcpkg install [package]:x64-windows-static --recurse
マニフェストモードを使用:
vcpkg.jsoncmake/SimutransFindDependencies.cmakeconfig.default, config.templatetools/install-building-libs-*.battools/setup-debian.shsetup-development.shSimutrans の依存関係は、安定性と互換性を優先して設計されています:
主な特徴:
依存関係を準備したら、次は DEVELOPMENT_SETUP.md で開発環境を構築しましょう。
このドキュメントは定期的に更新されます。最新情報は以下で確認してください: