summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-11-28 10:19:54 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-11-28 10:19:54 (GMT)
commit647213f7c9bdc5b60c863ee56302f380869befe7 (patch)
treeb4c2e1afbdb1ba96a5afbe8954435153a77ab12b
parentbafe5e6d6386f40f254b5da752545b5f9f41d316 (diff)
downloadswift-647213f7c9bdc5b60c863ee56302f380869befe7.zip
swift-647213f7c9bdc5b60c863ee56302f380869befe7.tar.bz2
Create a dist target for mac DMG bundling.
-rw-r--r--BuildTools/SCons/Tools/AppBundle.py5
-rw-r--r--Swift/QtUI/.gitignore1
-rw-r--r--Swift/QtUI/SConscript7
3 files changed, 11 insertions, 2 deletions
diff --git a/BuildTools/SCons/Tools/AppBundle.py b/BuildTools/SCons/Tools/AppBundle.py
index 3d06e97..12667f0 100644
--- a/BuildTools/SCons/Tools/AppBundle.py
+++ b/BuildTools/SCons/Tools/AppBundle.py
@@ -1,49 +1,52 @@
import SCons.Util
def generate(env) :
def createAppBundle(env, bundle, version = "1.0", resources = [], frameworks = [], info = {}) :
- bundleContentsDir = bundle + ".app" + "/Contents"
+ bundleDir = bundle + ".app"
+ bundleContentsDir = bundleDir + "/Contents"
resourcesDir = bundleContentsDir + "/Resources"
frameworksDir = bundleContentsDir + "/Frameworks"
env.Install(bundleContentsDir + "/MacOS", bundle)
env.WriteVal(bundleContentsDir + "/PkgInfo", env.Value("APPL\77\77\77\77"))
infoDict = {
"CFBundleDevelopmentRegion" : "English",
"CFBundleExecutable" : bundle,
"CFBundleIdentifier" : "im.swift." + bundle,
"CFBundleInfoDictionaryVersion" : "6.0",
"CFBundleName" : bundle,
"CFBundlePackageType" : "APPL",
"CFBundleSignature": "\77\77\77\77",
"CFBundleVersion" : version,
"CFBundleIconFile" : bundle,
"NSPrincipalClass" : "NSApplication",
"NSHumanReadableCopyright" : unichr(0xA9) + " 2009 Swift Development Team.\nAll Rights Reserved."
}
infoDict.update(info)
plist = """<?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>
"""
for key, value in infoDict.items() :
plist += "<key>" + key + "</key>\n"
plist += "<string>" + value.encode("utf-8") + "</string>\n"
plist += """</dict>
</plist>
"""
env.WriteVal(bundleContentsDir + "/Info.plist", env.Value(plist))
for resource in resources :
env.Install(resourcesDir, resource)
for framework in frameworks :
env.Install(frameworksDir, framework)
+ return env.Dir(bundleDir)
+
env.AddMethod(createAppBundle, "AppBundle")
def exists(env) :
return env["PLATFORM"] == "darwin"
diff --git a/Swift/QtUI/.gitignore b/Swift/QtUI/.gitignore
index b776b0d..379d4f5 100644
--- a/Swift/QtUI/.gitignore
+++ b/Swift/QtUI/.gitignore
@@ -1,2 +1,3 @@
Swift
BuildVersion.h
+Swift-*.dmg
diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript
index b7eefaf..77bc8f8 100644
--- a/Swift/QtUI/SConscript
+++ b/Swift/QtUI/SConscript
@@ -62,67 +62,72 @@ sources = [
"QtMainWindowFactory.cpp",
"QtSettingsProvider.cpp",
"QtStatusWidget.cpp",
"QtSwift.cpp",
"QtChatView.cpp",
"QtChatTabs.cpp",
"QtSoundPlayer.cpp",
"QtSystemTray.cpp",
"QtTabbable.cpp",
"QtTextEdit.cpp",
"QtXMLConsoleWidgetFactory.cpp",
"QtXMLConsoleWidget.cpp",
"ChatSnippet.cpp",
"MessageSnippet.cpp",
"SystemMessageSnippet.cpp",
"Roster/RosterModel.cpp",
"Roster/QtTreeWidget.cpp",
"Roster/QtTreeWidgetItem.cpp",
"Roster/RosterDelegate.cpp",
"EventViewer/EventView.cpp",
"EventViewer/EventModel.cpp",
"EventViewer/EventDelegate.cpp",
"QtRosterHeader.cpp",
"qrc_DefaultTheme.cc",
"qrc_Swift.cc",
]
myenv.BuildVersion("BuildVersion.h", version = env["SWIFT_VERSION"])
if env["PLATFORM"] == "win32" :
myenv.RES("../resources/Windows/Swift.rc")
sources += ["../resources/Windows/Swift.res"]
if env["PLATFORM"] == "darwin" or env["PLATFORM"] == "win32" :
swiftProgram = myenv.Program("Swift", sources)
else :
swiftProgram = myenv.Program("swift", sources)
myenv.Uic4("QtJoinMUCDialog.ui")
myenv.Uic4("QtAddContactDialog.ui")
myenv.Qrc("DefaultTheme.qrc")
myenv.Qrc("Swift.qrc")
if env["PLATFORM"] == "darwin" :
frameworks = []
if env["HAVE_SPARKLE"] :
frameworks.append(env["SPARKLE_FRAMEWORK"])
- myenv.AppBundle("Swift", version = env["SWIFT_VERSION"], resources = ["../resources/MacOSX/Swift.icns"], frameworks = frameworks)
+ app = myenv.AppBundle("Swift", version = env["SWIFT_VERSION"], resources = ["../resources/MacOSX/Swift.icns"], frameworks = frameworks)
+ if "dist" in COMMAND_LINE_TARGETS :
+ myenv.Command(["Swift-${SWIFT_VERSION}.dmg"], [app], [
+ "$QTDIR/bin/macdeployqt $SOURCE -dmg",
+ Move("$TARGET", "$SOURCE.dir/Swift.dmg")
+ ])
if env.get("SWIFT_INSTALLDIR", "") :
env.Install(os.path.join(env["SWIFT_INSTALLDIR"], "bin"), swiftProgram)
if env["PLATFORM"] == "win32" :
if "dist" in COMMAND_LINE_TARGETS or env.GetOption("clean") :
myenv.WindowsBundle("Swift", resources = [
os.path.join(env["OPENSSL_DIR"], "bin", "ssleay32.dll"),
os.path.join(env["OPENSSL_DIR"], "bin", "libeay32.dll"),
],
qtimageformats = ["gif", "ico", "jpeg", "mng", "svg", "tiff"],
qtlibs = ["QtCore4", "QtGui4", "QtNetwork4", "QtWebKit4"])
myenv.Append(NSIS_OPTIONS = [
"/DmsvccRedistributableDir=\"" + env["vcredist"] + "\"",
"/DbuildVersion=" + env["SWIFT_VERSION"]
])
myenv.Nsis("../Packaging/nsis/swift.nsi")