Difference between revisions of "Building Ryzom Client On Mac OS X"

From Ryzom Forge Wiki

Jump to: navigation, search
m
(Installing and configuring Xcode)
 
(21 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 +
{{migrated to|:en:Building Ryzom Client On Mac OS X}}
 
{{tabLang|EN|Mac OS XDE|Building Ryzom Client under Mac OS X|Mac OS XES|Mac OS XFR|Mac OS XRU}}
 
{{tabLang|EN|Mac OS XDE|Building Ryzom Client under Mac OS X|Mac OS XES|Mac OS XFR|Mac OS XRU}}
  
Line 14: Line 15:
 
  xcode-select --install
 
  xcode-select --install
  
Ryzom client needs at least Mac OS X 10.6. If you plan to deploy Ryzom on Mac OS X versions older than your current one (but more recent than 10.6), I suggest you to set MACOSX_DEPLOYMENT_TARGET environment variable before compiling any dependencies :
+
Ryzom client needs at least Mac OS X 10.8. If you plan to deploy Ryzom on Mac OS X versions older than your current one (but more recent than 10.8), I suggest you to set MACOSX_DEPLOYMENT_TARGET environment variable before compiling any dependencies :
  
  export MACOSX_DEPLOYMENT_TARGET=10.6
+
  export MACOSX_DEPLOYMENT_TARGET=10.8
  
 
And append that line to '''~/.bash_profile''' to be sure it'll be defined later.
 
And append that line to '''~/.bash_profile''' to be sure it'll be defined later.
Line 23: Line 24:
  
 
To install all 3rd party libraries needed by Ryzom, you'll need to download and install MacPorts from : https://www.macports.org/install.php
 
To install all 3rd party libraries needed by Ryzom, you'll need to download and install MacPorts from : https://www.macports.org/install.php
 +
 +
First install tools that doesn't require support for older OS X versions :
 +
 +
sudo port install mercurial p7zip cmake
  
 
By default, it'll target your Mac OS X version. To change the target, type :
 
By default, it'll target your Mac OS X version. To change the target, type :
Line 30: Line 35:
 
And append at the end of the file :
 
And append at the end of the file :
  
  macosx_deployment_target 10.6
+
  macosx_deployment_target 10.8
  cxx_stdlib libstdc++
+
  cxx_stdlib libc++
  
 
Press CTRL+X / Apple+X to save and confirm.
 
Press CTRL+X / Apple+X to save and confirm.
Line 37: Line 42:
 
Then open a terminal and type :
 
Then open a terminal and type :
  
  sudo port install mercurial p7zip cmake curl freetype jpeg libwww libxml2 lua zlib libpng libogg
+
  sudo port install curl freetype jpeg libxml2 lua zlib libpng libogg giflib
 
  sudo port -s -v install boost libvorbis icu
 
  sudo port -s -v install boost libvorbis icu
  
Line 46: Line 51:
 
Open a terminal and write the following lines :
 
Open a terminal and write the following lines :
  
  hg clone http://hg.kervala.net/packaging
+
  hg clone http://hg.kervala.net/luabind
 
  hg clone http://hg.kervala.net/cmake
 
  hg clone http://hg.kervala.net/cmake
  
 
  export CMAKE_MODULE_PATH=$(pwd)/cmake/modules
 
  export CMAKE_MODULE_PATH=$(pwd)/cmake/modules
  
  cd packaging/luabind
+
  cd luabind
 
  mkdir build
 
  mkdir build
 
  cd build
 
  cd build
  cmake -DWITH_STATIC=ON -G "Unix Makefiles" ..
+
  cmake -DWITH_STATIC=ON -DWITH_SHARED=OFF -DWITH_LUA53=ON -DWITH_LUA51=OFF ..
 
  make
 
  make
 
  sudo make install
 
  sudo make install
  cd ../../..
+
  cd ../..
  
 
Luabind will be installed in /usr/local and should not conflict with MacPorts or system files.
 
Luabind will be installed in /usr/local and should not conflict with MacPorts or system files.
Line 65: Line 70:
 
For first time, please type :
 
For first time, please type :
  
  hg clone -b compatibility https://bitbucket.org/ryzom/ryzomcore
+
  hg clone -b compatibility-develop https://bitbucket.org/ryzom/ryzomcore
  
 
Later, to only update sources you will need to type :
 
Later, to only update sources you will need to type :
Line 78: Line 83:
 
  mkdir build
 
  mkdir build
 
  cd build
 
  cd build
  cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON \
+
  cmake -DCMAKE_BUILD_TYPE=Release -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON \
 
  -DWITH_NEL_TOOLS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_SERVER=OFF \
 
  -DWITH_NEL_TOOLS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_SERVER=OFF \
  -DWITH_RYZOM_TOOLS=OFF -DWITH_STATIC_EXTERNAL=ON ../code
+
  -DWITH_RYZOM_TOOLS=OFF -DWITH_STATIC_EXTERNAL=ON -DWITH_LUA53=ON -DWITH_LUA51=OFF -DWITH_RYZOM_PATCH=ON ../code
 
  make
 
  make
  
If you already installed Ryzom from Mac AppStore, you can append this parameter to copy data files from it : -DRYZOM_DATA_DIR=/Applications/Ryzom.app/Contents/Resources/data
+
The resulting application bundle will be '''bin/Ryzom.app''' and you should copy data to : Ryzom.app/Contents/Resources/data.
 
 
The resulting application bundle will be '''bin/Ryzom.app'''
 
 
 
If you're using data from AppStore Ryzom client, you'll need to patch some files (to support Lua 5.2 for example) with RSYNC :
 
 
 
rsync -rtzv --progress --stats www.ryzom.com::ryzom/data/ bin/Ryzom.com/Contents/Resources/data
 
  
 
The application '''Ryzom''' (Ryzom.app folder in fact) should do around 6 GB, you can launch it double-clicking on the icon.
 
The application '''Ryzom''' (Ryzom.app folder in fact) should do around 6 GB, you can launch it double-clicking on the icon.
  
== Ryzom update script ==
+
Ryzom will patch itself when launched.
  
If you need to distribute the application without data, you can create a '''ryzom_update''' script :
+
== Compilation errors or warnings ==
  
 +
If you get errors like :
 
<pre>
 
<pre>
#!/bin/sh
+
error: target Objective-C runtime differs in PCH file vs. current file
 
+
error: PCH file was compiled for the target 'x86_64-apple-macosx10.11.0' but the
BASE_DIR=$(dirname $0)
+
current translation unit is being compiled for target
+
'x86_64-apple-macosx10.8.0'
cd $BASE_DIR
+
</pre>
 
SRC_DATA_DIR=
 
DST_DATA_DIR=
 
 
if [ ! -d Ryzom.app/Contents/Resources/data ]
 
then
 
  echo "You must launch ryzom_update.sh from the same folder as Ryzom.app"
 
  exit 1
 
fi
 
  
DST_DATA_DIR=Ryzom.app/Contents/Resources/data
+
You just need to delete compilation files with :
  
echo "Checking if Ryzom is installed from Mac AppStore..."
+
<pre>make clean</pre>
  
if [ -e Ryzom.app/Contents/Resources/data/gamedev.bnp ]
+
If you get warnings like :
then
 
  echo "Data files already there"
 
else
 
  echo "Data files are missing"
 
 
 
  if [ -e /Applications/Ryzom.app/Contents/MacOS/ryzom_client ]
 
  then
 
    SRC_DATA_DIR=/Applications/Ryzom.app/Contents/Resources/data
 
 
 
    echo "Copying files..."
 
    cp -R -n -p $SRC_DATA_DIR/* $DST_DATA_DIR
 
  else
 
    if [ ! -f ryzom_client.7z ] && [ ! -d ryzom ]
 
    then
 
      echo "Downloading Ryzom client data from SourceForge..."
 
      wget -c http://sourceforge.net/projects/ryzom/files/ryzom_client.7z -O ryzom_client.7z
 
    fi
 
 
 
    if [ ! -d ryzom ]
 
    then
 
      echo "Extracting ryzom_client.7z..."
 
      7z x ryzom_client.7z
 
    fi
 
 
 
    SRC_DATA_DIR=$(pwd)/ryzom/data
 
 
 
    echo "Moving files..."
 
    mv -n $SRC_DATA_DIR/* $DST_DATA_DIR
 
 
 
    rm -rf ryzom
 
    echo "Please manually delete ryzom_client.7z"
 
  fi
 
fi
 
 
 
echo "Updating files..."
 
rsync -rtzv --progress --stats www.ryzom.com::ryzom/data/ $DST_DATA_DIR
 
</pre>
 
  
Don't forget to make this script executable with :
+
<pre>ld: warning: object file (/opt/local/lib/libz.a(trees.o)) was built for newer OSX version (10.11) than being linked (10.7)</pre>
  
chmod +x ryzom_update
+
You need to recompile these libraries with :
  
To create a ZIP file with Ryzom and update script, you can type :
+
<pre>sudo port upgrade -n -s --force zlib</pre>
  
cd bin
+
(you can replace '''zlib''' with the real library)
zip -9 -r ../ryzom_2.1.0.zip *
 
  
 
{{In_Category|Mac}}
 
{{In_Category|Mac}}
 
{{TPInWikiRyzom}}
 
{{TPInWikiRyzom}}
 
[[Category:Tutorials]] [[Category:Support]] [[Category:Mac]] [[Category:EN]]
 
[[Category:Tutorials]] [[Category:Support]] [[Category:Mac]] [[Category:EN]]

Latest revision as of 22:30, 9 November 2018

Migration

Please use the migrated document at URL shown below.

Migrated to en:Building Ryzom Client On Mac OS X at 2018-11-09

Flag-DE

Übersetzung , bitte.

Flag-ES

Traducción, por favor.

Flag-FR

Traduction, SVP.

Flag-RU

перевод, пожалуйста.


Installing and configuring Xcode

Last Xcode version can be downloaded from Mac AppStore or https://developer.apple.com/xcode/downloads/

To enable command-line tools under Xcode 5 or more recent versions, you'll need to open a terminal and type :

xcode-select --install

Ryzom client needs at least Mac OS X 10.8. If you plan to deploy Ryzom on Mac OS X versions older than your current one (but more recent than 10.8), I suggest you to set MACOSX_DEPLOYMENT_TARGET environment variable before compiling any dependencies :

export MACOSX_DEPLOYMENT_TARGET=10.8

And append that line to ~/.bash_profile to be sure it'll be defined later.

Installing and configuring MacPorts

To install all 3rd party libraries needed by Ryzom, you'll need to download and install MacPorts from : https://www.macports.org/install.php

First install tools that doesn't require support for older OS X versions :

sudo port install mercurial p7zip cmake

By default, it'll target your Mac OS X version. To change the target, type :

sudo nano /opt/local/etc/macports/macports.conf

And append at the end of the file :

macosx_deployment_target 10.8
cxx_stdlib libc++

Press CTRL+X / Apple+X to save and confirm.

Then open a terminal and type :

sudo port install curl freetype jpeg libxml2 lua zlib libpng libogg giflib
sudo port -s -v install boost libvorbis icu

Note : The -s option is used to force a rebuild from source (to take into account the new options added to macports.conf) else it'll use a precompiled package. ICU will be used if you need to compile a static version of Qt.

Compiling Luabind

Open a terminal and write the following lines :

hg clone http://hg.kervala.net/luabind
hg clone http://hg.kervala.net/cmake
export CMAKE_MODULE_PATH=$(pwd)/cmake/modules
cd luabind
mkdir build
cd build
cmake -DWITH_STATIC=ON -DWITH_SHARED=OFF -DWITH_LUA53=ON -DWITH_LUA51=OFF ..
make
sudo make install
cd ../..

Luabind will be installed in /usr/local and should not conflict with MacPorts or system files.

Downloading Ryzom code

For first time, please type :

hg clone -b compatibility-develop https://bitbucket.org/ryzom/ryzomcore

Later, to only update sources you will need to type :

hg pull && hg update

Compiling Ryzom client

This section shows how to create a static Ryzom Core client built on Mac OS X. The resulting binary only depends on system libs, therefore can be moved easily to another Mac OS X machine. The given list of CMake options is just an example. For a complete list see: CMake Options. Building a Ryzom Core client that depends on NeL and Ryzom shared libraries is strongly discouraged.

cd ryzomcore
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON \
-DWITH_NEL_TOOLS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_SERVER=OFF \
-DWITH_RYZOM_TOOLS=OFF -DWITH_STATIC_EXTERNAL=ON -DWITH_LUA53=ON -DWITH_LUA51=OFF -DWITH_RYZOM_PATCH=ON ../code
make

The resulting application bundle will be bin/Ryzom.app and you should copy data to : Ryzom.app/Contents/Resources/data.

The application Ryzom (Ryzom.app folder in fact) should do around 6 GB, you can launch it double-clicking on the icon.

Ryzom will patch itself when launched.

Compilation errors or warnings

If you get errors like :

error: target Objective-C runtime differs in PCH file vs. current file
error: PCH file was compiled for the target 'x86_64-apple-macosx10.11.0' but the
current translation unit is being compiled for target
'x86_64-apple-macosx10.8.0'

You just need to delete compilation files with :

make clean

If you get warnings like :

ld: warning: object file (/opt/local/lib/libz.a(trees.o)) was built for newer OSX version (10.11) than being linked (10.7)

You need to recompile these libraries with :

sudo port upgrade -n -s --force zlib

(you can replace zlib with the real library)


3 pages in Mac

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