mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Updated Building OpenRCT2 on Linux (markdown)
@@ -1,10 +1,4 @@
|
||||
Recently (in Sept 2015) OpenRCT2 build system has undergone quite a big overhaul.
|
||||
|
||||
This was done in relation to new targets becoming available, mostly Linux.
|
||||
|
||||
As you can now build OpenRCT2 for native system (well, an x86-compatible system is required), this has become a default setting. You can still build using mingw quite easily.
|
||||
|
||||
Since https://github.com/OpenRCT2/OpenRCT2/pull/4451 it is also possible to build an architecture-independent (but little-endian only) version, it should have all the logic and some drawing (see https://github.com/OpenRCT2/OpenRCT2/issues/3365 for status). You can pass an option to CMake to enable such configuration: `-DDISABLE_RCT2=on`
|
||||
You can only build OpenRCT2 on little-endian architectures for now.
|
||||
|
||||
This page tells you how to build the project. For instructions on how to get assets and run it check https://github.com/OpenRCT2/OpenRCT2/wiki/Installation-on-Linux.
|
||||
|
||||
@@ -15,77 +9,52 @@ To build natively on Linux, you will need a set of libraries set up. Since most
|
||||
* `speexdsp`
|
||||
* `fontconfig`
|
||||
* `jansson`
|
||||
* `libzip`
|
||||
|
||||
Optional are:
|
||||
* `curl`
|
||||
* `openssl`
|
||||
|
||||
## APT (Debian, Ubuntu)
|
||||
### APT (Debian, Ubuntu)
|
||||
|
||||
This solution is tested continuously by Travis.
|
||||
|
||||
The exact package names will differ from distribution to distribution, but here's a short list of the common ones:
|
||||
```
|
||||
sudo dpkg --add-architecture i386
|
||||
sudo apt-get update
|
||||
sudo apt-get install --no-install-recommends -y libjansson-dev:i386 libssl-dev:i386\
|
||||
cmake libsdl2-dev:i386 libsdl2-ttf-dev:i386 pkg-config:i386 gcc-multilib \
|
||||
g++-multilib libspeex-dev:i386 libspeexdsp-dev:i386 libcurl4-openssl-dev:i386 \
|
||||
libcrypto++-dev:i386 libfontconfig1-dev:i386 libfreetype6-dev:i386
|
||||
sudo apt-get install --no-install-recommends -y cmake libsdl2-dev libsdl2-ttf-dev \
|
||||
gcc pkg-config libjansson-dev libspeex-dev libspeexdsp-dev libcurl4-openssl-dev \
|
||||
libcrypto++-dev libfontconfig1-dev libfreetype6-dev libpng-dev libssl-dev libzip-dev
|
||||
```
|
||||
This listing should work on Debian and Ubuntu.
|
||||
|
||||
If your `jansson` package is older than 2.7, you will need to use the one from newer ubuntu version. It should install without any additional dependencies.
|
||||
```
|
||||
wget https://launchpad.net/ubuntu/+archive/primary/+files/libjansson4_2.7-1ubuntu1_i386.deb
|
||||
wget https://launchpad.net/ubuntu/+archive/primary/+files/libjansson-dev_2.7-1ubuntu1_i386.deb
|
||||
sudo dpkg -i libjansson4_2.7-1ubuntu1_i386.deb
|
||||
sudo dpkg -i libjansson-dev_2.7-1ubuntu1_i386.deb
|
||||
```
|
||||
|
||||
## pacman/yaourt (Arch)
|
||||
### pacman (Arch)
|
||||
|
||||
This solution is tested continuously with our own dockerfile and then travis.
|
||||
|
||||
As with other distros, you'll need gcc capable of producing 32-bit binaries. The package is called `gcc-multilib`, but it conflicts with `gcc` which you probably have installed already.
|
||||
|
||||
1. First install [yaourt](https://wiki.archlinux.org/index.php/Yaourt#Installation).
|
||||
|
||||
2. [Enable 32-bit libraries](https://wiki.archlinux.org/index.php/Multilib#Enabling). Note: This is not enabled by default.
|
||||
|
||||
At this point, you have two options, you can continue following this guide (for development purposes), or you can simply run `yaourt -S openrct2-git`.
|
||||
|
||||
3. Run the following commands (Replaces gcc with gcc-multilib, and installs cmake):
|
||||
```
|
||||
sudo pacman -Rdd gcc gcc-libs
|
||||
sudo pacman -S gcc-libs-multilib gcc-multilib cmake git
|
||||
```
|
||||
4. Install these packages (uses yaourt to install the remaining required packages):
|
||||
Install dependencies:
|
||||
|
||||
```
|
||||
yaourt -S lib32-jansson lib32-curl lib32-sdl2 lib32-sdl2_ttf \
|
||||
lib32-speex lib32-fontconfig
|
||||
sudo pacman -S sdl2 sdl2_ttf curl jansson speexdsp fontconfig libpng openssl libzip gcc gcc-libs
|
||||
```
|
||||
|
||||
When running yaourt, you **MUST NOT** be running as root, as it will **NOT** allow you do finish the install process. pacman **SHOULD** be run as root via Sudo.
|
||||
|
||||
## DNF (Fedora, Tested on 24 rawhide):
|
||||
This install procedure has not been verified by a developer, if someone could confirm, that would be great.
|
||||
### DNF (Fedora, Tested on 24 rawhide):
|
||||
This has not been verified, but should work.
|
||||
|
||||
Basically run this command:
|
||||
```
|
||||
sudo dnf install gcc gcc-c++ jansson-devel jansson-devel.i686 SDL2_ttf-devel \
|
||||
SDL2_ttf-devel.i686 mingw32-gcc-c++ speex-devel speex-devel.i686 \
|
||||
speexdsp-devel speexdsp-devel.i686 libcurl-devel libcurl-devel.i686 \
|
||||
glibc-devel glibc-devel.i686 cmake fontconfig-devel.i686 freetype-devel.i686 \
|
||||
libpng-devel libpng-devel.i686
|
||||
sudo dnf install gcc gcc-c++ jansson-devel SDL2_ttf-devel \
|
||||
SDL2_ttf-devel speex-devel speex-devel \
|
||||
speexdsp-devel libcurl-devel \
|
||||
glibc-devel cmake fontconfig-devel freetype-devel \
|
||||
libpng-devel libpng-devel libzip-devel
|
||||
```
|
||||
You may also need to do the following:
|
||||
```
|
||||
sudo dnf install openssl-devel openssl-devel.i686 jansson-devel SDL2_ttf-devel speexdsp-devel freetype freetype-devel --best
|
||||
```
|
||||
|
||||
## Gentoo
|
||||
### Gentoo
|
||||
This section is outdated and needs an update to reflect we can now build for x86_64 and other little-endian platforms.
|
||||
|
||||
This install requires either plain `x86` system or `amd64` with multilib enabled.
|
||||
|
||||
@@ -113,9 +82,10 @@ As mentioned earlier, we also have a dockerfile. This is useful when you cannot
|
||||
|
||||
To later run the binary, some filesystem preparation is required.
|
||||
|
||||
Assets are expected to be in specific places, so to launch it, following needs to satisified:
|
||||
Assets are expected to be in specific places, so to launch it, following needs to satisfied:
|
||||
* `$build/data/` has to have contents of `$repo/data/`
|
||||
* `$build/openrct2.exe` has to be `$repo/openrct2.exe`
|
||||
* `$build/data/title` has to have extracted contents of one of https://github.com/OpenRCT2/title-sequences/releases
|
||||
* `$build/openrct2.exe` has to be `$repo/openrct2.exe` (optional)
|
||||
* `$XDG_CONFIG_HOME/OpenRCT2/` (or `~/.config/OpenRCT2/` in its absence) has to have `config.ini` with `game_path` set to an RCT install.
|
||||
Keep in mind you can symlink stuff and that filesystems are case sensitive!
|
||||
You can copy more of required data to possibly improve your experience.
|
||||
@@ -135,13 +105,6 @@ make g2
|
||||
|
||||
This will build `g2.dat`, which needs to be accessible from `data/` directory, you can copy or symlink it there.
|
||||
|
||||
If your distribution does not find required libraries make sure you have them available for x86 arch (32 bit).
|
||||
|
||||
You may also have to specify `PKG_CONFIG_PATH` explictily when invoking `cmake`:
|
||||
```
|
||||
PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig/:$PKG_CONFIG_PATH cmake ../
|
||||
```
|
||||
|
||||
## Known problems
|
||||
|
||||
* Creating a release build with clang fails in runtime. GCC is capable of producing a working build, so this has low priority.
|
||||
|
||||
Reference in New Issue
Block a user