Difference between revisions of "Building Ryzom Client On Debian"

From Ryzom Forge Wiki

Jump to: navigation, search
(Setting up the chroot)
(Completely reworked page)
Line 1: Line 1:
{{tabLang|EN|Ryzom Client On Debian DE|Building Ryzom Client On Debian|Ryzom Client On Debian ES|Ryzom Client On Debian FR|Ryzom Client On Debian RU}}
 
{{ToTrad|DE}}
 
{{ToTrad|ES}}
 
{{ToTrad|FR}}
 
{{ToTrad|RU}}
 
 
 
 
 
 
== General ==
 
== General ==
  
  
This page applies for Debian-based GNU/Linux distributions. It should work on other linux distribution too, but some package name might change. To compile Ryzom client under Mac OS X, please check this page : [[Building Ryzom Client under Mac OS X]]
+
This page applies for Debian-based GNU/Linux distributions. It should work on other linux distribution too, but some package name might change. To compile Ryzom client under Mac OS X, please check this page : [[Building Ryzom Client under Mac OS X]]. For Archlinux, check [[Building Ryzom Client under Archlinux]]
 
 
 
 
If you build the client for your own system, i recommend building a dynamically linked version ; you can follow [[Building_Ryzom_Client_On_Debian_(Stripped_Version)]] to do this (the steps are also included in this guide but there is no risk of confusion using the stripped version). If you want to distribute some binaries (and only if you want to do that), you should build a static version. It's highly recommended to build with an old libc version. The easiest version to do that is using an old distribution ; here i use a chroot because i want to have a clean build environment, but you can perfectly do it in your own system, just skip the [[#Setting up the chroot]] part, and command run as user inside the chroot as simple user [in your system], command run as root inside the root as root [in your system] :)
 
 
 
=== Why should i build my own client ? ===
 
 
 
There is a couple of valables reasons :
 
* You are having problems with sound (usually this happens when you don't use pulseaudio on your system)
 
* You want better performance
 
* You want to say "i did it !"
 
* You love to build your own executable (gentoo users, i'm looking at you)
 
* You want better graphics : the official client beeing pretty old, and some big update (including anti-aliasing if possible and anisotropic filter things like that) are available if you take the last code from RyzomCore.
 
 
 
== Setting up the chroot ==
 
 
 
The host system should be a debian or any derivate. Didn't tested but if you chroot a squeeze, your debian version should be at least a squeeze too.
 
I choosed squeeze because the libc version is pretty old, so the static binary compiled should work on (almost) every linux system.
 
$ command means run as simple user
 
# command means run as root
 
#$ command means run as simple user inside chroot
 
## command means run as root inside chroot
 
  
Don't forget to change USER by your username or it won't work :p
+
If you are building the client for your own computer, build a dynamically linked version. If you are building it for other people, it's probably safer to build a statically linked version (note : you should use a distribution with a not too recent libc6, if you want it to work on as many platforms as possible. I recommend a debian Jessie, and doing that in a chroot or a VM).
# apt-get install debootstrap schroot
 
$ mkdir -p /home/USER/chroot/ryzom_squeeze64
 
$ mkdir -p /home/USER/chroot/ryzom_squeeze32
 
# debootstrap --arch amd64 squeeze /home/USER/chroot/ryzom_squeeze64 http://ftp.fr.debian.org/debian
 
# debootstrap --arch i386 squeeze /home/USER/chroot/ryzom_squeeze32 http://ftp.fr.debian.org/debian
 
  
!!The instruction are only for the 64 bits chroot, just change the path for the 32 bits one :)
+
Lines starting with a $ are meant to be run as a regular user, while lines starting with a # are meant to be run as root.
# chroot /home/USER/chroot/ryzom_squeeze64
 
## apt-get install wget nano locales dialog apt-utils
 
## dpkg-reconfigure locales
 
## nano /etc/apt/sources.list
 
It should look like this :
 
deb http://ftp.fr.debian.org/debian squeeze main contrib non-free
 
deb-src http://ftp.fr.debian.org/debian squeeze main contrib non-free
 
 
## apt-get update
 
## exit
 
# cp /etc/passwd/ /home/USER/chroot/ryzom_squeeze64/etc/
 
# sed 's/\([^:]*\):[^:]*:/\1:*:/' /etc/shadow | tee /home/USER/chroot/ryzom_squeeze64/etc/shadow
 
# cp /etc/group /home/USER/chroot/ryzom_squeeze64/etc/
 
# cp /etc/hosts /home/USER/chroot/ryzom_squeeze64/etc/
 
# chroot /home/USER/chroot/ryzom_squeeze64
 
## passwd
 
I recommend using the same password as the root on your system (i think the root's password is supposed to be copied, not sure why it don't work)
 
## exit
 
Now we have to mount some directory for our chroot :
 
# nano /etc/fstab
 
  
Add the following lines :
+
== Common steps ==
/proc /home/USER/chroot/ryzom_squeeze64/proc none rbind 0 0
+
=== Downloading ryzom dependencies ===
/dev /home/USER/chroot/ryzom_squeeze64/proc none rbind 0 0
 
/sys /home/USER/chroot/ryzom_squeeze64/proc none rbind 0 0
 
/tmp /home/USER/chroot/ryzom_squeeze64/proc none rbind 0 0
 
 
 
# mount -a
 
# chroot /home/USER/chroot/ryzom_squeeze64
 
## echo ryzom_squeeze64 >> /etc/debian_chroot
 
Create the HOME directory for you user :
 
## mkdir /home/USER
 
## chown USER:USER /home/USER
 
## exit
 
# nano /etc/schroot/schroot.conf
 
Add the following lines (make sure to change the "users=" line & directory line)
 
[ryzom_squeeze64]
 
description=Squeeze 64bits for ryzom
 
directory=/home/USER/chroot/ryzom_squeeze64
 
users=USER
 
groups=sbuild
 
root-users=USER
 
 
[ryzom_squeeze32]
 
description=Squeeze 32 bits for ryzom
 
directory=/home/USER/chroot/ryzom_squeeze32
 
users=USER
 
groups=sbuild
 
root-users=USER
 
personality=linux32
 
 
 
You can now use your chroot as a normal user, just type :
 
$ schroot -c ryzom_squeeze64
 
If you need to log as root, you can type :
 
$ schroot -c ryzom_squeeze64 -u root
 
 
 
Congratulations ! Your chroot are now working perfectly !
 
 
 
== Downloading ryzom dependencies ==
 
  
 
Tools needed to build the client :
 
Tools needed to build the client :
  ## apt-get install mercurial autoconf automake cmake libtool build-essential bison
+
  # apt install mercurial autoconf automake cmake libtool build-essential bison
 
Libraries needed :
 
Libraries needed :
  ## apt-get install libluabind-dev libfreetype6-dev libcurl4-openssl-dev libx11-dev \
+
  # apt install libluabind-dev libfreetype6-dev libcurl4-openssl-dev libx11-dev \
libgl1-mesa-dev libxxf86vm-dev libxrandr-dev libxrender-dev libopenal-dev \
+
libgl1-mesa-dev libxxf86vm-dev libxrandr-dev libxrender-dev libopenal-dev \
libogg-dev libvorbis-dev libxml2-dev libpng12-dev libjpeg-dev libxmu-dev
+
libogg-dev libvorbis-dev libxml2-dev libpng-dev libjpeg-dev libxmu-dev libssl-dev liblzma-devb
 
 
== Compiling ryzom dependencies ==
 
  
If you do a regular build of the client on Debian, you won't need this. If you want to build some of the tools and/or you couldn't install some of the packages, kervala created a repo with all the dependencies needed for ryzom.
+
If you are using debian jessie (or older), the CMake version in the repo is too old. You need to take it from jessie-backports (or, for earlier version, compile it yourself), for that, add to your /etc/apt/sources.list :
 +
deb http://ftp.debian.org/debian/ jessie-backports main
 +
Then, update & install :
 +
# apt update
 +
# apt install -t jessie-backports cmake
  
First, download all the code you need :
+
=== Getting ryzom code ===
#$ cd ~
 
#$ mkdir dep_ryzomcore && cd dep_ryzomcore
 
#$ hg clone http://hg.kervala.net/packaging
 
#$ hg clone http://hg.kervala.net/cmake
 
  
The compilation method will slightly depends, but it will probably look like one of those two examples (who are used to build the tools, not the client itself) :
+
  $ cd ~
libsquish :
+
  $ hg clone https://bitbucket.org/ryzom/ryzomcore
 
+
We just need to switch branch (very important)
#$ cd ~/dep_ryzomcore/
+
  $ cd ryzomcore
#$ export CMAKE_MODULE_PATH=$(pwd)/cmake/modules
+
  $ hg update -c compatibility-develop
#$ cd packaging/squish
 
#$ mkdir build && cd build
 
#$ cmake ..
 
#$ make
 
## make install
 
 
 
cpptest :
 
 
 
#$ cd ~/dep_ryzomcore/packaging/cpptest/
 
#$ sh ./autogen.sh
 
#$ ./configure
 
#$ make
 
## make install
 
 
 
Note : If you have trouble during the autogen.sh / configure part due to glibtoolize, find the following line (should be line 31) :
 
if glibtoolize --version &>/dev/null ; then
 
and replace it by :
 
  if hash glibtoolize 2>/dev/null ; then
 
 
 
== Compiling ryzom dependencies, static version specific ==
 
 
 
We need to build libopenal static :
 
#$ cd ~
 
  #$ mkdir libopenal && cd libopenal
 
#$ apt-get source libopenal1
 
#$ nano openal-soft-1.12.854-2/debian/rules
 
add this line "-DLIBTYPE=STATIC", after line 15, so you'll something like this :
 
                -DALSOFT_CONFIG=ON \
 
                -DLIBTYPE=STATIC \
 
 
 
 
 
## apt-get build-dep libopenal1
 
#$ cd openal-soft-1.12.854-2
 
#$ dpkg-buildpackage -rfakeroot -uc -b
 
Unfortunately the install isn't going well so we need to copy the static lib by hand :
 
##cp ~/libopenal/openal-soft-1.12.854-2/build-tree/libopenal.a /usr/lib
 
 
 
And now we need a static curl :
 
#$ cd ~
 
#$ mkdir libcurl && cd libcurl
 
I prefer to have the same curl version as my system (check apt-cache policy libcurl3 to have the info) but it shouldn't change much
 
#$ wget -c http://curl.haxx.se/download/curl-7.21.0.tar.bz2
 
#$ tar xjf curl-7.21.0.tar.bz2
 
#$ cd curl-7.21.0
 
#$ ./configure --disable-ldap --disable-ldaps --disable-rtsp --disable-dict --disable-ipv6 \
 
--disable-crypto-auth --disable-sspi --disable-tls-srp --without-gnutls --without-librtmp \
 
--without-libidn --disable-versioned-symbols --disable-pop3 --without-libssh2
 
#$ make
 
## make install
 
 
 
== Getting ryzom code ==
 
 
 
#$ cd ~
 
#$ hg clone https://bitbucket.org/ryzom/ryzomcore
 
We just need to switch branch (default to compatibility-develop)
 
  #$ cd ryzomcore
 
  #$ hg update -c compatibility-develop
 
  
 
If you need to update the code later, just type :
 
If you need to update the code later, just type :
  #$ hg pull && hg update
+
  $ hg pull && hg update
  
== Building Ryzom (static version) ==
+
== Dynamically linked version ==
  
#$ cd ~
+
=== Fix -fPic error ===
#$ mkdir build_static && cd build_static
 
use the following cmake options :
 
  
 +
As of 8 november 2016, there is an issue with linking openAL to ryzom_client ; you'll need to update the file code/CMakeModules/nel.cmake, find :
  
  #$ cmake -DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_NEL_TOOLS=OFF -DWITH_RYZOM_CLIENT=ON \
+
  IF(TARGET_X64 AND WITH_STATIC AND NOT WITH_STATIC_DRIVERS AND NOT MINGW)
-DWITH_RYZOM_SERVER=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_NEL=ON -DWITH_SOUND=ON -DWITH_DRIVER_OPENGL=ON \
+
  ADD_PLATFORM_FLAGS("-fPIC")
  -DWITH_DRIVER_OPENAL=ON -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_NEL_TESTS=OFF \
+
  ENDIF()
  -DWITH_LIBWWW_STATIC=ON -DOPENAL_LIBRARY=/usr/lib/libopenal.a -DOPENGL_gl_LIBRARY=/usr/lib/libGL.so \
+
   
-DWITH_STATIC_EXTERNAL=ON -DWITH_STLPORT=OFF -DCURL_LIBRARY=/usr/local/lib/libcurl.a ../ryzomcore/code
+
and replace it with (remove the "NOT" in "NOT WITH STATIC_DRIVERS")
 
 
The directory of libGL.so might change, depending on the strange things happenin in /usr/lib with the i386/ amd64 directory, check it before building.
 
 
 
Here, n is the number of core in your CPU :
 
#$ make -jn
 
 
 
== Building Ryzom (dynamically linked) ==
 
 
 
#$ cd ~
 
#$ mkdir build && cd build
 
  
For differents cmake options, see [[#CMake options]]. Here's the one i'm using :
+
IF(TARGET_X64 AND WITH_STATIC AND WITH_STATIC_DRIVERS AND NOT MINGW)
 +
  ADD_PLATFORM_FLAGS("-fPIC")
 +
ENDIF()
  
#$ cmake -DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_NEL_TOOLS=OFF -DWITH_RYZOM_SERVER=OFF \
+
=== Building ryzom ===
-DWITH_RYZOM_TOOLS=OFF -DWITH_QT=OFF -DWITH_RYZOM_CLIENT=ON ../ryzomcore/code
+
(Assuming you are in the ryzomcore folder you got in [[#Getting ryzom code]])
  
Here, n is the number of core in your CPU :
+
  $ cmake -DWITH_RYZOM_CLIENT=ON -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_DRIVER_OPENGL=ON -DWITH_QT=OFF -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_SERVER=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_SNOWBALLS=OFF -DWITH_NEL_TOOLS=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_RYZOM_PATCH=ON ../code
  #$ make -jn
 
The binary is now in bin/ryzom_client. You can't really use this one like that, because you need all the libs (libnel* + libryzom* that you just compiled, libwwwthat you compiled earlier). If you want to use this one, copy all the file in lib/ and all the file in /usr/local/lib in your system (/usr/local/lib for example). Easy (and clean) way to do that is to run the following command :
 
## make install
 
Will put all the needed file where they belong :) (ryzom_client will go to /usr/local/games)
 
  
== How do i use my client ? ==
+
Let's build ! replace n with the number of your cores
 +
$ make -jn ryzom_client
  
Very simple ! Just copy your ryzom_client executable (from your bin/ folder if it's static, or /usr/local/games if you built it dynamic way) to your ryzom folder. I recommend keeping the official ryzom_client and renaming yours, so you have a backup client in case of trouble !
+
=== Play ryzom ===
  
== Creating a package for ryzom ==
+
Copy the bin/ryzom_client executable in your ryzom folder (if you are using ryzom installer, it's in ~/.local/share/Ryzom/ryzom_live/). I recommend changing the file name to ryzom_client_compiled or something, or it will replace itself with a patched version everytime you run it (assuming you didn't disabled the patch at compilation), and change the executable your profile use (or directly change the value "client_filename_linux" in your server configuration, in ryzom_installer.ini)
TODO : pbuilder tutorial
 
  
== CMake options ==
+
That's it !
  
=== Option specific to RyzomCore ===
+
== Static version ==
  
*BUILD_DASHBOARD
 
*BOOST_DIR
 
*CMAKE_BUILD_TYPE
 
*CMAKE_CONFIGURATION_TYPES
 
*CMAKE_INSTALL_PREFIX
 
*CPPTEST_INCLUDE_DIR
 
*FINAL_VERSION - '''TRUE'''
 
*FREETYPE_ADDITIONAL_INCLUDE_DIR
 
*FREETYPE_INCLUDE_DIRS
 
*FREETYPE_LIBRARY
 
*JPEG_INCLUDE_DIR
 
*JPEG_LIBRARY
 
*LIBWWW_ADDITIONAL_INCLUDE_DIR
 
*LIBWWW_INCLUDE_DIR
 
*LUABIND_INCLUDE_DIR
 
*NL_BIN_PREFIX
 
*NL_DRIVER_PREFIX
 
*NL_ETC_PREFIX
 
*NL_LIB_PREFIX
 
*NL_SBIN_PREFIX
 
*NL_SHARE_PREFIX
 
*OGG_INCLUDE_DIR
 
*OGG_LIBRARY
 
*RYZOM_BIN_PREFIX
 
*RYZOM_ETC_PREFIX
 
*RYZOM_ETC_PREFIX
 
*RYZOM_GAMES_PREFIX
 
*RYZOM_LIB_PREFIX
 
*RYZOM_SBIN_PREFIX
 
*RYZOM_SHARE_PREFIX
 
*SQUISH_INCLUDE_DIR
 
*VORBISFILE_LIBRARY
 
*VORBIS_INCLUDE_DIR
 
*VORBIS_LIBRARY
 
*WITH_3D - '''TRUE'''
 
*WITH_COVERAGE
 
*WITH_DRIVER_DIRECT3D
 
*WITH_DRIVER_DSOUND
 
*WITH_DRIVER_FMOD
 
*WITH_DRIVER_OPENAL - '''TRUE'''
 
*WITH_DRIVER_OPENGL - '''TRUE'''
 
*WITH_DRIVER_OPENGLES
 
*WITH_DRIVER_XAUDIO2
 
*WITH_EXTERNAL
 
*WITH_GEORGES - '''TRUE'''
 
*WITH_GTK
 
*WITH_GUI - '''TRUE'''
 
*WITH_INSTALL_LIBRARIES - '''TRUE'''
 
*WITH_LIBWWW_STATIC
 
*WITH_LIGO - '''TRUE'''
 
*WITH_LOGGING - '''TRUE'''
 
*WITH_LOGIC - '''TRUE'''
 
*WITH_LUA51 - '''TRUE'''
 
*WITH_MFC
 
*WITH_NEL - '''TRUE'''
 
*WITH_NELNS
 
*WITH_NELNS_LOGIN_SYSTEM - '''TRUE'''
 
*WITH_NELNL_SERVER - '''TRUE'''
 
*WITH_NEL_CEGUI
 
*WITH_NEL_MAXPLUGIN
 
*WITH_NEL_SAMPLES - '''TRUE'''
 
*WITH_NEL_TESTS - '''TRUE'''
 
*WITH_NEL_TOOLS - '''TRUE'''
 
*WITH_NET - '''TRUE'''
 
*WITH_PACS - '''TRUE'''
 
*WITH_PCH - '''TRUE'''
 
*WITH_QT
 
*WITH_RYZOM - '''TRUE'''
 
*WITH_RYZOM_CLIENT - '''TRUE'''
 
*WITH_RYZOM_SERVER
 
*WITH_RYZOM_SOUND - '''TRUE'''
 
*WITH_RYZOM_TOOLS - '''TRUE'''
 
*WITH_SNOWBALLS
 
*WITH_SNOWBALLS_CLIENT - '''TRUE'''
 
*WITH_SNOWBALLS_SERVER - '''TRUE'''
 
*WITH_SOUND - '''TRUE'''
 
*WITH_STATIC
 
*WITH_STATIC_DRIVERS
 
*WITH_STATIC_EXTERNAL
 
*WITH_STLPORT
 
*WITH_SYMBOLS
 
*XF86VidMode_INCLUDE_DIR
 
*XF86_VidMode_LIBRARY
 
  
=== Generic option who might be useful ===
+
=== Compiling ryzom dependencies ===
  
TODO
+
Note : this is done on a debian jessie, debian stretch (and possibly sid) will have multiples issues with -fPic, needing you to recompile a shitton of library(openssl, gif, curl, almost anything really), so i recommend sticking with jessie.
  
=== Common option set to build a client ===
+
We just need to build curl ; Grab it from kervala's packaging repository :
 +
$ hg clone http://hg.kervala.net/packaging/
 +
$ cd packaging/curl
 +
$ mkdir build && cd build
 +
$ cmake -DCMAKE_BUILD_TYPE=Release -DCURL_ZLIB=ON -DBUILD_CURL_EXE=OFF -DBUILD_CURL_TESTS=OFF -DCURL_STATICLIB=ON -DHTTP_ONLY=ON -DENABLE_IPV6=ON -DCMAKE_USE_OPENSSL=ON -DOPENSSL_SSL_LIBRARIES=/usr/lib/libssl.a -DOPENSSL_CRYPTO_LIBRARIES=/usr/lib/libcrypto.a -DCMAKE_USE_LIBSSH2=OFF -DZLIB_LIBRARY=/usr/lib/libz.a ..
 +
$ make
 +
# make install
  
Standard client compilation :
+
=== Building Ryzom ===
#$ cmake -DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_NEL_TOOLS=OFF -DWITH_RYZOM_SERVER=OFF \
 
-DWITH_RYZOM_TOOLS=OFF -DWITH_QT=OFF -DWITH_RYZOM_CLIENT=ON ..
 
 
Static client compilation :
 
#$ cmake -DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_NEL_TOOLS=OFF -DWITH_RYZOM_CLIENT=ON \
 
-DWITH_RYZOM_SERVER=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_NEL=ON -DWITH_SOUND=ON -DWITH_DRIVER_OPENGL=ON \
 
-DWITH_DRIVER_OPENAL=ON -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_STLPORT=OFF -DWITH_NEL_TESTS=OFF \
 
-DWITH_LIBWWW_STATIC=ON -DOPENAL_LIBRARY=/usr/lib/libopenal.a -DOPENGL_gl_LIBRARY=/usr/lib/libGL.so \
 
-DWITH_STATIC_EXTERNAL=ON -DCURL_LIBRARY=/usr/local/lib/libcurl.a ..
 
 
Adding debugging symbols (useful if you want to run gdb) :
 
#$ cmake -DWITH_SYMBOLS=ON ALLOTHEROPTIONS ..
 
  
Debug mode (useful only if you are a dev ; it's a bad idea to use it if you aren't cause there is more crash + it's slower) :
+
(Assuming you are in the ryzomcore folder you got in [[#Getting ryzom code]])
  #$ cmake -DFINAL_VERSION=OFF -DCMAKE_BUILD_TYPE=Debug ALLOTHEROPTIONS ..
+
  $ mkdir build_static && cd build_static
== Auto-build script ==
+
(Cmake options are almost the same, we need to use our compiled curl library, and use static_external):
  
A simple script to build different (static) version of the client : [http://manda.glorf.fr/client/static_build]
+
Let's build ! replace n with the number of your cores
 +
$ make -jn ryzom_client
  
Another script to manage the built ryzom_client : launch a new build (both 64 & 32 bits) using my chroot, then saving everything and uploading it to my server : [http://manda.glorf.fr/client/chroot_static_build]
+
=== Further reading on static building ===
== Sources ==
 
For the chroot / static compilation, an excellent tutorial by shevek : [http://sevmek.free.fr/static/howto-ryzom2.0.txt]
 
  
For the client building & dependencies, the RyzomCore wiki page : [https://ryzomcore.atlassian.net/wiki/display/RC/Build+Source+on+Linux]
+
If you actually want to regularely build static ryzom client, you should check [[http://hg.kervala.net/packaging/file/5b4bf439aa91/ryzom/steam|kervala's scripts]], they are very complete and allow you to completely automate your build process.
  
For the chroot & client building : [http://sevmek.free.fr/static/howto-ryzom2.0.txt]
 
 
<references />
 
<references />
 
{{In_Category|Linux}}
 
{{In_Category|Linux}}

Revision as of 01:14, 9 November 2016

General

This page applies for Debian-based GNU/Linux distributions. It should work on other linux distribution too, but some package name might change. To compile Ryzom client under Mac OS X, please check this page : Building Ryzom Client under Mac OS X. For Archlinux, check Building Ryzom Client under Archlinux

If you are building the client for your own computer, build a dynamically linked version. If you are building it for other people, it's probably safer to build a statically linked version (note : you should use a distribution with a not too recent libc6, if you want it to work on as many platforms as possible. I recommend a debian Jessie, and doing that in a chroot or a VM).

Lines starting with a $ are meant to be run as a regular user, while lines starting with a # are meant to be run as root.

Common steps

Downloading ryzom dependencies

Tools needed to build the client :

# apt install mercurial autoconf automake cmake libtool build-essential bison

Libraries needed :

# apt install libluabind-dev libfreetype6-dev libcurl4-openssl-dev libx11-dev \

libgl1-mesa-dev libxxf86vm-dev libxrandr-dev libxrender-dev libopenal-dev \ libogg-dev libvorbis-dev libxml2-dev libpng-dev libjpeg-dev libxmu-dev libssl-dev liblzma-devb

If you are using debian jessie (or older), the CMake version in the repo is too old. You need to take it from jessie-backports (or, for earlier version, compile it yourself), for that, add to your /etc/apt/sources.list :

deb http://ftp.debian.org/debian/ jessie-backports main

Then, update & install :

# apt update
# apt install -t jessie-backports cmake

Getting ryzom code

$ cd ~
$ hg clone https://bitbucket.org/ryzom/ryzomcore

We just need to switch branch (very important)

$ cd ryzomcore
$ hg update -c compatibility-develop

If you need to update the code later, just type :

$ hg pull && hg update

Dynamically linked version

Fix -fPic error

As of 8 november 2016, there is an issue with linking openAL to ryzom_client ; you'll need to update the file code/CMakeModules/nel.cmake, find :

IF(TARGET_X64 AND WITH_STATIC AND NOT WITH_STATIC_DRIVERS AND NOT MINGW)
  ADD_PLATFORM_FLAGS("-fPIC")
ENDIF()

and replace it with (remove the "NOT" in "NOT WITH STATIC_DRIVERS")

IF(TARGET_X64 AND WITH_STATIC AND WITH_STATIC_DRIVERS AND NOT MINGW)
  ADD_PLATFORM_FLAGS("-fPIC")
ENDIF()

Building ryzom

(Assuming you are in the ryzomcore folder you got in #Getting ryzom code)

$ cmake -DWITH_RYZOM_CLIENT=ON -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_DRIVER_OPENGL=ON -DWITH_QT=OFF -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_SERVER=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_SNOWBALLS=OFF -DWITH_NEL_TOOLS=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_RYZOM_PATCH=ON ../code

Let's build ! replace n with the number of your cores

$ make -jn ryzom_client

Play ryzom

Copy the bin/ryzom_client executable in your ryzom folder (if you are using ryzom installer, it's in ~/.local/share/Ryzom/ryzom_live/). I recommend changing the file name to ryzom_client_compiled or something, or it will replace itself with a patched version everytime you run it (assuming you didn't disabled the patch at compilation), and change the executable your profile use (or directly change the value "client_filename_linux" in your server configuration, in ryzom_installer.ini)

That's it !

Static version

Compiling ryzom dependencies

Note : this is done on a debian jessie, debian stretch (and possibly sid) will have multiples issues with -fPic, needing you to recompile a shitton of library(openssl, gif, curl, almost anything really), so i recommend sticking with jessie.

We just need to build curl ; Grab it from kervala's packaging repository :

$ hg clone http://hg.kervala.net/packaging/
$ cd packaging/curl
$ mkdir build && cd build
$ cmake -DCMAKE_BUILD_TYPE=Release -DCURL_ZLIB=ON -DBUILD_CURL_EXE=OFF -DBUILD_CURL_TESTS=OFF -DCURL_STATICLIB=ON -DHTTP_ONLY=ON -DENABLE_IPV6=ON -DCMAKE_USE_OPENSSL=ON -DOPENSSL_SSL_LIBRARIES=/usr/lib/libssl.a -DOPENSSL_CRYPTO_LIBRARIES=/usr/lib/libcrypto.a -DCMAKE_USE_LIBSSH2=OFF -DZLIB_LIBRARY=/usr/lib/libz.a ..
$ make
# make install 

Building Ryzom

(Assuming you are in the ryzomcore folder you got in #Getting ryzom code)

$ mkdir build_static && cd build_static

(Cmake options are almost the same, we need to use our compiled curl library, and use static_external):

Let's build ! replace n with the number of your cores

$ make -jn ryzom_client

Further reading on static building

If you actually want to regularely build static ryzom client, you should check [scripts], they are very complete and allow you to completely automate your build process.


5 pages in Linux

Ryzom Wiki: Ryzom Commons | DE • EN • ESFRRU | Ryzom Forge