pdeploy is now fully working for all platforms, I think.

This commit is contained in:
rdb 2009-12-25 20:35:43 +00:00
parent 78a557f4ec
commit 0f1a3e13d7
2 changed files with 30 additions and 2 deletions

View File

@ -4,12 +4,11 @@ to build for as many platforms as possible. """
__all__ = ["Standalone", "Installer"]
import os, sys, subprocess, tarfile, shutil, time
import os, sys, subprocess, tarfile, shutil, time, zipfile
from direct.directnotify.DirectNotifyGlobal import *
from pandac.PandaModules import PandaSystem, HTTPClient, Filename, VirtualFileSystem
from direct.p3d.HostInfo import HostInfo
from direct.showbase.AppRunnerGlobal import appRunner
import glob
class CachedFile:
def __init__(self): self.str = ""
@ -415,6 +414,19 @@ class Installer:
archive.add(appfn.toOsSpecific(), appname)
archive.close()
# Put the .pkg into a zipfile
archive = Filename(output.getDirname(), "%s %s.zip" % (self.fullname, self.version))
dir = Filename(output.getDirname())
dir.makeAbsolute()
zip = zipfile.ZipFile(archive.toOsSpecific(), 'w')
for root, dirs, files in os.walk(output.toOsSpecific()):
for name in files:
file = Filename.fromOsSpecific(os.path.join(root, name))
file.makeAbsolute()
file.makeRelativeTo(dir)
zip.write(os.path.join(root, name), str(file))
zip.close()
return output
def buildNSIS(self, output, platform):

View File

@ -84,6 +84,14 @@ Options:
is licensed under.
Only relevant when generating a graphical installer.
-a com.your_company
Short identifier of the author of the application. The default
is "org.panda3d", but you will most likely want to change
it to your own name or that of your organization or company.
-A "Your Company"
Full name of the author of the application.
-h
Display this help
@ -111,6 +119,8 @@ platforms = []
currentPlatform = False
licensename = ""
licensefile = Filename()
authorid = ""
authorname = ""
try:
opts, args = getopt.getopt(sys.argv[1:], 'n:N:v:o:t:P:cl:L:h')
@ -137,6 +147,10 @@ for opt, arg in opts:
licensename = arg.strip()
elif opt == '-L':
licensefile = Filename.fromOsSpecific(arg)
elif opt == '-a':
authorid = arg.strip()
elif opt == '-A':
authorname = arg.strip()
elif opt == '-h':
usage(0)
@ -197,6 +211,8 @@ elif deploy_mode == 'installer':
i = Installer(shortname, fullname, appFilename, version, tokens = tokens)
i.licensename = licensename
i.licensefile = licensefile
i.authorid = authorid
i.authorname = authorname
if currentPlatform:
platform = PandaSystem.getPlatform()