Mavhod / GodotSteam

Steam api for Godot game engine
61 stars 12 forks source link

OSX support? #4

Closed ghost closed 8 years ago

ghost commented 8 years ago

It would be nice if GodotSteam could support OSX.

Mavhod commented 8 years ago

Sorry I haven't Mac, I will make it when I have device in a future.

ghost commented 8 years ago

Why not Hackintosh? You don't need a mac to test it. All you need is Virtualbox and Xcode with osxcross to compile on linux. http://docs.godotengine.org/en/latest/reference/compiling_for_osx.html

Mavhod commented 8 years ago

Ok, I will try it thank :).

ghost commented 8 years ago

I actually figured out how to compile it for OSX. Just define OSX libraries in config.py:

# config.py

def can_build(platform):
    >return platform=="x11" or platform=="windows" or platform=="osx"

def configure(env):
    env.Append(CPPPATH=["#modules/godotsteam/sdk/public/"])
    if env["platform"]== "x11":
        env.Append(LIBS=["steam_api"])
        #env.Append(RPATH=["."])
        if env["bits"]=="32":
            env.Append(RPATH=env.Literal('\\$$ORIGIN/linux32'))
            env.Append(LIBPATH=["#modules/godotsteam/sdk/redistributable_bin/linux32"])
        elif env["bits"]=="64":
            env.Append(RPATH=env.Literal('\\$$ORIGIN/linux64'))
            env.Append(LIBPATH=["#modules/godotsteam/sdk/redistributable_bin/linux64"])
    elif env["platform"] == "windows":
        if env["bits"]=="32":
            env.Append(LIBS=["steam_api"])
            env.Append(LIBPATH=["#modules/godotsteam/sdk/redistributable_bin"])
        elif env["bits"]=="64":
            env.Append(LIBS=["steam_api64"])
            env.Append(LIBPATH=["#modules/godotsteam/sdk/redistributable_bin/win64"])
    >elif env["platform"] == "osx":
    >       env.Append(LIBS=["libsteam_api"])
    >       env.Append(LIBPATH=["#modules/godotsteam/sdk/redistributable_bin/osx32"])

To get app working you need to add libsteam_api.dylib from /sdk/redistributable_bin/ to the OSX app template in directory where your binary templates are stored(Contents/MacOS).

Kermer commented 8 years ago

@nepitard have you tested it on actually Mac or some virtual machine? And how about

    elif env["platform"] == "osx":
        env.Append(LIBS=["steam_api"])
        env.Append(RPATH=env.Literal('\\$$ORIGIN'))
        env.Append(LIBPATH=["#modules/godotsteam/sdk/redistributable_bin/osx32"])

Asking, since I have no Mac or even image of it.

ghost commented 8 years ago

@Kermer Tested it on hackintosh, the binary runs well.

ghost commented 8 years ago

You can also emulate Mac on top of Windows/Linux using VirtualBox or similar. Depending on how powerful your system is you may be able to handle quite a lot. I emulate Windows 7 on top of my Macbook Air and I can even play 3D games like Fallout 3 !

Mavhod commented 8 years ago

Ok, made support OSX already :).

ghost commented 8 years ago

@Mavhod nice :+1: