Difference between revisions of "Compiling for Mac OS X"
m (1 revision) |
(Added lua install.) |
||
Line 31: | Line 31: | ||
<code bash>sudo make install</code> | <code bash>sudo make install</code> | ||
+ | |||
+ | Now you need to install Lua. | ||
+ | |||
+ | There are several ways to do this: | ||
+ | |||
+ | Option 1. is via Macports | ||
+ | If you wish to install Lua this way, you must download Macports from [http://www.macports.org] | ||
+ | Follow all install instructions the Macports website and installer give you, and then open a terminal. | ||
+ | |||
+ | |||
+ | Type the following and hit enter: | ||
+ | <code bash>sudo port install lua</code> | ||
+ | |||
+ | Macports will do its thing and Lua will be installed | ||
+ | |||
+ | Option 2. is via Lua source. | ||
+ | |||
+ | Download this file:[http://www.lua.org/ftp/lua-5.1.4.tar.gz] | ||
+ | |||
+ | Next, open up your console (terminal) and change to the directory that you downloaded this file to. Next, type in: | ||
+ | |||
+ | <code bash>tar xzf lua-5.1.4.tar.gz</code> | ||
+ | |||
+ | This will extract all the files into a folder called lua-5.1.4 Go to this folder by typing: | ||
+ | |||
+ | <code bash>cd lua-5.1.4</code> | ||
+ | |||
+ | Run this: | ||
+ | |||
+ | <code bash> ./configure && make</code> | ||
+ | |||
+ | Then run: | ||
+ | |||
+ | <code bash>sudo make install</code> | ||
+ | |||
+ | Lua has been installed in the system, but TPT will not accept it yet. | ||
+ | |||
+ | Open The Powder Toy's source folder and open "makefile" with TextEdit. | ||
+ | |||
+ | Find the line that says "powder-x", near this you will see a bit of text that says "-lua5.1", remove the 5.1 from this and save the file. | ||
--- | --- | ||
− | + | Fourth step step, after all that's done, in the Terminal, you need to cd to the powdertoy source folder, so we can start compiling. | |
Type in cd, like in this picture: \\ | Type in cd, like in this picture: \\ |
Revision as of 01:34, 30 September 2011
Copy paster from forum thread. Clarify where needed
Ok I don't know if this is where it goes but I *think* I finally grasped the idea, with whatever methods, to compile as efficiently as I could. Thanks to some people at this Mac forum, and to flarn2006 who helped me I guess for the last step, even though I didn't get it at first but then when this dude explained it to me at those forums it clicked lol.
Ok so.
First step you need to take is install XCode/Developer Tools, even though the method we compile with in this guide is through the Terminal/command line, I'm sure there is a way to compile with XCode as well, hopefully in the future someone can find out :P.
Download XCode from here: [1]
Also let's install SDL, the PROPER way, so you don't get any errors during compiling.
First, get this file:
Next, open up your console (terminal) and change to the directory that you downloaded this file to. Probably 'Downloads' in your user folder. Next, type in:
tar xzf SDL-1.2.14.tar.gz
This will extract all the files into a folder called SDL-1.2.14. Go to this folder by typing:
cd SDL-1.2.14
There's a configure and a makefile in this folder. You'll have to run both.
./configure && make
It'll check that you can compile then a bunch of stuff. After it's done, you have one more step:
sudo make install
Now you need to install Lua.
There are several ways to do this:
Option 1. is via Macports
If you wish to install Lua this way, you must download Macports from [3] Follow all install instructions the Macports website and installer give you, and then open a terminal.
Type the following and hit enter:
sudo port install lua
Macports will do its thing and Lua will be installed
Option 2. is via Lua source.
Download this file:[4]
Next, open up your console (terminal) and change to the directory that you downloaded this file to. Next, type in:
tar xzf lua-5.1.4.tar.gz
This will extract all the files into a folder called lua-5.1.4 Go to this folder by typing:
cd lua-5.1.4
Run this:
./configure && make
Then run:
sudo make install
Lua has been installed in the system, but TPT will not accept it yet.
Open The Powder Toy's source folder and open "makefile" with TextEdit.
Find the line that says "powder-x", near this you will see a bit of text that says "-lua5.1", remove the 5.1 from this and save the file.
---
Fourth step step, after all that's done, in the Terminal, you need to cd to the powdertoy source folder, so we can start compiling.
Type in cd, like in this picture: \\ Template:Http://i55.tinypic.com/2hzr0nq.png
Next, what I would usually do is just drag the folder into the Terminal window to make the linking easy.
Should end up like this:\\ {{http:i54.tinypic.com/96hyds.png]http:i54.tinypic.com/96hyds.png}}
Click enter, and after that do "make powder-x". It should start writing a bunch of things, warnings and stuff, which are fine. Towards the end when it's done, it usually says 'strip powder-x' like in this picture: \\Template:Http://i55.tinypic.com/2qlqu7q.png
Now you should have 2 files in the folder, the important one being 'powder-x' which is a "unix executable file", therefore it only runs from the command line, which we don't want, here is a pic of the outcome:\\ Template:Http://i53.tinypic.com/29aryhk.png
---
Now since we want to actually have a complete stand alone application rather than a crappy command line based one, so we can share with our buddies and show off in the forums, there is a third step to do that, and here I explain my method on it.
Now notice in one of the pics I had a Powder.app next to the folder, yes, now I will explain what to do.
1) Right click on the Powder.app > "Show package contents" >/Contents/MacOS, you will notice something familiar...it's a powder-x file!
2) Go to the source folder, mine is cracker, since he is an awesome modder, and drag the powder-x in the source folder, into the one in the Powder.app one, replacing the one in there. Here is a pic for dummies:\\ Template:Http://i56.tinypic.com/xc3mz9.png?600
3) Open Powder.app now, and voila! Perfect, complete app, just like the one on the website :) with the icons and everything, no command line launching needed! Share to your hearts content, I hope this long overdue guide helped all of you fill those gaps that were left for us OS X users :( now we can enjoy powder toy fun too!
4) Here is another picture for the lulz:\\ Template:Http://i52.tinypic.com/jb67va.png?600
Credits:
Dudes at MacRumors. Dudes here, and I guess flarn2006. Cracker for his awesome mod. I'm proud to be a 'crack' head :) get it? Crackhead? harharharhar....I am so funny... -___-. AntB for doing the wiki formatting (Self-promotion FTW!)