From 9bcebb552f86988d3be16e4471d283032b5911f6 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 18 Dec 2010 22:31:24 +0000 Subject: [PATCH] Add -a flag to ppackage to allow all .p3d scripts to have a suffix --- direct/src/p3d/Packager.py | 7 +++++++ direct/src/p3d/ppackage.py | 17 ++++++++++++++--- makepanda/makepanda.py | 9 +++++++-- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/direct/src/p3d/Packager.py b/direct/src/p3d/Packager.py index 6b3975bf4c..a609926a51 100644 --- a/direct/src/p3d/Packager.py +++ b/direct/src/p3d/Packager.py @@ -671,6 +671,7 @@ class Packager: self.packageDesc = self.packageBasename + '.xml' self.packageImportDesc = self.packageBasename + '.import.xml' if self.p3dApplication: + self.packageBasename += self.packager.p3dSuffix self.packageBasename += '.p3d' packageDir = '' else: @@ -1971,6 +1972,10 @@ class Packager: # e.g. for testing and development. self.ignoreSetHost = False + # This will be appended to the basename of any .p3d package, + # before the .p3d extension. + self.p3dSuffix = '' + # The download URL at which these packages will eventually be # hosted. self.hosts = {} @@ -2168,6 +2173,8 @@ class Packager: GlobPattern('libGL.so*'), GlobPattern('libGLU.so*'), GlobPattern('libGLcore.so*'), + GlobPattern('libGLES*.so*'), + GlobPattern('libEGL.so*'), GlobPattern('libX*.so*'), GlobPattern('libxcb*.so*'), GlobPattern('libc.so*'), diff --git a/direct/src/p3d/ppackage.py b/direct/src/p3d/ppackage.py index cb5bb23eb3..bdd65e0dde 100755 --- a/direct/src/p3d/ppackage.py +++ b/direct/src/p3d/ppackage.py @@ -110,9 +110,16 @@ Options: -H Treats a packager.setHost() call in the pdef file as if it were merely a call to packager.addHost(). This allows producing a - package for an alternate host than its normally configured host, + package for an alternate host than itsP3DSUFFIX normally configured host, which is sometimes useful in development. + -a suffix + Appends the given suffix to the p3d filename, before the extension. + This is useful when the same packages are compiled several times + but using different settings, and you want to mark those packages + as such. This only applies to .p3d packages, not to other types + of packages! + -h Display this help """ @@ -137,10 +144,11 @@ allowPythonDev = False universalBinaries = False systemRoot = None ignoreSetHost = False +p3dSuffix = '' platforms = [] try: - opts, args = getopt.getopt(sys.argv[1:], 'i:ps:S:DuP:R:Hh') + opts, args = getopt.getopt(sys.argv[1:], 'i:ps:S:DuP:R:Ha:h') except getopt.error, msg: usage(1, msg) @@ -167,7 +175,9 @@ for opt, arg in opts: systemRoot = arg elif opt == '-H': ignoreSetHost = True - + elif opt == '-a': + p3dSuffix = arg + elif opt == '-h': usage(0) else: @@ -211,6 +221,7 @@ for platform in platforms: packager.allowPythonDev = allowPythonDev packager.systemRoot = systemRoot packager.ignoreSetHost = ignoreSetHost + packager.p3dSuffix = p3dSuffix try: packager.setup() diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index c3e9c7ef93..48ce77ab6f 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -47,6 +47,7 @@ DISTRIBUTOR="" VERSION=None DEBVERSION=None RPMRELEASE="1" +P3DSUFFIX="" MAJOR_VERSION=None COREAPI_VERSION=None OSXTARGET=None @@ -123,12 +124,13 @@ def usage(problem): def parseopts(args): global INSTALLER,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION - global COMPRESSOR,THREADCOUNT,OSXTARGET,HOST_URL,DEBVERSION,RPMRELEASE + global COMPRESSOR,THREADCOUNT,OSXTARGET,HOST_URL + global DEBVERSION,RPMRELEASE,P3DSUFFIX longopts = [ "help","distributor=","verbose","runtime","osxtarget=", "optimize=","everything","nothing","installer","rtdist","nocolor", "version=","lzma","no-python","threads=","outputdir=","override=", - "static","host=","debversion=","rpmrelease="] + "static","host=","debversion=","rpmrelease=","p3dsuffix="] anything = 0 optimize = "" for pkg in PkgListGet(): longopts.append("no-"+pkg.lower()) @@ -159,6 +161,7 @@ def parseopts(args): elif (option=="--host"): HOST_URL=value elif (option=="--debversion"): DEBVERSION=value elif (option=="--rpmrelease"): RPMRELEASE=value + elif (option=="--p3dsuffix"): P3DSUFFIX=value # Backward compatibility, OPENGL was renamed to GL elif (option=="--use-opengl"): PkgEnable("GL") elif (option=="--no-opengl"): PkgDisable("GL") @@ -1148,6 +1151,8 @@ def Package(target, inputs, opts): if (sys.platform == "darwin" and "MACOSX" in SDK and SDK["MACOSX"] != None and len(SDK["MACOSX"]) > 1): command += " -R \"%s\"" % SDK["MACOSX"] command += " -i \"" + GetOutputDir() + "/stage\"" + if (P3DSUFFIX): + command += ' -a "' + P3DSUFFIX + '"' command += " " + inputs[0] oscmd(command)