Thread: Mac Server
View Single Post
  #9  
Old 04-02-2014, 04:19 PM
Corysia
Fire Beetle
 
Join Date: Jul 2007
Location: Pacific Northwest
Posts: 22
Default

Here are some updated instructions for how to compile and install the binaries without the loginserver.

Assuming starting with a clean Mountain Lion installation.

Code:
1. Install Xcode

2. Install Mac Ports from http://www.macports.org/

3. Install MySQL 5.1 from mac ports and configure

    3a. Install
	sudo port install mysql51 mysql51-server
	sudo port select --set mysql mysql51
	sudo -u _mysql /opt/local/lib/mysql51/bin/mysql_install_db

    3b. Set up mysql's listening port
	sudo cp /opt/local/etc/mysql51/my.cnf /opt/local/etc/mysql51/my.cnf.old
	sudo cp /opt/local/etc/mysql51/macports-default.cnf /opt/local/etc/mysql51/my.cnf
	Edit /opt/local/etc/mysql51/my.cnf with the editor of your choice (remember to sudo) and comment out the "skip-networking" line.  Example:
	sudo sed -i '' -e's/^skip/#skip/' /opt/local/etc/mysql51/my.cnf
	
    3c. Start mysql by hand
	sudo /opt/local/share/mysql51/mysql/mysql.server start
	sudo /opt/local/lib/mysql51/bin/mysql_secure_installation

4. install gcc 4.8
	sudo port install gcc48
	sudo port select --set gcc mp-gcc48

5. Install cmake
	sudo port install cmake

6. Install Perl
	sudo port install perl5.12 p5.12-dbi
	sudo ln -s /opt/local/bin/perl5.12 /opt/local/bin/perl

7. Install lua
	sudo port install lua
	sudo port install python27
	sudo port select --set python python27
	sudo port install boost

8. Download the EQEmulator server source code.  I will assume you'll put this in your home directory under EQServer/source.
	mkdir ~/EQServer
	cd ~/EQServer
	git clone git://github.com/EQEmu/Server.git source

9. If my changes have not been applied to support Mac, patch the source with my patch.  I will assume you've copied them into a file called "corysia-mac.patch" and placed it in to the source directory.

	cd ~/EQServer/source

    9a.	First, test that the patch is going to still work.
	patch --dry-run -p 1 -i corysia-mac.patch

	*** NOTE***
	If you get a message like:
		can't find file to patch at input line 5
		Perhaps you used the wrong -p or --strip option?
	Then you forgot to CD into the source directory.

    9b. If that command didn't produce any errors, go ahead and patch.
	patch -p 1 -i corysia-mac.patch

10. Update values with cmake . -i

	Answer "yes" to the question about advanced options.

	It's now going to ask you a lot of questions.  I suggest opening a second terminal window and for each program it asks about, use the 'which' command to find the right path to it.  For example:

		Variable Name: CMAKE_AR
		Description: Path to a program.
		Current Value: /usr/bin/ar
		New Value (Enter to keep current value):

		Now in the other terminal, type "which ar" and it will come back with "/opt/local/bin/ar".  Enter that as the value instead of the default "usr/bin/ar".  This is tedious, but necessary.  You only need to do this once, however.

	Set installation prefix to /opt/EQServer/bin

	Do not enable loginserver

	Set the compilers to
		/opt/local/bin/gcc
		/opt/local/bin/g++
	Set the SQL Libraries and paths
		MySQL_INCLUDE_DIR=/opt/local/include/mysql51/mysql
		MySQL_LIBRARY_RELEASE=/opt/local/lib/mysql51/mysql/libmysqlclient_r.dylib
		MySQL_LIBRARY_DEBUG=/opt/local/lib/mysql51/mysql/libmysqlclient_r.dylib

11. configure with: cmake -G "Unix Makefiles"

        *** NOTE ***
	Often at this point, I get this error:
		CMake Error at /opt/local/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
  		  Could NOT find MySQL (missing: MySQL_LIBRARY_DEBUG MySQL_LIBRARY_RELEASE MySQL_INCLUDE_DIR)

	To fix it, I just run "cmake . -i" again.  This time I answer 'no' to the advanced options.  And, I always find that my choices for servers and destination directory on install hasn't been set.

	I usually run cmake . -i a third time and review the settings, answering 'no' to advanced options.

12. make
13. sudo make install
Reply With Quote