From 68fb873a80d242235eac08d0d7a7688317015bf4 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 8 Aug 2009 18:27:24 +0000 Subject: [PATCH] Pack OSX plugin into a .dmg --- makepanda/makepanda.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 4c4a2724d3..3aa1a34f51 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -4116,7 +4116,16 @@ def MakeRuntime(): # Copy the p3d_plugin file to coreapi dir and the plugin to the plugin dir. plugfile = CalcLocation("p3d_plugin.dll", None) CopyFile(coreapidir + os.path.basename(plugfile), plugfile) - if (sys.platform != "darwin"): #TODO: bundle OSX plugin in DMG + if (sys.platform == "darwin"): + plugfile = CalcLocation("nppanda3d.plugin", None) + if (os.path.isdir(GetOutputDir()+"/tmp/bundle")): + oscmd("rm -rf %s" % BracketNameWithQuotes(GetOutputDir()+"/tmp/bundle")) + MakeDirectory(GetOutputDir()+"/tmp/bundle") + CopyTree(GetOutputDir()+"/tmp/bundle/nppanda3d.plugin", plugfile) + oscmd("hdiutil create -fs HFS+ -srcfolder %s -volname nppanda3d %s" % (GetOutputDir()+"/tmp/bundle", GetOutputDir()+"/plugins/nppanda3d.dmg")) + CopyFile(plugindir + os.path.basename(plugfile), GetOutputDir()+"/plugins/nppanda3d.dmg") + oscmd("rm -rf %s" % BracketNameWithQuotes(GetOutputDir()+"/tmp/bundle")) + else: plugfile = CalcLocation("nppanda3d.dll", None) CopyFile(plugindir + os.path.basename(plugfile), plugfile) @@ -4325,6 +4334,7 @@ def MakeInstallerOSX(): oscmd("mkdir -p Panda3D-tpl-rw/Panda3D/%s/bin" % VERSION) oscmd("mkdir -p Panda3D-tpl-rw/Panda3D/%s/lib" % VERSION) oscmd("mkdir -p Panda3D-tpl-rw/Panda3D/%s/lib/direct" % VERSION) + oscmd("mkdir -p Panda3D-tpl-rw/Panda3D/%s/plugins" % VERSION) oscmd("ln -s /usr/bin/python Panda3D-tpl-rw/Panda3D/%s/bin/ppython" % VERSION) oscmd("sed -e 's@\\$1@%s@' < direct/src/directscripts/profilepaths-osx.command >> Panda3D-tpl-rw/panda3dpaths.command" % VERSION) WriteFile("Panda3D-tpl-rw/Panda3D/%s/lib/direct/__init__.py" % VERSION, "") @@ -4339,7 +4349,7 @@ def MakeInstallerOSX(): oscmd("cp -R %s/bin/* Panda3D-tpl-rw/Panda3D/%s/bin/" % (GetOutputDir(), VERSION)) if os.path.isdir("samples"): oscmd("cp -R samples Panda3D-tpl-rw/Panda3D/%s/samples" % VERSION) if os.path.isdir(GetOutputDir()+"/Pmw"): oscmd("cp -R %s/Pmw Panda3D-tpl-rw/Panda3D/%s/lib/Pmw" % (GetOutputDir(), VERSION)) - if os.path.isdir(GetOutputDir()+"/plugins"): oscmd("cp -R %s/plugins Panda3D-tpl-rw/Panda3D/%s/plugins" % (GetOutputDir(), VERSION)) + if os.path.isdir(GetOutputDir()+"/plugins"): oscmd("cp %s/plugins/* Panda3D-tpl-rw/Panda3D/%s/plugins/" % (GetOutputDir(), VERSION)) for base in os.listdir(GetOutputDir()+"/lib"): if (not base.endswith(".a")): oscmd("cp "+GetOutputDir()+"/lib/"+base+" Panda3D-tpl-rw/Panda3D/"+VERSION+"/lib/"+base)