mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Plugin bundle on OSX
This commit is contained in:
parent
6bb9c42700
commit
eb906bb489
@ -8,45 +8,6 @@ parameters, and produces the plugin bundle in the same place.
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# The contents of the Info.plist file.
|
|
||||||
InfoPlist = """<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>en-US</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>nppanda3d</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>org.panda3d.nppanda3d</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>Panda3D</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>BRPL</string>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>WebPluginName</key>
|
|
||||||
<string>Panda3D Game Engine Plug-In</string>
|
|
||||||
<key>WebPluginDescription</key>
|
|
||||||
<string>Runs 3-D games and interactive applets</string>
|
|
||||||
<key>WebPluginMIMETypes</key>
|
|
||||||
<dict>
|
|
||||||
<key>application/x-panda3d</key>
|
|
||||||
<dict>
|
|
||||||
<key>WebPluginExtensions</key>
|
|
||||||
<array>
|
|
||||||
<string>p3d</string>
|
|
||||||
</array>
|
|
||||||
<key>WebPluginTypeDescription</key>
|
|
||||||
<string>Panda3D applet</string>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
"""
|
|
||||||
|
|
||||||
import getopt
|
import getopt
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
@ -91,12 +52,8 @@ def makeBundle(startDir):
|
|||||||
if not resourceFilename.exists():
|
if not resourceFilename.exists():
|
||||||
raise IOError, 'Unable to run Rez'
|
raise IOError, 'Unable to run Rez'
|
||||||
|
|
||||||
# Generate the Info.plist file.
|
# Copy in Info.plist and the compiled executable.
|
||||||
f = open(plistFilename.toOsSpecific(), 'w')
|
shutil.copyfile(Filename(fstartDir, "nppanda3d.plist").toOsSpecific(), plistFilename.toOsSpecific())
|
||||||
f.write(InfoPlist)
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
# Copy in the compiled executable.
|
|
||||||
shutil.copyfile(optDir + '/nppanda3d', exeFilename.toOsSpecific())
|
shutil.copyfile(optDir + '/nppanda3d', exeFilename.toOsSpecific())
|
||||||
|
|
||||||
# All done!
|
# All done!
|
||||||
|
36
direct/src/plugin_npapi/nppanda3d.plist
Normal file
36
direct/src/plugin_npapi/nppanda3d.plist
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>en-US</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>nppanda3d</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>org.panda3d.nppanda3d</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>Panda3D</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>BRPL</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>WebPluginName</key>
|
||||||
|
<string>Panda3D Game Engine Plug-In</string>
|
||||||
|
<key>WebPluginDescription</key>
|
||||||
|
<string>Runs 3-D games and interactive applets</string>
|
||||||
|
<key>WebPluginMIMETypes</key>
|
||||||
|
<dict>
|
||||||
|
<key>application/x-panda3d</key>
|
||||||
|
<dict>
|
||||||
|
<key>WebPluginExtensions</key>
|
||||||
|
<array>
|
||||||
|
<string>p3d</string>
|
||||||
|
</array>
|
||||||
|
<key>WebPluginTypeDescription</key>
|
||||||
|
<string>Panda3D applet</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
@ -821,7 +821,8 @@ def CompileLink(dll, obj, opts):
|
|||||||
if (not sys.platform.startswith("freebsd")):
|
if (not sys.platform.startswith("freebsd")):
|
||||||
cmd += " -ldl"
|
cmd += " -ldl"
|
||||||
if (sys.platform == "darwin"):
|
if (sys.platform == "darwin"):
|
||||||
cmd += " -isysroot " + SDK["MACOSX"] + " -Wl,-syslibroot," + SDK["MACOSX"] + " -arch ppc -arch i386"
|
cmd += " -isysroot " + SDK["MACOSX"] + " -Wl,-syslibroot," + SDK["MACOSX"] + " -arch i386"
|
||||||
|
if ("NOPPC" not in opts): cmd += " -arch ppc"
|
||||||
|
|
||||||
oscmd(cmd)
|
oscmd(cmd)
|
||||||
os.system("chmod +x " + BracketNameWithQuotes(dll))
|
os.system("chmod +x " + BracketNameWithQuotes(dll))
|
||||||
@ -913,6 +914,45 @@ def FreezePy(target, src, opts):
|
|||||||
if (not os.path.exists(target)):
|
if (not os.path.exists(target)):
|
||||||
exit("")
|
exit("")
|
||||||
|
|
||||||
|
##########################################################################################
|
||||||
|
#
|
||||||
|
# CompileBundle
|
||||||
|
#
|
||||||
|
##########################################################################################
|
||||||
|
|
||||||
|
def CompileBundle(target, inputs, opts):
|
||||||
|
if (sys.platform != "darwin"): return
|
||||||
|
plist = None
|
||||||
|
resources = []
|
||||||
|
objects = []
|
||||||
|
for i in inputs:
|
||||||
|
if (i.endswith(".plist")):
|
||||||
|
if (plist != None): exit("Only one plist file can be used when creating a bundle!")
|
||||||
|
plist = i
|
||||||
|
elif (i.endswith(".rsrc")):
|
||||||
|
resources.append(i)
|
||||||
|
elif (GetOrigExt(i) == ".obj"):
|
||||||
|
objects.append(i)
|
||||||
|
else:
|
||||||
|
exit("Don't know how to bundle file %s" % i)
|
||||||
|
|
||||||
|
# Now link the object files to form the bundle.
|
||||||
|
if (plist == None): exit("One plist file must be used when creating a bundle!")
|
||||||
|
try:
|
||||||
|
plistXML = parse(plist)
|
||||||
|
plistXML.getElementsByTagName("plist")[0]
|
||||||
|
plistXML.getElementsByTagName("dict")[0]
|
||||||
|
bundleName = plistXML.getElementsByTagName("CFBundleExecutable")[0]
|
||||||
|
except:
|
||||||
|
exit("Error parsing plist file %s" % plist)
|
||||||
|
|
||||||
|
oscmd("rm -rf %s" % target)
|
||||||
|
oscmd("mkdir -p %s/Contents/MacOS/" % target)
|
||||||
|
CompileLink("%s/Contents/MacOS/%s" % (target, bundleName), objects, opts + ["BUNDLE"])
|
||||||
|
oscmd("cp %s %s/Contents/Info.plist" % (plist, target))
|
||||||
|
for r in resources:
|
||||||
|
oscmd("cp %s %s/Contents/Resources/" % (plist, target))
|
||||||
|
|
||||||
##########################################################################################
|
##########################################################################################
|
||||||
#
|
#
|
||||||
# CompileAnything
|
# CompileAnything
|
||||||
@ -936,6 +976,8 @@ def CompileAnything(target, inputs, opts):
|
|||||||
return CompileLink(target, inputs, opts)
|
return CompileLink(target, inputs, opts)
|
||||||
elif (origsuffix==".in"):
|
elif (origsuffix==".in"):
|
||||||
return CompileIgate(target, inputs, opts)
|
return CompileIgate(target, inputs, opts)
|
||||||
|
elif (origsuffix==".plugin"):
|
||||||
|
return CompileBundle(target, inputs, opts)
|
||||||
elif (origsuffix==".pz"):
|
elif (origsuffix==".pz"):
|
||||||
return CompileEggPZ(target, infile, opts)
|
return CompileEggPZ(target, infile, opts)
|
||||||
elif (origsuffix in [".res", ".rsrc"]):
|
elif (origsuffix in [".res", ".rsrc"]):
|
||||||
@ -2983,12 +3025,20 @@ if (PkgSkip("PLUGIN")==0 and PkgSkip("TINYXML")==0 and PkgSkip("NPAPI")==0):
|
|||||||
|
|
||||||
OPTS=['DIR:direct/src/plugin_npapi', 'NPAPI', 'TINYXML']
|
OPTS=['DIR:direct/src/plugin_npapi', 'NPAPI', 'TINYXML']
|
||||||
TargetAdd('plugin_npapi_nppanda3d_composite1.obj', opts=OPTS, input='nppanda3d_composite1.cxx')
|
TargetAdd('plugin_npapi_nppanda3d_composite1.obj', opts=OPTS, input='nppanda3d_composite1.cxx')
|
||||||
TargetAdd('nppanda3d.dll', input='plugin_common.obj')
|
|
||||||
TargetAdd('nppanda3d.dll', input='plugin_npapi_nppanda3d_composite1.obj')
|
if (sys.platform=="darwin"):
|
||||||
if (sys.platform.startswith("win")):
|
TargetAdd('nppanda3d.plugin', input='plugin_common.obj')
|
||||||
TargetAdd('nppanda3d.dll', input='nppanda3d.res')
|
TargetAdd('nppanda3d.plugin', input='plugin_npapi_nppanda3d_composite1.obj')
|
||||||
TargetAdd('nppanda3d.dll', input='nppanda3d.def', ipath=OPTS)
|
TargetAdd('nppanda3d.plugin', input='nppanda3d.rsrc')
|
||||||
TargetAdd('nppanda3d.dll', opts=['NPAPI', 'TINYXML', 'OPENSSL', 'WINUSER', 'WINSHELL'])
|
TargetAdd('nppanda3d.plugin', input='nppanda3d.plist')
|
||||||
|
TargetAdd('nppanda3d.plugin', opts=['NPAPI', 'TINYXML', 'OPENSSL', 'CARBON'])
|
||||||
|
else:
|
||||||
|
TargetAdd('nppanda3d.dll', input='plugin_common.obj')
|
||||||
|
TargetAdd('nppanda3d.dll', input='plugin_npapi_nppanda3d_composite1.obj')
|
||||||
|
if (sys.platform.startswith("win")):
|
||||||
|
TargetAdd('nppanda3d.dll', input='nppanda3d.res')
|
||||||
|
TargetAdd('nppanda3d.dll', input='nppanda3d.def', ipath=OPTS)
|
||||||
|
TargetAdd('nppanda3d.dll', opts=['NPAPI', 'TINYXML', 'OPENSSL', 'WINUSER', 'WINSHELL'])
|
||||||
|
|
||||||
#
|
#
|
||||||
# DIRECTORY: direct/src/plugin_standalone/
|
# DIRECTORY: direct/src/plugin_standalone/
|
||||||
@ -3011,6 +3061,8 @@ if (PkgSkip("PLUGIN")==0 and PkgSkip("TINYXML")==0):
|
|||||||
TargetAdd('panda3d.exe', input='express_composite2.obj')
|
TargetAdd('panda3d.exe', input='express_composite2.obj')
|
||||||
if (sys.platform == 'darwin'):
|
if (sys.platform == 'darwin'):
|
||||||
TargetAdd('panda3d.exe', input='dtoolutil_filename_assist.obj')
|
TargetAdd('panda3d.exe', input='dtoolutil_filename_assist.obj')
|
||||||
|
TargetAdd('panda3d.exe', input='interrogatedb_composite.obj')
|
||||||
|
TargetAdd('panda3d.exe', input='libexpress_igate.obj')
|
||||||
TargetAdd('panda3d.exe', opts=['PYTHON', 'TINYXML', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL'])
|
TargetAdd('panda3d.exe', opts=['PYTHON', 'TINYXML', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL'])
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -556,7 +556,7 @@ def DeleteCVS(dir):
|
|||||||
shutil.rmtree(subdir)
|
shutil.rmtree(subdir)
|
||||||
else:
|
else:
|
||||||
DeleteCVS(subdir)
|
DeleteCVS(subdir)
|
||||||
elif (os.path.isfile(subdir) and entry == ".cvsignore"):
|
elif (os.path.isfile(subdir) and (entry == ".cvsignore" or entry.startswith(".#")):
|
||||||
os.remove(subdir)
|
os.remove(subdir)
|
||||||
|
|
||||||
def DeleteBuildFiles(dir):
|
def DeleteBuildFiles(dir):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user