Mac OS X

Morn76
Member
 
Posts: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: Mac OS X

by Morn76 » Mon Apr 21, 2014 11:20

Interesting! That project is dead though and the code might be broken on current versions of OS X. At least that's what I gather from their homepage on Google Code. Still, it might be worth a try. At least all the calls we need seem to be there.
 

Morn76
Member
 
Posts: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: Mac OS X

by Morn76 » Mon Apr 21, 2014 15:30

Yay, I've figured out how to use the Mach semaphores. Instead of #include <semaphore.h> in jsemaphore.h:

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
#include <mach/semaphore.h>
#include <sys/semaphore.h>


Don't use any of the Apple macros because sem_*() are defined by these include files too!

Now the only showstopper is that sem_timedwait() isn't implemented by Mach either. But at least sem_getvalue() is no longer a problem.
 

Morn76
Member
 
Posts: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: Mac OS X

by Morn76 » Mon Apr 21, 2014 16:15

Finally!

The latest git version compiles and runs! I'm attaching a ZIP file with my jsemaphore.h and .cpp.

So now I've basically lifted the code from vermont for sem_timedwait and combined it with the Apple macros.

It's a bit of a mess and not at all fit for "minetest/minetest" trunk but at least it works.

Image
Attachments
jthread.zip
Jthread for OS X
(26.77 KiB) Downloaded 154 times
 

OmniStudent
Member
 
Posts: 261
Joined: Sat Nov 03, 2012 06:40

Re: Mac OS X

by OmniStudent » Mon Apr 21, 2014 16:41

Great work Morn76! :) :) :)

I'm gonna try it out at once.
 

Morn76
Member
 
Posts: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: Mac OS X

by Morn76 » Mon Apr 21, 2014 16:44

Could you package this as an app or did you lose your modified cmake files, OmniStudent? I need working keyboard input to actually start a world.
 

Morn76
Member
 
Posts: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: Mac OS X

by Morn76 » Mon Apr 21, 2014 16:47

BTW, I notice sem_getvalue() is still commented out in jsemaphore.cpp, so this might not work properly yet. Unfortunately Mach unnamed semaphores do not include _getvalue(): http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/
 

OmniStudent
Member
 
Posts: 261
Joined: Sat Nov 03, 2012 06:40

Re: Mac OS X

by OmniStudent » Mon Apr 21, 2014 17:21

Morn76 wrote:Could you package this as an app or did you lose your modified cmake files, OmniStudent? I need working keyboard input to actually start a world.


Yes I've lost the latest cmake file file for this, but I think the cpack commands in the end of his cmakelists do the trick.

https://github.com/toabi/minetest/blob/ ... eLists.txt
 

Morn76
Member
 
Posts: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: Mac OS X

by Morn76 » Mon Apr 21, 2014 18:55

It works! No really this time, I swear. :-)

Well, maybe not perfectly, I'm seeing some mesh-related timeout messages. But I can dig blocks, I can place blocks, etc.

Shaders don't seem to work on OS X (everything was textured red initially).

I've added a counter for sem_getvalue(). And it turned out jevent.h/.cpp had even more semaphores that also needed to be converted to Mach.

Image
Attachments
jthread_2.zip
New version of jthread directory
(26.54 KiB) Downloaded 132 times
 

User avatar
Jordach
Member
 
Posts: 4412
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach

Re: Mac OS X

by Jordach » Mon Apr 21, 2014 18:57

Shaders don't work because they require OpenGL 3.0+, and GLSL 1.2+, Macs that are as old as yours don't have said capabilities.
 

Morn76
Member
 
Posts: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: Mac OS X

by Morn76 » Mon Apr 21, 2014 19:03

Purchased it in January 2013 I think. I guess that makes it ancient history by Apple standards?
 

User avatar
Topywo
Member
 
Posts: 1718
Joined: Fri May 18, 2012 20:27

Re: Mac OS X

by Topywo » Mon Apr 21, 2014 19:12

Congratulations!

Although I'm not using Mac OS X, I appreciate the work you have done.
 

Morn76
Member
 
Posts: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: Mac OS X

by Morn76 » Mon Apr 21, 2014 19:21

Topywo wrote:Congratulations!

Although I'm not using Mac OS X, I appreciate the work you have done.


Support for Windows, Linux, and OS X seems to be a pretty standard feature of established open source projects (like Gimp, Clementine, Stellarium, etc.). To me it always signifies quality and that the devs care about their user base, no matter what their OS of choice is. Plus I like to have my favorite software installed on all my machines, so OS X support for Minetest is a must. :-)

"long waittime = time_ms;" in jsemaphore.cpp seems to have fixed the timout error messages. I forgot about that.

I notice crouching with Shift doesn't work, I just wander right off the node edge. German keyboard issue?

The git version number of the bundle is not set, but this is probably because I downloaded a ZIP of the latest git version.

Oh well, but generally this is quite nice so far. I guess I should look into packaging a bit more so the support files are copied into the .dmg automatically. And I think the .dmg does not contain the required dynamic libraries either which would be needed to make the bundle fully self contained.
 

User avatar
hoodedice
Member
 
Posts: 1372
Joined: Sat Jul 06, 2013 06:33

Re: Mac OS X

by hoodedice » Mon Apr 21, 2014 20:37

Topywo wrote:Congratulations!

Although I'm not using Mac OS X, I appreciate the work you have done.



I have to say it too, you guys are doing a great job! I have been following your posts since the last few days (O.O Stalker!) and I am thoroughly impressed by your speed with fixing this issue =D

Keep it going peeps
7:42 PM - Bauglio: I think if you go to staples you could steal firmware from a fax machine that would run better than win10 does on any platform
7:42 PM - Bauglio: so fudge the stable build
7:43 PM - Bauglio: get the staple build
 

Morn76
Member
 
Posts: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: Mac OS X

by Morn76 » Mon Apr 21, 2014 21:47

Jordach wrote:Shaders don't work because they require OpenGL 3.0+, and GLSL 1.2+, Macs that are as old as yours don't have said capabilities.


As it turns out, shaders did not work because they were not installed into the application bundle. Oops. I just needed to copy them to /Applications/minetest.app/Contents/Resources/bin/share/client/shaders and now they work just fine.
 

User avatar
GingerHunter797
Member
 
Posts: 144
Joined: Sun Oct 13, 2013 15:36
In-game: GingerHunter797

Re: Mac OS X

by GingerHunter797 » Mon Apr 21, 2014 23:06

Congratulations! Minetest can now be run on Mac! :D
I dont use a Mac but I am still happy that it can be done!
http://i.imgur.com/gqXXUaI.png

3DS Friend Code: 2122-7173-2797
Add me as a friend! :D

Want to play a fun game? http://voxelands.com/
 

Morn76
Member
 
Posts: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: Mac OS X

by Morn76 » Tue Apr 22, 2014 00:02

GingerHunter797 wrote:Congratulations! Minetest can now be run on Mac!


Thanks, GingerHunter797, but actually MT could always run on the Mac (https://github.com/toabi/minetest-mac/downloads). It's just been broken since late November last year when jsemaphore was introduced.

The main difference might be that this time the necessary changes might get polished and tested sufficiently to also get merged into the main repository eventually.
 

OmniStudent
Member
 
Posts: 261
Joined: Sat Nov 03, 2012 06:40

Re: Mac OS X

by OmniStudent » Tue Apr 22, 2014 07:39

Again, great work Morn76, and thanks to all you other guys for the support and cheering on.

I've finally managed to make a github repository with Morn76's changes,

https://github.com/Belugion/minetest
Sorry if its a bit dirty with unneccessary files :(

It compiles with targets build_all and package. Can't get it to run though, probably because all the support files are in the wrong place.
 

Morn76
Member
 
Posts: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: Mac OS X

by Morn76 » Tue Apr 22, 2014 12:09

Zipped OS X application bundle is available here now:

https://github.com/mdoege/minetest/releases/
Last edited by Morn76 on Tue Apr 22, 2014 15:18, edited 1 time in total.
 

Morn76
Member
 
Posts: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: Mac OS X

by Morn76 » Tue Apr 22, 2014 15:17

OmniStudent wrote:I've finally managed to make a github repository with Morn76's changes,

https://github.com/Belugion/minetest
Sorry if its a bit dirty with unneccessary files :(


You are missing "long waittime = time_ms;" in jsemaphore.cpp in your repo. " … = 3" was just a test...
 

OmniStudent
Member
 
Posts: 261
Joined: Sat Nov 03, 2012 06:40

Re: Mac OS X

by OmniStudent » Tue Apr 22, 2014 17:24

Thankyou for checking!

Fixed that.
 

flake
Member
 
Posts: 13
Joined: Fri Jan 24, 2014 08:25

Re: Mac OS X

by flake » Thu Apr 24, 2014 11:05

Thank you all for your efforts!!!!!

will try to test your build later in this week.

Again,
Thanx!!
 

haschatan
New member
 
Posts: 8
Joined: Thu Apr 10, 2014 18:50

Re: Mac OS X

by haschatan » Fri Apr 25, 2014 07:15

Thank you very much for all that work, Morn76 and OmniStudent!

I have tested your built. It works very well on my Mac Book Pro Retina 2013 Late. Just one thing, when I open a talk box in game, the key "m" does not work.

I am really happy that you have replied to my post as quickly! Thank you guys!
 

Morn76
Member
 
Posts: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: Mac OS X

by Morn76 » Fri Apr 25, 2014 09:41

You're welcome, Haschatan!

Are you using a non-English keyboard layout? Because on my MacBook (German keyboard), "m" works fine but "Shift" does not register at all.

So maybe for some reason the keyboard scanning code in OS X used by Minetest only works correctly for the English layout? Or is Shift broken on the English layout too? I think we need more feedback to figure out a pattern here.
 

haschatan
New member
 
Posts: 8
Joined: Thu Apr 10, 2014 18:50

Re: Mac OS X

by haschatan » Fri Apr 25, 2014 09:44

Ok, in fact it is a french keyboard.
 

Morn76
Member
 
Posts: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: Mac OS X

by Morn76 » Fri Apr 25, 2014 09:58

haschatan wrote:Ok, in fact it is a french keyboard.


OK. And what about Shift for e.g. climbing down ladders. Does it work or not?

P.S. Aha, it looks like "m" is indeed in a different place on the French Mac keyboard. Do you get an "m" if you press "," (right next to "n"), Haschatan?

But "a" and "q" work properly, right?

Image
 

haschatan
New member
 
Posts: 8
Joined: Thu Apr 10, 2014 18:50

Re: Mac OS X

by haschatan » Sun Apr 27, 2014 07:42

If I press "," I get the correct key. "a" and "q" work properly. The problem is just with the key "m".
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: Mac OS X

by Krock » Sun Apr 27, 2014 08:11

haschatan wrote:If I press "," I get the correct key. "a" and "q" work properly. The problem is just with the key "m".

Or try to change the keys in the settings tab at main menu.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

Morn76
Member
 
Posts: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: Mac OS X

by Morn76 » Sun Apr 27, 2014 10:25

Krock wrote:
haschatan wrote:If I press "," I get the correct key. "a" and "q" work properly. The problem is just with the key "m".

Or try to change the keys in the settings tab at main menu.


This won't change chat keys though, will it? That's just for in-game controls.

Maybe what happens here is that the "m" key on a French keyboard does not send the same keycode as "m" on e.g. a English or German keyboard. And so Irrlicht does not register that key. Perhaps related to the problem that Shift keys on the Mac are do not register in MT either, at least on my German keyboard. (The Shift key problem has also been reported for 2012 Mac builds on this forum, so this is not a new issue.)

I've found an old thread in the forum about problems with an AZERTY keyboard and MT under Linux: viewtopic.php?id=3792 That Irrlicht bug was fixed apparently, but perhaps only for numpad keys.

Haschatan, maybe you could download SuperTuxKart for your Mac ( http://supertuxkart.sourceforge.net/Downloads ). It also uses Irrlicht. I think you can enter your player name in STK, so this would be a good way to test if the "m" key works in other Irrlicht-based OS X games.
 

Previous

Return to Minetest General

Who is online

Users browsing this forum: No registered users and 7 guests

cron