December 12, 2017, 07:48:56 PMLatest Member: LoPAzz

Author Topic: Trying to create a more detailed How to Compile for Mac  (Read 2446 times)

0 Members and 1 Guest are viewing this topic.

tobylane

  • Registered member
  • *
  • Posts: 53
    • View Profile
Trying to create a more detailed How to Compile for Mac
« on: January 31, 2011, 07:23:20 PM »
Here's an attempt at writing a detailed guide on how to build the latest version of CorsixTH, if you want something newer than the betas. It is helpful when you are filing a bug report to check that it hasn't been fixed in the meantime, or you might want the newer features. It probably won't ever get automated as it isn't much work and its worth trying the command line even if its very briefly. I hope it works, it just installed over what I already had so I can't be sure. If you have only used betas so far, and you used this guide to start making and using svn builds, please say so so I know where it works.

Quote
Building CorsixTH from source on Mac OSX

Requirements : Any computer with any Mac OSX version (mackintoshes and PowerPC are untested)
Xcode (http://developer.apple.com/technologies/xcode.html Free, use your itunes/mac store account)
Homebrew, Fink or Macports (optional, Homebrew recommended but you can build manually instead of using any of these)
Cmake (http://www.cmake.org/cmake/resources/software.html Any of the downloads for Binary Mac) It names itself with its version number which is fairly ugly.

Notes: Install command line tools of Xcode. I'm suggesting to make install, instead you can tell Cmake the paths of the executable if you want to. Luajit is not in 64bit, and it is almost certain that you are using 64bit so it's not worth using it. Animview and Mapedit don't work yet so I will leave out the complicated and massive Wxwidgets. SDL-mixer can be silently ignored if you don't want audio. Freetype2 can be ignored if you don't need chinese text (or any future language using new characters). You can link Cmake to something in your $PATH or you add, say ~/bin/ to $PATH. Ignore every Xcode project file with the words "Top_Level" in it.

Pre-install
Install Lua - sudo brew install lua, sudo port install lua, sudo fink install lua51, curl -R -O http://www.lua.org/ftp/lua-5.1.4.tar.gz && tar zxf lua-5.1.4.tar.gz && make macosx && sudo make install
Install SDL - sudo brew install SDL, sudo port install SDL, sudo fink install SDL, sdl.org + Download Mac + open the dmg + copy those files to ~/Library/Frameworks/
Install SDL-mixer - sudo brew install SDL-mixer, sudo port install SDL_mixer, sudo fink install SDL_mixer, SDL_mixer=SDL_mixer-1.2.11 && curl -O http://www.libsdl.org/projects/SDL_mixer/release/${SDL_mixer}.tar.gz && tar zxf ${SDL_mixer}.tar.gz && cd ${SDL_mixer} && ./configure && make &&
sudo make install

Go to a suitable folder (Downloads) and open in the Terminal (cdto is good http://code.google.com/p/cdto/) Copy 'svn checkout http://corsix-th.googlecode.com/svn/trunk/ corsix-th-read-only' which will create the folder and fill it with what the developers are making. Cmake and Xcode will create extra files in this folder which can be ignored. This following script will update and build, if you know that the updates are only lua you can just svn up, you don't need to rebuild. If you want to save this script, copy it to clipboard, 'echo `pbpaste` > build && chmod a+x build' and it will be made wherever you are (I suggest svn root folder).

myfp=`which $0`
mydir=`dirname $myfp`
cd $mydir
svn up
/Applications/CMake.app/Contents/bin/cmake -G Xcode
cd CorsixTH
xcodebuild -configuration Release -sdk macosx10.6
mv -f Release/CorsixTH CorsixTH

tobylane

  • Registered member
  • *
  • Posts: 53
    • View Profile
Re: Trying to create a more detailed How to Compile for Mac
« Reply #1 on: November 07, 2015, 09:49:24 PM »
New scripts for compiling on mac. Lets call it alpha v2. The first one will download the other two, but I welcome everyone to read them all for their own satisfaction and script improvements. They require Xcode and Xcode command line utilities, will take up about 100mb minus anything you already have, and produce a 5mb zip that doesn't include dependencies.

https://github.com/tobylane/Bin/blob/master/cthprepare
https://github.com/tobylane/Bin/blob/master/cthupdate
https://github.com/tobylane/Bin/blob/master/cthpackage