From 407d887f2a6a6e2cd9d856ffac99a4e68bea17ff Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Wed, 26 May 2010 21:30:20 +0200 Subject: [PATCH 1/6] - Complete the help text. - Modify for running from the "scripts" directory. --- resources/pyinstaller/windows-builder.py | 50 ++++++++++++++++-------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/resources/pyinstaller/windows-builder.py b/resources/pyinstaller/windows-builder.py index 42592768a..42dd90bf4 100644 --- a/resources/pyinstaller/windows-builder.py +++ b/resources/pyinstaller/windows-builder.py @@ -28,11 +28,29 @@ Windows Build Script -------------------- This script is used to build the Windows binary and the accompanying installer. +For this script to work out of the box, it depends on a number of things: + +windows-builder.py + This script, of course. It should be in the "scripts" directory of OpenLP. + +Bazaar + You need the command line "bzr" client installed. + +OpenLP + A checkout of the latest code, in a branch directory, which is in a Bazaar + shared repository directory. This means your code should be in a directory + structure like this: "openlp\branch-name". + + You can + +PyInstaller + PyInstaller should be a checkout of trunk, and in a directory called, + "pyinstaller" on the same level as OpenLP's Bazaar shared repository + directory. + +Inno Setup 5 + Inno Setup should be installed into "C:\%PROGRAMFILES%\Inno Setup 5" -For this script to work out of the box, it depends on being inside the -"resources/pyinstaller" directory in the OpenLP source tree, it depends on -OpenLP having it's own project directory which all the branches live in, and it -depends on PyInstaller being """ import os @@ -40,12 +58,12 @@ from shutil import copy from subprocess import Popen, PIPE script_path = os.path.split(os.path.abspath(__file__))[0] -pyinstaller_path = os.path.abspath(os.path.join(script_path, u'..', u'..', u'..', u'..', u'pyinstaller')) -innosetup_path = os.path.join(os.getenv(u'PROGRAMFILES'), 'Inno Setup 5') -iss_path = os.path.abspath(os.path.join(script_path, u'..', u'innosetup')) -branch_path = os.path.abspath(os.path.join(script_path, u'..', u'..')) +branch_path = os.path.abspath(os.path.join(script_path, u'..')) source_path = os.path.join(branch_path, u'openlp') dist_path = os.path.join(branch_path, u'dist', u'OpenLP') +pyinstaller_path = os.path.abspath(os.path.join(branch_path, u'..', u'pyinstaller')) +innosetup_path = os.path.join(os.getenv(u'PROGRAMFILES'), 'Inno Setup 5') +iss_path = os.path.join(branch_path, u'resources', u'innosetup') def run_pyinstaller(): @@ -113,17 +131,17 @@ def run_innosetup(): def main(): print "Script path:", script_path - print "PyInstaller path:", pyinstaller_path - print "Inno Setup path:", innosetup_path - print "ISS file path:", iss_path print "Branch path:", branch_path print "Source path:", source_path print "\"dist\" path:", dist_path - run_pyinstaller() - write_version_file() - copy_plugins() - copy_windows_files() - run_innosetup() + print "PyInstaller path:", pyinstaller_path + print "Inno Setup path:", innosetup_path + print "ISS file path:", iss_path + #run_pyinstaller() + #write_version_file() + #copy_plugins() + #copy_windows_files() + #run_innosetup() print "Done." if __name__ == u'__main__': From eaa0bf05e260e00aae998ffd2290934eb15c0d2f Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Wed, 26 May 2010 21:31:19 +0200 Subject: [PATCH 2/6] Moved the windows-builder.py script to the scripts directory. --- {resources/pyinstaller => scripts}/windows-builder.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {resources/pyinstaller => scripts}/windows-builder.py (100%) diff --git a/resources/pyinstaller/windows-builder.py b/scripts/windows-builder.py similarity index 100% rename from resources/pyinstaller/windows-builder.py rename to scripts/windows-builder.py From 5e1c8883e468f10c5fbafef832d4f67d314f5f44 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Wed, 26 May 2010 22:26:21 +0200 Subject: [PATCH 3/6] Added some more documentation. --- scripts/windows-builder.py | 49 +++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/scripts/windows-builder.py b/scripts/windows-builder.py index 42dd90bf4..aeef8c663 100644 --- a/scripts/windows-builder.py +++ b/scripts/windows-builder.py @@ -30,8 +30,30 @@ Windows Build Script This script is used to build the Windows binary and the accompanying installer. For this script to work out of the box, it depends on a number of things: -windows-builder.py - This script, of course. It should be in the "scripts" directory of OpenLP. +Inno Setup 5 + Inno Setup should be installed into "C:\%PROGRAMFILES%\Inno Setup 5" + +UPX + This is used to compress DLLs and EXEs so that they take up less space, but + still function exactly the same. To install UPS, download it from + http://upx.sourceforge.net/, extract it into C:\%PROGRAMFILES%\UPX, and then + add that directory to your PATH environment variable. + +PyInstaller + PyInstaller should be a checkout of trunk, and in a directory called, + "pyinstaller" on the same level as OpenLP's Bazaar shared repository + directory. + + To install PyInstaller, first checkout trunk from Subversion. The easiest + way is to install TortoiseSVN and then checkout the following URL to a + directory called "pyinstaller":: + + http://svn.pyinstaller.org/trunk + + Once you've done that, open a command prompt (DOS shell), navigate to the + PyInstaller directory and run:: + + C:\Projects\pyinstaller>python Configure.py Bazaar You need the command line "bzr" client installed. @@ -41,15 +63,8 @@ OpenLP shared repository directory. This means your code should be in a directory structure like this: "openlp\branch-name". - You can - -PyInstaller - PyInstaller should be a checkout of trunk, and in a directory called, - "pyinstaller" on the same level as OpenLP's Bazaar shared repository - directory. - -Inno Setup 5 - Inno Setup should be installed into "C:\%PROGRAMFILES%\Inno Setup 5" +windows-builder.py + This script, of course. It should be in the "scripts" directory of OpenLP. """ @@ -61,7 +76,7 @@ script_path = os.path.split(os.path.abspath(__file__))[0] branch_path = os.path.abspath(os.path.join(script_path, u'..')) source_path = os.path.join(branch_path, u'openlp') dist_path = os.path.join(branch_path, u'dist', u'OpenLP') -pyinstaller_path = os.path.abspath(os.path.join(branch_path, u'..', u'pyinstaller')) +pyinstaller_path = os.path.abspath(os.path.join(branch_path, u'..', u'..', u'pyinstaller')) innosetup_path = os.path.join(os.getenv(u'PROGRAMFILES'), 'Inno Setup 5') iss_path = os.path.join(branch_path, u'resources', u'innosetup') @@ -137,11 +152,11 @@ def main(): print "PyInstaller path:", pyinstaller_path print "Inno Setup path:", innosetup_path print "ISS file path:", iss_path - #run_pyinstaller() - #write_version_file() - #copy_plugins() - #copy_windows_files() - #run_innosetup() + run_pyinstaller() + write_version_file() + copy_plugins() + copy_windows_files() + run_innosetup() print "Done." if __name__ == u'__main__': From a1273aefe50d718756807b407e0a6668a38ef392 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Wed, 26 May 2010 22:27:03 +0200 Subject: [PATCH 4/6] Fixed rst. --- scripts/windows-builder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/windows-builder.py b/scripts/windows-builder.py index aeef8c663..54b31531e 100644 --- a/scripts/windows-builder.py +++ b/scripts/windows-builder.py @@ -48,12 +48,12 @@ PyInstaller way is to install TortoiseSVN and then checkout the following URL to a directory called "pyinstaller":: - http://svn.pyinstaller.org/trunk + http://svn.pyinstaller.org/trunk Once you've done that, open a command prompt (DOS shell), navigate to the PyInstaller directory and run:: - C:\Projects\pyinstaller>python Configure.py + C:\Projects\pyinstaller>python Configure.py Bazaar You need the command line "bzr" client installed. From 8287f4ea276792555c0aec8c4a718e7c93a4f548 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Thu, 27 May 2010 22:32:02 +0200 Subject: [PATCH 5/6] Further updated the Windows build script documentation. --- scripts/windows-builder.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/windows-builder.py b/scripts/windows-builder.py index 54b31531e..caf19f53d 100644 --- a/scripts/windows-builder.py +++ b/scripts/windows-builder.py @@ -50,6 +50,10 @@ PyInstaller http://svn.pyinstaller.org/trunk + Then you need to copy the two hook-*.py files from the "pyinstaller" + subdirectory in OpenLP's "resources" directory into PyInstaller's "hooks" + directory. + Once you've done that, open a command prompt (DOS shell), navigate to the PyInstaller directory and run:: From e2f39860ec1df108c674404266df698053700b16 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Thu, 27 May 2010 22:36:04 +0200 Subject: [PATCH 6/6] No longer need the lxml.objectify hook, this is in PyInstaller 1.4. --- resources/pyinstaller/hook-lxml.objectify.py | 1 - 1 file changed, 1 deletion(-) delete mode 100644 resources/pyinstaller/hook-lxml.objectify.py diff --git a/resources/pyinstaller/hook-lxml.objectify.py b/resources/pyinstaller/hook-lxml.objectify.py deleted file mode 100644 index 9d83432df..000000000 --- a/resources/pyinstaller/hook-lxml.objectify.py +++ /dev/null @@ -1 +0,0 @@ -hiddenimports = ['lxml.etree']