DarkRadiant - Compiling in macOS: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
TODO
{{infobox|text=Note that Mac OS X support is kind of experimental at this stage. If you are able to help in this area, please stop by in the [http://forums.thedarkmod.com/ forums].}}
 
At the current point there's no Bundle or Installer for DarkRadiant yet, so one needs to compile the application themselves. The following info has been gathered in OS X El Capitan. Depending on your OS X version the steps might differ a bit.
 
== Install XCode ==
In my case I went with an XCode version that was supported in El Capitan, which happened to be XCode 7.1. I think you're able to obtain this through the App Store, but there are dmg files floating available for download as well. The XCode installation will give you the necessary C++ compilers and libraries.
 
== Install MacPorts ==
DarkRadiant depends on a couple of open source libraries that are not available by default on Mac OS X, but they have been packaged by the MacPorts folks. Get the MacPorts suitable for your OS X version from their website: https://distfiles.macports.org/MacPorts/
 
Once installed, open a fresh Terminal (Open Finder > Applications > Utilities > Terminal) and let MacPorts update its port library:
sudo port -v selfupdate
 
== Install required Libraries ==
Next up, get the libraries for DarkRadiant through the MacPorts command line tool <tt>port</tt>
sudo port install automake autoconf libtool
sudo port install jpeg wxwidgets-3.0 pkgconfig libsigcxx2 freetype ftgl glew boost
sudo port install freealut libvorbis libogg openal
Answer Yes if any of these prompts you whether you want to install any dependencies for these.
 
== Download the Code ==
Open the Terminal (if you haven't already) and head to your home folder to download the DarkRadiant source code:
cd ~
git clone https://github.com/codereader/DarkRadiant.git
 
== Configure and Make ==
In the Terminal, change to the folder DarkRadiant was cloned to (this is ~/DarkRadiant if you ran <tt>git clone</tt> in your home folder) and type this to configure the build:
./autogen.sh
./configure --enable-darkmod-plugins CPPFLAGS="-I/opt/local/include" LDFLAGS="-L/opt/local/lib" --with-wx-config=/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/bin/wx-config
Since MacPorts is installing its libraries in the /opt/local tree, one needs to pass the include and libs folder paths to the configure script. The wx-config application is not available in the PATH, that's why the <tt>--with-wx-config</tt> argument has to be specified as well. Once the configure script has successfully finished, type
make --jobs=2
make install
to start compilation. If you don't want <tt>make install</tt> to place DarkRadiant into /usr/local, add a <tt>--prefix</tt> argument to the <tt>configure</tt> script above.
Cross your fingers and wait for the build to finish without errors, then start the application by typing
/usr/local/bin/darkradiant
in the Terminal.


{{coding}}
{{coding}}
{{darkradiant|sort=Compilation}}
{{darkradiant|sort=Compilation}}

Revision as of 13:29, 5 February 2017

Note that Mac OS X support is kind of experimental at this stage. If you are able to help in this area, please stop by in the forums.

At the current point there's no Bundle or Installer for DarkRadiant yet, so one needs to compile the application themselves. The following info has been gathered in OS X El Capitan. Depending on your OS X version the steps might differ a bit.

Install XCode

In my case I went with an XCode version that was supported in El Capitan, which happened to be XCode 7.1. I think you're able to obtain this through the App Store, but there are dmg files floating available for download as well. The XCode installation will give you the necessary C++ compilers and libraries.

Install MacPorts

DarkRadiant depends on a couple of open source libraries that are not available by default on Mac OS X, but they have been packaged by the MacPorts folks. Get the MacPorts suitable for your OS X version from their website: https://distfiles.macports.org/MacPorts/

Once installed, open a fresh Terminal (Open Finder > Applications > Utilities > Terminal) and let MacPorts update its port library:

sudo port -v selfupdate

Install required Libraries

Next up, get the libraries for DarkRadiant through the MacPorts command line tool port

sudo port install automake autoconf libtool 
sudo port install jpeg wxwidgets-3.0 pkgconfig libsigcxx2 freetype ftgl glew boost
sudo port install freealut libvorbis libogg openal

Answer Yes if any of these prompts you whether you want to install any dependencies for these.

Download the Code

Open the Terminal (if you haven't already) and head to your home folder to download the DarkRadiant source code:

cd ~
git clone https://github.com/codereader/DarkRadiant.git

Configure and Make

In the Terminal, change to the folder DarkRadiant was cloned to (this is ~/DarkRadiant if you ran git clone in your home folder) and type this to configure the build:

./autogen.sh
./configure --enable-darkmod-plugins CPPFLAGS="-I/opt/local/include" LDFLAGS="-L/opt/local/lib" --with-wx-config=/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/bin/wx-config

Since MacPorts is installing its libraries in the /opt/local tree, one needs to pass the include and libs folder paths to the configure script. The wx-config application is not available in the PATH, that's why the --with-wx-config argument has to be specified as well. Once the configure script has successfully finished, type

make --jobs=2
make install

to start compilation. If you don't want make install to place DarkRadiant into /usr/local, add a --prefix argument to the configure script above. Cross your fingers and wait for the build to finish without errors, then start the application by typing

/usr/local/bin/darkradiant

in the Terminal.