Better packaging in makepanda

This commit is contained in:
rdb 2009-09-12 10:50:05 +00:00
parent 5f4fe3bc32
commit 6529e5c0a8
3 changed files with 31 additions and 21 deletions

View File

@ -29,11 +29,15 @@ class images(package):
basename = '%s.png' % (name)
filename = Filename('plugin_images/%s' % (basename))
found = filename.resolveFilename(getModelPath().getValue())
if not found:
found = filename.resolveFilename("models")
if not found:
# Then try a jpeg image.
basename = '%s.jpg' % (name)
filename = Filename('plugin_images/%s' % (basename))
found = filename.resolveFilename(getModelPath().getValue())
if not found:
found = filename.resolveFilename("models")
if found:
# Add the image file to the package

View File

@ -75,6 +75,7 @@ def usage(problem):
print "compiled copy of Panda3D. Command-line arguments are:"
print ""
print " --help (print the help message you're reading now)"
print " --verbose (print out more information)"
print " --installer (build an installer)"
print " --optimize X (optimization level can be 1,2,3,4)"
print " --version (set the panda version number)"
@ -264,6 +265,7 @@ else:
builtdir = os.path.join(os.path.abspath(GetOutputDir()))
AddToPathEnv("PYTHONPATH", builtdir)
AddToPathEnv("PANDA_PRC_DIR", os.path.join(builtdir, "etc"))
if (sys.platform.startswith("win")):
AddToPathEnv("PYTHONPATH", os.path.join(builtdir, "bin"))
else:
@ -936,6 +938,19 @@ def FreezePy(target, inputs, opts):
if (not os.path.exists(target)):
exit("")
##########################################################################################
#
# Package
#
##########################################################################################
def Package(target, inputs, opts):
# Invoke the ppackage script.
command = SDK["PYTHONEXEC"] + " direct/src/p3d/ppackage.py"
command += " -i \"" + GetOutputDir() + "/stage\""
command += " direct/src/p3d/panda3d.pdef"
oscmd(command)
##########################################################################################
#
# CompileBundle
@ -993,6 +1008,9 @@ def CompileAnything(target, inputs, opts, progress = None):
else:
ProgressOutput(progress, "Building frozen library", target)
return FreezePy(target, inputs, opts)
elif (infile.endswith(".pdef")):
ProgressOutput(progress, "Building package from pdef file", infile)
return Package(target, inputs, opts)
elif SUFFIX_LIB.count(origsuffix):
ProgressOutput(progress, "Linking static library", target)
return CompileLib(target, inputs, opts)
@ -4007,6 +4025,14 @@ if (PkgSkip("PYTHON")==0):
TargetAdd('packpanda.exe', input='direct/src/directscripts/packpanda.py')
TargetAdd('eggcacher.exe', input='direct/src/directscripts/eggcacher.py')
#
# Build the runtime.
#
if (RUNTIME):
OPTS=['DIR:direct/src/p3d']
TargetAdd('panda3d', opts=OPTS, input='panda3d.pdef')
#
# Generate the models directory and samples directory
#
@ -4143,27 +4169,6 @@ except:
SaveDependencyCache()
raise
##########################################################################################
#
# The Runtime
#
# This is a package that can be uploaded to a web server, to host panda3d versions
# for the plugin.
#
##########################################################################################
def MakeRuntime():
# Invoke the ppackage script.
command = SDK["PYTHONEXEC"] + " direct/src/p3d/ppackage.py"
command += " -i \"" + GetOutputDir() + "/stage\""
command += " direct/src/p3d/panda3d.pdef"
oscmd(command)
print "Runtime output stored in \"" + GetOutputDir() + "/stage\"."
if (RUNTIME != 0):
MakeRuntime()
##########################################################################################
#
# The Installers

View File

@ -1280,6 +1280,7 @@ def CalcLocation(fn, ipath):
if (fn.endswith(".c")): return CxxFindSource(fn, ipath)
if (fn.endswith(".yxx")): return CxxFindSource(fn, ipath)
if (fn.endswith(".lxx")): return CxxFindSource(fn, ipath)
if (fn.endswith(".pdef")):return CxxFindSource(fn, ipath)
if (sys.platform.startswith("win")):
if (fn.endswith(".def")): return CxxFindSource(fn, ipath)
if (fn.endswith(".rc")): return CxxFindSource(fn, ipath)