Page 1 of 1

Minetest on a Mac

PostPosted: Sat Jun 18, 2011 13:31
by toabi
Hi,

I recently invested some time to get minetest running on OS X.

My build setup is located there: https://github.com/toabi/minetest-mac

There's also a binary download if you don't like to build yourself.

::edit::
Removed bitbucket links because now everything I do is on github.

PostPosted: Sat Jun 18, 2011 15:55
by celeron55
Thanks for finding those out - I hand-picked (sorry :P) the relevant changes for OSX from your fork: https://bitbucket.org/celeron55/minetest/changeset/69b548db0804

Could you verify that my version builds for you? I have no Macs so I can't test anything. 8-)

PostPosted: Sat Jun 18, 2011 16:05
by toabi
Jey.

But: You put the
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
#ifdef __APPLE__
    #include "CoreFoundation/CoreFoundation.h"
#endif

from the top back into the namespace… and because those are C headers… they are totally confused in a namespace. (Syntax Errors…)

Other than that, it works well.

PostPosted: Mon Jun 20, 2011 05:00
by celeron55
What kind of a build system are you using, exactly? Did you manage to use the (recently updated) CMake build scripts? I copied some fixes to them for OS X from minetest-delta a while ago, but i don't really know what they exactly fix.

PostPosted: Mon Jun 20, 2011 21:28
by toabi
Well.

CMake can build stuff. But there are some issues:

1) The compiler doesn't like debug:98 and debug:71 with "error: cast from ‘_opaque_pthread_t*’ to ‘unsigned int’ loses precision"
Fun fact: Building with Xcode works without commenting those two out.
2) Irrlicht on OS X is weird. If you launch it from terminal, it does not receive keyboard input. Keyboard input goes straight to the terminal. I searched a bit around and the thing they say you is: You have to use a Cocoa App Template in Xcode! Well.
3) Also there are/were some 32/64 bit issues. It tried to build 64, but there's only 32bit Irrlicht on OS X…

So because Irrlicht didn't work well I tried to put everything into a Xcode Cocoa Application template. And this is now my build system. It consists of:
- the xcodeproj file
- Interface Builder definitions for the OS X menubar (minimal Cocoa Application)
- Launch script to place in the final application bundle
- A folder with Irrlicht.framework and and libjthread.a

Those files all live in a folder named "minetest-mac". One just has to drop this folder into the cloned minetest folder, open the Xcode project and press "build". It then builds you a fully functional redistributable OS X application bundle. Which is awesome.

The build process could also be started from CLI by running "xcodebuild" in the "minetest/minetest-mac" folder.

The only disadvantage of this is that everytime new files are added to the repository, I have to reference them in the Xcode project.

PostPosted: Tue Jun 21, 2011 05:20
by benajamin
toabi wrote:2) Irrlicht on OS X is weird. If you launch it from terminal, it does not receive keyboard input. Keyboard input goes straight to the terminal.


When I run Minetest from a terminal on Gentoo Linux, I can see the cursor blinking in the Minetest GUI, but keyboard input goes to the terminal. I have to click the MInetest GUI to give it focus and then I can type into the fields. Is this similar to your problem on Mac?

PostPosted: Tue Jun 21, 2011 08:38
by toabi
Regarding the Irrlicht focus: I did try to click into the window ;) — it's just that the window spawned by Irrlicht is not recognized as a real 'window' by OS X:
- There is no icon for it in the application switcher
- If focues, the menubar is not updated… etc.

It behaves like it's just a 2D region of some pixels with no proper interaction with the OS. As I said. Wrapping it in a default template for OS X applications makes it work :)

PostPosted: Wed Jun 22, 2011 15:28
by celeron55
toabi wrote:Regarding the Irrlicht focus: I did try to click into the window ;) — it's just that the window spawned by Irrlicht is not recognized as a real 'window' by OS X:
- There is no icon for it in the application switcher
- If focues, the menubar is not updated… etc.

It behaves like it's just a 2D region of some pixels with no proper interaction with the OS. As I said. Wrapping it in a default template for OS X applications makes it work :)


Is there really no fix to this? I am sure XCode doesn't do any magic, just passes the right parameters and stuff to the compiler and linker.

I would like to have the CMake build script to work on OS X - but that is totally up to you Mac users.

PostPosted: Mon Jun 27, 2011 10:02
by toabi
celeron55 wrote:Is there really no fix to this? I am sure XCode doesn't do any magic, just passes the right parameters and stuff to the compiler and linker.

I would like to have the CMake build script to work on OS X - but that is totally up to you Mac users.


Well. The magic is the small Cocoa GUI Menu/Window… I don't know yet if it's possible without them.

And it's certainly possible to build it on OS X but I really don't enough about CMake to do this.

PostPosted: Thu Jun 30, 2011 08:09
by milkshakez7z
i just downloaded the windows version then ran it with wine bottler works fine for me:)
edit:wineskin


heres how i did it http://www.youtube.com/watch?v=_82z4oz1_J8

I dont know any coding but...