From 504ecaee5e520eea49cd2166ca316f665945b877 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Tue, 9 Feb 2010 15:42:48 +0100 Subject: [PATCH] Straightened out qt's packaging process. --- package.py | 65 ++++++++++++++++++++++++++++++++++++++------------ qt/me/build.py | 43 --------------------------------- qt/pe/build.py | 45 ---------------------------------- qt/se/build.py | 45 ---------------------------------- 4 files changed, 50 insertions(+), 148 deletions(-) delete mode 100644 qt/me/build.py delete mode 100644 qt/pe/build.py delete mode 100644 qt/se/build.py diff --git a/package.py b/package.py index 04ce8851..495a36ca 100644 --- a/package.py +++ b/package.py @@ -13,7 +13,54 @@ import os.path as op import yaml -from hsutil.build import build_dmg, add_to_pythonpath +from hsutil.build import build_dmg, add_to_pythonpath, print_and_do + +def package_cocoa(edition): + app_path = { + 'se': 'cocoa/se/build/release/dupeGuru.app', + 'me': 'cocoa/me/build/release/dupeGuru ME.app', + 'pe': 'cocoa/pe/build/release/dupeGuru PE.app', + }[edition] + build_dmg(app_path, '.') + +def package_qt(edition): + # On Windows, PyInstaller is used to build an exe (py2exe creates a very bad looking icon) + # The release version is outdated. Use at least r672 on http://svn.pyinstaller.org/trunk + if sys.platform != "win32": + print "Qt packaging only works under Windows." + return + add_to_pythonpath('.') + add_to_pythonpath('qt') + os.chdir(op.join('qt', edition)) + from app import DupeGuru + + # Removing build and dist + if op.exists('build'): + shutil.rmtree('build') + if op.exists('dist'): + shutil.rmtree('dist') + version = DupeGuru.VERSION + versioncomma = version.replace('.', ', ') + ', 0' + verinfo = open('verinfo').read() + verinfo = verinfo.replace('$versioncomma', versioncomma).replace('$version', version) + fp = open('verinfo_tmp', 'w') + fp.write(verinfo) + fp.close() + print_and_do("python C:\\Python26\\pyinstaller\\Build.py dg{0}.spec".format(edition)) + os.remove('verinfo_tmp') + + print_and_do("del dist\\*90.dll") # They're in vcredist, no need to include them + print_and_do("del dist\\POWRPROF.dll") # no need of that crap + print_and_do("del dist\\SHLWAPI.dll") # no need of that crap + print_and_do("xcopy /Y /S /I ..\\..\\help_me\\dupeguru_me_help dist\\help") + + # AdvancedInstaller.com has to be in your PATH + # this is so we don'a have to re-commit installer.aip at every version change + shutil.copy('installer.aip', 'installer_tmp.aip') + print_and_do('AdvancedInstaller.com /edit installer_tmp.aip /SetVersion %s' % version) + print_and_do('AdvancedInstaller.com /build installer_tmp.aip -force') + os.remove('installer_tmp.aip') + os.chdir(op.join('..', '..')) def main(): conf = yaml.load(open('conf.yaml')) @@ -25,21 +72,9 @@ def main(): return print "Packaging dupeGuru {0} with UI {1}".format(edition.upper(), ui) if ui == 'cocoa': - app_path = { - 'se': 'cocoa/se/build/release/dupeGuru.app', - 'me': 'cocoa/me/build/release/dupeGuru ME.app', - 'pe': 'cocoa/pe/build/release/dupeGuru PE.app', - }[edition] - build_dmg(app_path, '.') + package_cocoa(edition) elif ui == 'qt': - if sys.platform != "win32": - print "Qt packaging only works under Windows." - return - add_to_pythonpath('.') - add_to_pythonpath('qt') - os.chdir(op.join('qt', edition)) - os.system('python build.py') - os.chdir(op.join('..', '..')) + package_qt(edition) if __name__ == '__main__': main() \ No newline at end of file diff --git a/qt/me/build.py b/qt/me/build.py deleted file mode 100644 index 7362d2b3..00000000 --- a/qt/me/build.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env python -# Created By: Virgil Dupras -# Created On: 2009-05-22 -# Copyright 2010 Hardcoded Software (http://www.hardcoded.net) -# -# This software is licensed under the "HS" License as described in the "LICENSE" file, -# which should be included with this package. The terms are also available at -# http://www.hardcoded.net/licenses/hs_license - -# On Windows, PyInstaller is used to build an exe (py2exe creates a very bad looking icon) -# The release version is outdated. Use at least r672 on http://svn.pyinstaller.org/trunk - -import os -import os.path as op -import shutil - -from hsutil.build import print_and_do -from app import DupeGuru - -# Removing build and dist -if op.exists('build'): - shutil.rmtree('build') -if op.exists('dist'): - shutil.rmtree('dist') - -version = DupeGuru.VERSION -versioncomma = version.replace('.', ', ') + ', 0' -verinfo = open('verinfo').read() -verinfo = verinfo.replace('$versioncomma', versioncomma).replace('$version', version) -fp = open('verinfo_tmp', 'w') -fp.write(verinfo) -fp.close() -print_and_do("python C:\\Python26\\pyinstaller\\Build.py dgme.spec") -os.remove('verinfo_tmp') - -print_and_do("del dist\\*90.dll") # They're in vcredist, no need to include them -print_and_do("xcopy /Y /S /I ..\\..\\help_me\\dupeguru_me_help dist\\help") - -# AdvancedInstaller.com has to be in your PATH -shutil.copy('installer.aip', 'installer_tmp.aip') # this is so we don'a have to re-commit installer.aip at every version change -print_and_do('AdvancedInstaller.com /edit installer_tmp.aip /SetVersion %s' % version) -print_and_do('AdvancedInstaller.com /build installer_tmp.aip -force') -os.remove('installer_tmp.aip') \ No newline at end of file diff --git a/qt/pe/build.py b/qt/pe/build.py deleted file mode 100644 index 751d4eac..00000000 --- a/qt/pe/build.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python -# Created By: Virgil Dupras -# Created On: 2009-05-22 -# Copyright 2010 Hardcoded Software (http://www.hardcoded.net) -# -# This software is licensed under the "HS" License as described in the "LICENSE" file, -# which should be included with this package. The terms are also available at -# http://www.hardcoded.net/licenses/hs_license - -# On Windows, PyInstaller is used to build an exe (py2exe creates a very bad looking icon -# The release version is outdated. Use at least r672 on http://svn.pyinstaller.org/trunk - -import os -import os.path as op -import shutil -from app import DupeGuru - -def print_and_do(cmd): - print cmd - os.system(cmd) - -# Removing build and dist -if op.exists('build'): - shutil.rmtree('build') -if op.exists('dist'): - shutil.rmtree('dist') - -version = DupeGuru.VERSION -versioncomma = version.replace('.', ', ') + ', 0' -verinfo = open('verinfo').read() -verinfo = verinfo.replace('$versioncomma', versioncomma).replace('$version', version) -fp = open('verinfo_tmp', 'w') -fp.write(verinfo) -fp.close() -print_and_do("python C:\\Python26\\pyinstaller\\Build.py dgpe.spec") -os.remove('verinfo_tmp') - -print_and_do("del dist\\*90.dll") # They're in vcredist, no need to include them -print_and_do("xcopy /Y /S /I ..\\..\\help_pe\\dupeguru_pe_help dist\\help") - -# AdvancedInstaller.com has to be in your PATH -shutil.copy('installer.aip', 'installer_tmp.aip') # this is so we don'a have to re-commit installer.aip at every version change -print_and_do('AdvancedInstaller.com /edit installer_tmp.aip /SetVersion %s' % version) -print_and_do('AdvancedInstaller.com /build installer_tmp.aip -force') -os.remove('installer_tmp.aip') \ No newline at end of file diff --git a/qt/se/build.py b/qt/se/build.py deleted file mode 100644 index e8673ae5..00000000 --- a/qt/se/build.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python -# Created By: Virgil Dupras -# Created On: 2009-05-24 -# Copyright 2010 Hardcoded Software (http://www.hardcoded.net) -# -# This software is licensed under the "HS" License as described in the "LICENSE" file, -# which should be included with this package. The terms are also available at -# http://www.hardcoded.net/licenses/hs_license - -# On Windows, PyInstaller is used to build an exe (py2exe creates a very bad looking icon -# The release version is outdated. Use at least r672 on http://svn.pyinstaller.org/trunk - -import os -import os.path as op -import shutil -from app import DupeGuru - -def print_and_do(cmd): - print cmd - os.system(cmd) - -# Removing build and dist -if op.exists('build'): - shutil.rmtree('build') -if op.exists('dist'): - shutil.rmtree('dist') - -version = DupeGuru.VERSION -versioncomma = version.replace('.', ', ') + ', 0' -verinfo = open('verinfo').read() -verinfo = verinfo.replace('$versioncomma', versioncomma).replace('$version', version) -fp = open('verinfo_tmp', 'w') -fp.write(verinfo) -fp.close() -print_and_do("python C:\\Python26\\pyinstaller\\Build.py dgse.spec") -os.remove('verinfo_tmp') - -print_and_do("del dist\\*90.dll") # They're in vcredist, no need to include them -print_and_do("xcopy /Y /S /I ..\\..\\help_se\\dupeguru_help dist\\help") - -# AdvancedInstaller.com has to be in your PATH -shutil.copy('installer.aip', 'installer_tmp.aip') # this is so we don'a have to re-commit installer.aip at every version change -print_and_do('AdvancedInstaller.com /edit installer_tmp.aip /SetVersion %s' % version) -print_and_do('AdvancedInstaller.com /build installer_tmp.aip -force') -os.remove('installer_tmp.aip') \ No newline at end of file