X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=scripts%2Fbuild%2Fmacosx_makebundle.py;h=f3b86da42df7d5ea81b70ebb7c4372718cd1c58f;hb=a3e246a727c1646248527e06886ba02174f75d92;hp=8ac439678a5a710a897a7c27bfbd1c19af23419a;hpb=12d5b08ebc07113674642483bdaad9bcd63a9a95;p=quassel.git diff --git a/scripts/build/macosx_makebundle.py b/scripts/build/macosx_makebundle.py index 8ac43967..f3b86da4 100755 --- a/scripts/build/macosx_makebundle.py +++ b/scripts/build/macosx_makebundle.py @@ -16,6 +16,7 @@ import os import os.path import sys +import commands # ============================== # Constants @@ -26,7 +27,7 @@ if len(sys.argv) < 2: SOURCE_DIR = sys.argv[1] if len(sys.argv) < 4: - BUNDLE_NAME= "Quassel Client" + BUNDLE_NAME = "Quassel Client" EXE_NAME = "quasselclient" else: EXE_NAME = sys.argv[3] @@ -37,9 +38,10 @@ if(os.path.dirname(EXE_NAME)): CONTENTS_DIR = os.path.dirname(EXE_NAME) + "/" CONTENTS_DIR += BUNDLE_NAME + ".app/Contents/" -BUNDLE_VERSION = "0.3.0" +BUNDLE_VERSION = commands.getoutput("git --git-dir=" + SOURCE_DIR + "/.git/ describe") ICON_FILE = "pics/quassel.icns" + def createBundle(): try: os.makedirs(CONTENTS_DIR + "MacOS") @@ -47,23 +49,24 @@ def createBundle(): except: pass + def copyFiles(exeFile, iconFile): os.system("cp %s %sMacOs/%s" % (exeFile, CONTENTS_DIR.replace(' ', '\ '), BUNDLE_NAME.replace(' ', '\ '))) os.system("cp %s/%s %s/Resources" % (SOURCE_DIR, iconFile, CONTENTS_DIR.replace(' ', '\ '))) + def createPlist(bundleName, iconFile, bundleVersion): templateFile = file(SOURCE_DIR + "/scripts/build/Info.plist", 'r') template = templateFile.read() templateFile.close() plistFile = file(CONTENTS_DIR + "Info.plist", 'w') - plistFile.write(template % {"BUNDLE_NAME" : bundleName, - "ICON_FILE" : iconFile[iconFile.rfind("/")+1:], - "BUNDLE_VERSION" : bundleVersion}) + plistFile.write(template % {"BUNDLE_NAME": bundleName, + "ICON_FILE": iconFile[iconFile.rfind("/") + 1:], + "BUNDLE_VERSION": bundleVersion}) plistFile.close() if __name__ == "__main__": createBundle() createPlist(BUNDLE_NAME, ICON_FILE, BUNDLE_VERSION) copyFiles(EXE_NAME, ICON_FILE) - pass