Difference between revisions of "Building Ryzom Client On Debian"

From Ryzom Forge Wiki

Jump to: navigation, search
m (Glorf moved page Building Ryzom Client to Building Ryzom Client On Debian: Title was confusing)
 
(32 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{tabLang|EN|DE|{{FULLPAGENAME}}|ES|FR|RU}}
+
{{migrated to|:en:Building Ryzom Client On Debian}}
 
 
{{ToTrad|DE|DE translation needed please}}
 
{{ToTrad|ES|ES translation needed please}}
 
{{ToTrad|FR|FR translation needed please}}
 
 
 
 
== General ==
 
== General ==
  
This page applies for Debian-based GNU/Linux distributions. To compile Ryzom client under Mac OS X, please check this page : [[Building Ryzom Client under Mac OS X]]
 
 
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
 
 
== Setting up the chroot ==
 
 
Don't forget to change USER by your username or it won't work :p
 
# apt-get install debootstrap dchroot
 
$ mkdir /home/USER/chroot/ryzom_squeeze64
 
$ mkdir /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 :)
 
# 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 :
 
/proc /home/USER/chroot/ryzom_squeeze64/proc none rbind 0 0
 
/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 ryzomm_squeeze64 >> /etc/debian_chroot
 
## 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-groups=root
 
 
[ryzom_squeeze32]
 
description=Squeeze 32 bits for ryzom
 
directory=/home/USER/chroot/ryzom_squeeze32
 
users=USER
 
groups=sbuild
 
root-groups=root
 
personality=linux32
 
 
You can now use your chroot as a normal user, just type :
 
$ dchroot -c ryzom_squeeze64
 
You won't have a ~ the first time you log in, just create it
 
#$ su -
 
## mkdir /home/USER
 
## chown USER:USER /home/USER
 
## exit
 
 
Congratulations ! Your chroot are now working perfectly !
 
 
== Downloading ryzom dependencies ==
 
 
 
## apt-get install mercurial libluabind-dev libfreetype6-dev libx11-dev libgl1-mesa-dev libxxf86vm-dev \
 
  libxrandr-dev libxrender-dev libopenal-dev libogg-dev libvorbis-dev libxml2-dev cmake build-essential \
 
  libpng12-dev libjpeg62-dev rrdtool libmysqlclient15-dev bison libxmu-dev autoconf automake libtool
 
== Compiling ryzom dependencies ==
 
 
You can probably download some of this libs but since there is often problems with them, i prefer to compile them myself :)
 
First, download all the code you need :
 
#$ cd ~
 
#$ mkdir dep_ryzomcore && cd dep_ryzomcore
 
#$ hg clone http://hg.kervala.net/packaging
 
#$ hg clone http://hg.kervala.net/cmake
 
#$ export CMAKE_MODULE_PATH=$(pwd)/cmake/modules
 
 
Luabind :
 
 
#$ cd packaging/luabind
 
#$ mkdir build && cd build
 
#$ cmake -DWITH_STATIC=ON ..
 
#$ make
 
## make install
 
 
libwww-dev :
 
 
#$ cd ~/dep_ryzomcore/libwww
 
#$ ./autogen.sh
 
#$ ./configure --with-ssl=no --with-zlib --with-expat --with-gnu-ld --enable-shared
 
#$ make
 
## make install
 
If you want to create packages for ryzom, see [[#Creating a package for libwww]]
 
 
libsquish :
 
 
#$ cd ~/dep_ryzomcore/
 
#$ export CMAKE_MODULE_PATH=$(pwd)/cmake/modules
 
#$ cd packaging/squish
 
#$ mkdir build && cd build
 
#$ cmake ..
 
#$ make
 
## make install
 
 
cpptest :
 
 
#$ cd ~/dep_ryzomcore/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) :
+
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 On Mac OS X]]. For Archlinux, check [[Building Ryzom Client On Archlinux]]
if glibtoolize --version &>/dev/null ; then
 
and replace it by :
 
if hash glibtoolize 2>/dev/null ; then
 
  
== Compiling ryzom dependencies, static version specific ==
+
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).
  
We need to build libopenal static :
+
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.
#$ 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 \
 
  
 +
== Common steps ==
 +
=== Downloading ryzom dependencies ===
  
  ## apt-get build-dep libopenal1
+
Tools needed to build the client :
  #$ cd openal-soft-1.12.854-2
+
  # apt install mercurial autoconf automake cmake libtool build-essential bison
  #$ dpkg-buildpackage -rfakeroot -uc -b
+
Libraries needed :
Unfortunately the install isn't going well so we need to copy the static lib by hand :
+
  # apt install libluabind-dev libfreetype6-dev libcurl4-openssl-dev libx11-dev \
  ##cp ~/libopenal/openal-soft-1.12.854-2/build-tree/libopenal.a /usr/lib
+
  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-dev
  
And now we need a static curl :
+
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 than jessie, compile it yourself), for that, add to your /etc/apt/sources.list :
#$ cd ~
+
  deb http://ftp.debian.org/debian/ jessie-backports main
#$ mkdir libcurl && cd libcurl
+
Then, update & install :
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
+
  # apt update
  #$ wget -c http://curl.haxx.se/download/curl-7.21.0.tar.bz2
+
  # apt install -t jessie-backports cmake
#$ 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 ==
+
=== Getting ryzom code ===
  
  #$ cd ~
+
  $ cd ~
  #$ hg clone https://bitbucket.org/ryzom/ryzomcore
+
  $ hg clone https://bitbucket.org/ryzom/ryzomcore
We just need to switch branch (default to compatibility)
+
We just need to switch branch (very important)
  #$ cd ryzomcore
+
  $ cd ryzomcore
  #$ hg update -c compatibility
+
  $ 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 ~
+
=== Building ryzom ===
#$ mkdir build_static && cd build_static
+
(Assuming you are in the ryzomcore folder you got in [[#Getting ryzom code]])
use the following cmake options :
 
  
 +
$ 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
  
  #$ cmake -DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_NEL_TOOLS=OFF -DWITH_RYZOM_CLIENT=ON \
+
Let's build ! replace n with the number of your cores
-DWITH_RYZOM_SERVER=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_NEL=ON -DWITH_SOUND=ON -DWITH_DRIVER_OPENGL=ON \
+
  $ make -jn ryzom_client
-DWITH_DRIVER_OPENAL=ON -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -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 -DWITH_STLPORT=OFF -DCURL_LIBRARY=/usr/local/lib/libcurl.a ../ryzomcore/code
 
  
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.
+
=== Play ryzom ===
  
Here, n is the number of core in your CPU :
+
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)
#$ make -jn
 
  
== Building Ryzom (dynamically linked) ==
+
That's it !
  
#$ cd ~
+
== Static version ==
#$ mkdir build && cd build
 
  
For differents cmake options, see [[#CMake options]]. Here's the one i'm using :
 
  
#$ cmake -DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_NEL_TOOLS=OFF -DWITH_RYZOM_SERVER=OFF \
+
=== Compiling ryzom dependencies ===
-DWITH_RYZOM_TOOLS=OFF -DWITH_QT=OFF -DWITH_RYZOM_CLIENT=ON ../ryzomcore/code
 
  
If you are having trouble with cmake who can't find LIBWWW_INCLUDE_DIR, it's probably because the make install of libwww put everything in a subfolder of /usr/local/include and cmake doesn't seems to find it. Easiest way to solve it is : (the path may change a little on your computer)
+
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.
## cd /usr/local/include/-package/
 
## mv * ..
 
Then run cmake again
 
Here, n is the number of core in your CPU :
 
#$ 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, libwww+libsquish+libcpptest+libluabind that 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).
 
Also see building a package later, this building method is the best to do that :)
 
  
== Creating a package for ryzom ==
+
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
  
This method of creating a package is NOT the best, but it's the easiest IMO. You will need fakeroot, installed using apt :
+
=== Building Ryzom ===
## apt-get install checkinstall fakeroot
 
Then, let's get back to our new build of ryzom :
 
## cd ~/build
 
## checkinstall make install
 
Answer "y" to the documentation question, don't bother giving a description or change the different variable (maintainer, summary ...) we'll go back to that later. If checkinstall asks you something about file created inside the home directory, exclude them from the package.
 
First thing to do is to remove the package from your system :
 
## dpkg -r build
 
Then we are going to work on the package itself (the .deb will probably change on your system, don't worry about it). Not sure
 
## cp build_20140826-1_amd64.deb /tmp/tmp_package.deb
 
## chown USER:USER /tmp/tmp_package.deb
 
#$ cd /tmp
 
#$ mkdir package && cd package
 
This command create the DEBIAN (where all the metadata about the package are) :
 
#$ dpkg-deb -e ../tmp_package.deb
 
This command extract the files of the package :
 
#$ dpkg-deb -x ../tmp_package.deb .
 
  
Now we are going to select which file we are going to keep, and where we put them. You just have to remove / move the files inside the usr/ directory created by the dpkg-deb -x command (so it will be like /tmp/package/usr/PATH/TO/YOUR/FILE).
+
(Assuming you are in the ryzomcore folder you got in [[#Getting ryzom code]])
For my example, i have the following hierarchy :
+
$ mkdir build_static && cd build_static
usr/
+
(Cmake options are almost the same, we need to use our compiled curl library, and use static_external):  
local/
 
bin/
 
nel-config
 
etc/
 
ryzom/
 
client_default.cfg
 
games/
 
ryzom_client
 
include/
 
nel/
 
lot of directory/
 
lib/
 
libnel*.so [not gonna put them all]
 
nel/
 
libnel_drv_openal.so
 
libnel_drv_opengl.so
 
pkgconfig/
 
*.pc files
 
share/
 
applications/
 
ryzom_client.desktop
 
icons/
 
hicolor/
 
Different_resolution folders/
 
apps/
 
ryzom_client.png
 
pixmaps/
 
ryzom_client.png
 
ryzom_client.xpm
 
  
I don't want the bin/ directory (i don't need this executable), so i remove it from the package. The lib/ & include/ directory is cool but i decided to have 2 different packages, one for the lib and one for the client, so we are going to save this folders for now. Finally, the etc/ & games/ are really needed so we keep them, and share/ is pretty useful so same here.
+
Let's build ! replace n with the number of your cores
So it gives me the following commands :
+
  $ make -jn ryzom_client
  #$ cd usr/local/
 
#$ rm -R bin/ include/
 
#$ mkdir /tmp/package_lib/ && mkdir /tmp/package_lib/usr/ && mkdir /tmp/package_lib/usr/local/
 
#$ mv lib/ /tmp/package_lib/usr/local/
 
#$ mv include /tmp/package_lib/usr/local/
 
  
Our hierarchy is now complete (note that if you want to do a package to install on every system it's highly recommended to remove the local/ from your hierarchy so all your file goes inside usr/ and not usr/local/ which is supposed to be used ONLY for local things such as ... compiled stuff !), we are going to check all the metadata of our package :
+
=== Further reading on static building ===
#$ cd /tmp/package/DEBIAN/
 
#$ ls
 
conffiles control
 
The interesting file here is the control one. We can remove the conffiles one :
 
#$rm conffiles
 
Here's my control file after my compilation :
 
  
Package: build
+
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.
Priority: extra
 
Section: checkinstall
 
Installed-Size: 38568
 
Maintainer: root@ssd-bisous
 
Architecture: amd64
 
Version: 20140826-1
 
Depends:
 
Provides: build
 
Conflicts:
 
Replaces:
 
Description: Package created with checkinstall 1.6.2
 
  
Most of the information here are obvious, the interesting lines here is Depends : all the dependencies of our package ! A rapid ldd helps us build this depends list. It's gonna be for us [i didn't put any version check on this dependencies, it's probably needed but i'll need to look more into it]
 
 
Depends: libnel, libwww, libluabind0.9.1|libluabind0.9.2, libxml2, liblua5.1-0, libcurl3, zlib1g, \
 
libstdc++6, libc6, libgcc1, liblzma5, libidn11, librtmp0, libssh2-1, libssl1.0.0, libgssapi-krb5-2, \
 
libk5crypto3, libcomerr2, libldap-2.4-2, libgnutls26, libgcrypt11, libkrb5support0, libkeyutils1, \
 
libsasl2-2, libtasn1-3, libp11-kit0, libgpg-error0
 
 
All the packages in Depends: should be available with apt-get, except the first two one, libnel & libwww, that we are going to create ourself. For libnel it'll be the lib/ folder we saved earlier, for libwww see "creating a package for libwww".
 
 
 
After some other modifications (removed useless line, changed some of them), i have the follow CONTROL file.
 
For the version i use 2.1.0 (current version of the official client) + the commit nummber of the code i used.
 
For installed-size, run the following command :
 
#$ du -sx --exclude DEBIAN /tmp/package/
 
 
Package: ryzom
 
Version: 2.1.0.af0636c-debian
 
Architecture: amd64
 
Bugs: http://dev.ryzom.com/projects/ryzom/issues
 
Maintainer: glorf@glorf.fr
 
Installed-Size: 10860
 
Depends: libnel, libwww, libluabind0.9.1|libluabind0.9.2, libxml2, liblua5.1-0, libcurl3, zlib1g, \
 
libstdc++6, libc6, libgcc1, liblzma5, libidn11, librtmp0, libssh2-1, libssl1.0.0, libgssapi-krb5-2, \
 
libk5crypto3, libcomerr2, libldap-2.4-2, libgnutls26, libgcrypt11, libkrb5support0, libkeyutils1, \
 
libsasl2-2, libtasn1-3, libp11-kit0, libgpg-error0
 
Section: games
 
Priority: extra
 
Homepage: http://ryzom.com
 
Description: Dynamic client for the Ryzom game !
 
 
Now we just need to add the md5sums of all the file (so dpkg can check if there was no data corrupted while downloading for example) :
 
#$ cd /tmp/package
 
#$ find . -type f ! -regex '.*.hg.*' ! -regex '.*?debian-binary.*' ! -regex '.*?DEBIAN.*' -printf '%P ' | xargs md5sum > DEBIAN/md5sums
 
finally, we have to do the package
 
#$ dpkg-deb -b . ../ryzom-2.1.0_amd64.deb
 
You have your final package, in /tmp/ryzom-2.1.0_amd64.deb (you should save it asap :p)
 
 
 
BUT it's not over yet, cause we have to make a package for libnel. We have all the file in /tmp/package_lib/usr/local/lib/, so it's gonna be easy
 
#$ cd /tmp/package_lib/
 
#$ mkdir DEBIAN/
 
Change the hierarchy of the files if you want, at the moment it's
 
usr/
 
local/
 
lib/
 
AllMyLib.so
 
include/
 
allmyinclude.h
 
I'll keep it cause i find it okay, so i only have to bothers about DEBIAN/control :
 
The version is based on ryzomCore versionning (at the time we are using 0.9.0)
 
#$ nano DEBIAN/control
 
Package: libnel
 
Priority: extra
 
Section: lib
 
Installed-Size: 27700
 
Maintainer: glorf@glorf.fr
 
Architecture: amd64
 
Version: 0.9.0-af0636c
 
Provides: libnel
 
Description: libnel for ryzom (contains lib and include)
 
 
Same here, installed-size given by the following command :
 
#$ du -sx --exclude DEBIAN /tmp/package_lib/
 
And now we create our package :
 
#$ cd /tmp/package_lib/
 
#$ find . -type f ! -regex '.*.hg.*' ! -regex '.*?debian-binary.*' ! -regex '.*?DEBIAN.*' -printf '%P ' | xargs md5sum > DEBIAN/md5sums
 
#$ dpkg-deb -b . ../libnel-0.9.0_amd64.deb
 
 
Tada ! It's all ok !
 
The package is far from being perfect ; a good way to make it better is to add pre/post inst/rm script, which are bash script executed at the installation/suppression of the package, but i won't explain it further (there is plenty of information on the internet).
 
If you want to install your package, make sure to install libnel & libwww before you install ryzom, so for example it could be something like that.
 
# dpkg -i libnel-0.9.0_amd64.deb libwww-5.4.0-11_amd64.deb
 
# dpkg -i ryzom-2.1.0_amd64.deb
 
 
== Creating a package for libwww ==
 
 
Not gonna explain much, if you want to understand how it works check "Creating a package for ryzom" part.
 
So we are after our make install of libwww, for context.
 
## cd /home/USER/dep_ryzomcore/packaging/libwww
 
## checkinstall make install
 
Just change the version to a random integer if you have a warning or you won't be able to finish the package build
 
## dpkg -r libwww
 
## cp libwww_1-1_amd64.deb /tmp/tmp_libwww.deb
 
## chown USER:USER /tmp/tmp_libwww.deb
 
#$ cd /tmp
 
#$ mkdir package_www/ && cd package_www
 
#$ dpkg-deb -e ../tmp_libwww.deb
 
#$ dpkg-deb -x ../tmp_libwww.deb .
 
I'm just going to put all the include miscorrectly placed in usr/local/include/-package/ in usr/local/include & remove the bin folder
 
#$ cd /tmp/package_www/usr/local/include/-package/
 
#$ mv * ..
 
#$ cd /tmp/package_www/
 
#$ rm /tmp/package_www/usr/local/include/-package/
 
#$ rm -R usr/local/bin/
 
#$ nano DEBIAN/control
 
 
Package: libwww
 
Priority: extra
 
Section: lib
 
Installed-Size: 7540
 
Maintainer: glorf@glorf.fr
 
Architecture: amd64
 
Version: 5.4.0-11
 
Provides: libwww
 
Description: libwww is a lib you need to compile & use ryzom
 
 
#$ find . -type f ! -regex '.*.hg.*' ! -regex '.*?debian-binary.*' ! -regex '.*?DEBIAN.*' -printf '%P ' | xargs md5sum > DEBIAN/md5sums
 
#$ dpkg-deb -b . ../libwww-5.4.0-11_amd64.deb
 
Make sure to install this package to have everything you need to compile here.
 
 
== CMake options ==
 
 
=== Option specific to RyzomCore ===
 
 
*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 ===
 
 
TODO
 
 
=== Common option set to build a client ===
 
 
Standard client compilation :
 
#$ 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) :
 
#$ cmake -DFINAL_VERSION=OFF -DCMAKE_BUILD_TYPE=Debug ALLOTHEROPTIONS ..
 
== Auto-build script ==
 
 
A simple script to build different (static) version of the client : [http://manda.glorf.fr/client/static_build]
 
 
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]
 
== 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]
 
 
<references />
 
<references />
 
+
{{In_Category|Linux}}
{{TPInWikiRyzom}}
+
{{TPInWikiRyzom‎}}
[[Category:Tutorials]][[Category:EN]]
+
[[Category:Support]]
 +
[[Category:Linux]]
 +
[[Category:EN]]

Latest revision as of 19:15, 25 June 2018

Migration

Please use the migrated document at URL shown below.

Migrated to en:Building Ryzom Client On Debian at 2018-06-25

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 On Mac OS X. For Archlinux, check Building Ryzom Client On 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-dev

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 than jessie, 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

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