2010-07-24 22:10:47 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# OpenLP - Open Source Lyrics Projection #
|
|
|
|
# --------------------------------------------------------------------------- #
|
2011-02-24 05:47:38 +00:00
|
|
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
|
|
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
2011-03-24 19:04:02 +00:00
|
|
|
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
|
|
|
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
2011-05-24 20:47:05 +00:00
|
|
|
# Jeffrey Smith, Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode #
|
|
|
|
# Woldsund #
|
2010-07-24 22:10:47 +00:00
|
|
|
# --------------------------------------------------------------------------- #
|
|
|
|
# This program is free software; you can redistribute it and/or modify it #
|
|
|
|
# under the terms of the GNU General Public License as published by the Free #
|
|
|
|
# Software Foundation; version 2 of the License. #
|
|
|
|
# #
|
|
|
|
# This program is distributed in the hope that it will be useful, but WITHOUT #
|
|
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
|
|
|
|
# more details. #
|
|
|
|
# #
|
|
|
|
# You should have received a copy of the GNU General Public License along #
|
|
|
|
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
|
|
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
"""
|
|
|
|
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:
|
|
|
|
|
2011-07-04 11:27:20 +00:00
|
|
|
Python 2.6/2.7
|
2010-09-16 20:40:12 +00:00
|
|
|
|
|
|
|
PyQt4
|
|
|
|
You should already have this installed, OpenLP doesn't work without it. The
|
|
|
|
version the script expects is the packaged one available from River Bank
|
|
|
|
Computing.
|
|
|
|
|
|
|
|
PyEnchant
|
|
|
|
This script expects the precompiled, installable version of PyEnchant to be
|
|
|
|
installed. You can find this on the PyEnchant site.
|
|
|
|
|
2010-07-24 22:10:47 +00:00
|
|
|
Inno Setup 5
|
|
|
|
Inno Setup should be installed into "C:\%PROGRAMFILES%\Inno Setup 5"
|
|
|
|
|
2011-04-20 23:21:31 +00:00
|
|
|
Sphinx
|
2011-05-13 01:23:01 +00:00
|
|
|
This is used to build the documentation. The documentation trunk must be at
|
2011-10-26 00:09:35 +00:00
|
|
|
the same directory level as Openlp trunk and named "documentation".
|
2011-04-20 23:21:31 +00:00
|
|
|
|
|
|
|
HTML Help Workshop
|
2011-10-26 00:09:35 +00:00
|
|
|
This is used to create the help file.
|
2011-04-20 23:21:31 +00:00
|
|
|
|
2010-07-24 22:10:47 +00:00
|
|
|
PyInstaller
|
2011-07-04 11:27:20 +00:00
|
|
|
PyInstaller should be a checkout of revision 1470 of trunk, and in a
|
2010-09-16 20:40:12 +00:00
|
|
|
directory called, "pyinstaller" on the same level as OpenLP's Bazaar shared
|
|
|
|
repository directory. The revision is very important as there is currently
|
|
|
|
a major regression in HEAD.
|
2010-07-24 22:10:47 +00:00
|
|
|
|
|
|
|
To install PyInstaller, first checkout trunk from Subversion. The easiest
|
|
|
|
way is to install TortoiseSVN and then checkout the following URL to a
|
2011-10-27 21:06:40 +00:00
|
|
|
directory called "pyinstaller"::
|
2010-07-24 22:10:47 +00:00
|
|
|
|
|
|
|
http://svn.pyinstaller.org/trunk
|
|
|
|
|
|
|
|
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".
|
|
|
|
|
2011-04-20 23:21:31 +00:00
|
|
|
Visual C++ 2008 Express Edition
|
|
|
|
This is to build pptviewlib.dll, the library for controlling the
|
2011-10-26 00:09:35 +00:00
|
|
|
PowerPointViewer.
|
2011-04-20 23:21:31 +00:00
|
|
|
|
2010-07-24 22:10:47 +00:00
|
|
|
windows-builder.py
|
|
|
|
This script, of course. It should be in the "scripts" directory of OpenLP.
|
|
|
|
|
2011-05-24 12:57:58 +00:00
|
|
|
psvince.dll
|
|
|
|
This dll is used during the actual install of OpenLP to check if OpenLP is
|
|
|
|
running on the users machine prior to the setup. If OpenLP is running,
|
2011-10-28 13:28:57 +00:00
|
|
|
the install will fail. The dll can be obtained from here:
|
2011-10-27 21:06:40 +00:00
|
|
|
|
|
|
|
http://www.vincenzo.net/isxkb/index.php?title=PSVince)
|
2011-10-26 00:09:35 +00:00
|
|
|
|
2011-10-27 21:06:40 +00:00
|
|
|
The dll is presently included in .\\resources\\windows
|
2011-05-24 12:57:58 +00:00
|
|
|
|
2011-07-05 20:17:17 +00:00
|
|
|
Mako
|
2011-06-03 16:40:17 +00:00
|
|
|
Mako Templates for Python. This package is required for building the
|
|
|
|
remote plugin. It can be installed by going to your
|
|
|
|
python_directory\scripts\.. and running "easy_install Mako". If you do not
|
2011-10-28 13:28:57 +00:00
|
|
|
have easy_install, the Mako package can be obtained here:
|
2011-10-27 21:06:40 +00:00
|
|
|
|
|
|
|
http://www.makotemplates.org/download.html
|
2011-10-28 13:28:57 +00:00
|
|
|
|
|
|
|
Sqlalchemy Migrate
|
|
|
|
Required for the data-bases used in OpenLP. The package can be
|
|
|
|
obtained here:
|
|
|
|
|
|
|
|
http://code.google.com/p/sqlalchemy-migrate/
|
|
|
|
|
2010-07-24 22:10:47 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
import os
|
2010-10-10 15:40:54 +00:00
|
|
|
import sys
|
2012-02-15 03:57:16 +00:00
|
|
|
from shutil import copy, rmtree
|
2010-07-24 22:10:47 +00:00
|
|
|
from subprocess import Popen, PIPE
|
2012-02-15 03:57:16 +00:00
|
|
|
from ConfigParser import SafeConfigParser as ConfigParser
|
2010-07-24 22:10:47 +00:00
|
|
|
|
2012-02-15 03:57:16 +00:00
|
|
|
# Executable paths
|
2010-10-10 15:40:54 +00:00
|
|
|
python_exe = sys.executable
|
|
|
|
innosetup_exe = os.path.join(os.getenv(u'PROGRAMFILES'), 'Inno Setup 5',
|
|
|
|
u'ISCC.exe')
|
2011-04-02 20:09:49 +00:00
|
|
|
sphinx_exe = os.path.join(os.path.split(python_exe)[0], u'Scripts',
|
|
|
|
u'sphinx-build.exe')
|
2011-04-02 18:20:43 +00:00
|
|
|
hhc_exe = os.path.join(os.getenv(u'PROGRAMFILES'), 'HTML Help Workshop',
|
|
|
|
u'hhc.exe')
|
2011-05-13 01:23:01 +00:00
|
|
|
vcbuild_exe = os.path.join(os.getenv(u'PROGRAMFILES'),
|
2011-04-23 10:06:47 +00:00
|
|
|
u'Microsoft Visual Studio 9.0', u'VC', u'vcpackages', u'vcbuild.exe')
|
2010-10-10 15:40:54 +00:00
|
|
|
|
|
|
|
# Base paths
|
2010-07-24 22:10:47 +00:00
|
|
|
script_path = os.path.split(os.path.abspath(__file__))[0]
|
|
|
|
branch_path = os.path.abspath(os.path.join(script_path, u'..'))
|
2011-05-13 01:23:01 +00:00
|
|
|
doc_branch_path = os.path.abspath(os.path.join(script_path, u'..',
|
2011-05-13 11:45:41 +00:00
|
|
|
u'..', u'documentation'))
|
2010-10-10 15:40:54 +00:00
|
|
|
site_packages = os.path.join(os.path.split(python_exe)[0], u'Lib',
|
|
|
|
u'site-packages')
|
|
|
|
|
|
|
|
# Files and executables
|
|
|
|
pyi_build = os.path.abspath(os.path.join(branch_path, u'..', u'..',
|
2011-07-04 11:27:20 +00:00
|
|
|
u'pyinstaller', u'pyinstaller.py'))
|
|
|
|
openlp_main_script = os.path.abspath(os.path.join(branch_path, 'openlp.pyw'))
|
2011-07-06 18:36:33 +00:00
|
|
|
if os.path.exists(os.path.join(site_packages, u'PyQt4', u'bin')):
|
2011-07-07 18:18:35 +00:00
|
|
|
# Older versions of the PyQt4 Windows installer put their binaries in the
|
|
|
|
# "bin" directory
|
2011-07-06 18:36:33 +00:00
|
|
|
lrelease_exe = os.path.join(site_packages, u'PyQt4', u'bin', u'lrelease.exe')
|
|
|
|
else:
|
2011-07-07 18:18:35 +00:00
|
|
|
# Newer versions of the PyQt4 Windows installer put their binaries in the
|
|
|
|
# base directory of the installation
|
2011-07-06 18:36:33 +00:00
|
|
|
lrelease_exe = os.path.join(site_packages, u'PyQt4', u'lrelease.exe')
|
2010-10-10 15:40:54 +00:00
|
|
|
i18n_utils = os.path.join(script_path, u'translation_utils.py')
|
2011-07-04 11:27:20 +00:00
|
|
|
win32_icon = os.path.join(branch_path, u'resources', u'images', 'OpenLP.ico')
|
2010-10-10 15:40:54 +00:00
|
|
|
|
|
|
|
# Paths
|
2010-07-24 22:10:47 +00:00
|
|
|
source_path = os.path.join(branch_path, u'openlp')
|
2011-05-13 01:23:01 +00:00
|
|
|
manual_path = os.path.join(doc_branch_path, u'manual')
|
|
|
|
manual_build_path = os.path.join(manual_path, u'build')
|
|
|
|
helpfile_path = os.path.join(manual_build_path, u'htmlhelp')
|
2010-09-16 20:40:12 +00:00
|
|
|
i18n_path = os.path.join(branch_path, u'resources', u'i18n')
|
2010-10-10 15:40:54 +00:00
|
|
|
winres_path = os.path.join(branch_path, u'resources', u'windows')
|
2011-07-04 11:27:20 +00:00
|
|
|
build_path = os.path.join(branch_path, u'build')
|
2011-07-06 18:36:33 +00:00
|
|
|
dist_path = os.path.join(branch_path, u'dist', u'OpenLP')
|
2011-04-20 23:21:31 +00:00
|
|
|
pptviewlib_path = os.path.join(source_path, u'plugins', u'presentations',
|
|
|
|
u'lib', u'pptviewlib')
|
2011-10-26 00:09:35 +00:00
|
|
|
hooks_path = os.path.join(branch_path , u'resources', u'pyinstaller')
|
2010-09-16 20:40:12 +00:00
|
|
|
|
2012-02-15 03:57:16 +00:00
|
|
|
# Transifex details -- will be read in from the file.
|
|
|
|
transifex_filename = os.path.abspath(os.path.join(branch_path, '..',
|
|
|
|
'transifex.conf'))
|
|
|
|
|
2011-01-02 12:47:30 +00:00
|
|
|
def update_code():
|
|
|
|
os.chdir(branch_path)
|
2011-03-18 15:28:51 +00:00
|
|
|
print u'Reverting any changes to the code...'
|
|
|
|
bzr = Popen((u'bzr', u'revert'), stdout=PIPE)
|
|
|
|
output, error = bzr.communicate()
|
|
|
|
code = bzr.wait()
|
|
|
|
if code != 0:
|
|
|
|
print output
|
|
|
|
raise Exception(u'Error reverting the code')
|
|
|
|
print u'Updating the code...'
|
2011-01-02 12:47:30 +00:00
|
|
|
bzr = Popen((u'bzr', u'update'), stdout=PIPE)
|
|
|
|
output, error = bzr.communicate()
|
|
|
|
code = bzr.wait()
|
|
|
|
if code != 0:
|
|
|
|
print output
|
|
|
|
raise Exception(u'Error updating the code')
|
|
|
|
|
2010-07-24 22:10:47 +00:00
|
|
|
def run_pyinstaller():
|
|
|
|
print u'Running PyInstaller...'
|
|
|
|
os.chdir(branch_path)
|
2011-07-04 11:27:20 +00:00
|
|
|
pyinstaller = Popen((python_exe, pyi_build,
|
2011-07-04 12:04:50 +00:00
|
|
|
u'--noconfirm',
|
|
|
|
u'--windowed',
|
2011-10-26 00:09:35 +00:00
|
|
|
u'--noupx',
|
|
|
|
u'--additional-hooks-dir', hooks_path,
|
2012-01-16 19:30:44 +00:00
|
|
|
u'--log-level=ERROR',
|
2011-07-07 18:18:35 +00:00
|
|
|
u'-o', branch_path,
|
2011-07-04 12:04:50 +00:00
|
|
|
u'-i', win32_icon,
|
|
|
|
u'-p', branch_path,
|
|
|
|
u'-n', 'OpenLP',
|
|
|
|
openlp_main_script),
|
|
|
|
stdout=PIPE)
|
2010-10-10 15:40:54 +00:00
|
|
|
output, error = pyinstaller.communicate()
|
2010-07-24 22:10:47 +00:00
|
|
|
code = pyinstaller.wait()
|
|
|
|
if code != 0:
|
2010-10-10 15:40:54 +00:00
|
|
|
print output
|
|
|
|
raise Exception(u'Error running PyInstaller')
|
2010-07-24 22:10:47 +00:00
|
|
|
|
|
|
|
def write_version_file():
|
|
|
|
print u'Writing version file...'
|
|
|
|
os.chdir(branch_path)
|
|
|
|
bzr = Popen((u'bzr', u'tags', u'--sort', u'time'), stdout=PIPE)
|
|
|
|
output, error = bzr.communicate()
|
|
|
|
code = bzr.wait()
|
|
|
|
if code != 0:
|
|
|
|
raise Exception(u'Error running bzr tags')
|
|
|
|
lines = output.splitlines()
|
|
|
|
if len(lines) == 0:
|
|
|
|
tag = u'0.0.0'
|
|
|
|
revision = u'0'
|
|
|
|
else:
|
|
|
|
tag, revision = lines[-1].split()
|
|
|
|
bzr = Popen((u'bzr', u'log', u'--line', u'-r', u'-1'), stdout=PIPE)
|
|
|
|
output, error = bzr.communicate()
|
|
|
|
code = bzr.wait()
|
|
|
|
if code != 0:
|
|
|
|
raise Exception(u'Error running bzr log')
|
2011-06-03 15:44:40 +00:00
|
|
|
outputAscii = unicode(output, errors='ignore')
|
|
|
|
latest = outputAscii.split(u':')[0]
|
2010-07-24 22:10:47 +00:00
|
|
|
versionstring = latest == revision and tag or u'%s-bzr%s' % (tag, latest)
|
|
|
|
f = open(os.path.join(dist_path, u'.version'), u'w')
|
|
|
|
f.write(versionstring)
|
|
|
|
f.close()
|
|
|
|
|
|
|
|
def copy_plugins():
|
|
|
|
print u'Copying plugins...'
|
|
|
|
source = os.path.join(source_path, u'plugins')
|
|
|
|
dest = os.path.join(dist_path, u'plugins')
|
|
|
|
for root, dirs, files in os.walk(source):
|
|
|
|
for filename in files:
|
|
|
|
if not filename.endswith(u'.pyc'):
|
|
|
|
dest_path = os.path.join(dest, root[len(source)+1:])
|
|
|
|
if not os.path.exists(dest_path):
|
|
|
|
os.makedirs(dest_path)
|
|
|
|
copy(os.path.join(root, filename),
|
|
|
|
os.path.join(dest_path, filename))
|
|
|
|
|
2011-11-30 17:06:57 +00:00
|
|
|
def copy_media_player():
|
|
|
|
print u'Copying media player...'
|
|
|
|
source = os.path.join(source_path, u'core', u'ui', u'media')
|
|
|
|
dest = os.path.join(dist_path, u'core', u'ui', u'media')
|
|
|
|
for root, dirs, files in os.walk(source):
|
|
|
|
for filename in files:
|
|
|
|
if not filename.endswith(u'.pyc'):
|
|
|
|
dest_path = os.path.join(dest, root[len(source)+1:])
|
|
|
|
if not os.path.exists(dest_path):
|
|
|
|
os.makedirs(dest_path)
|
|
|
|
copy(os.path.join(root, filename),
|
|
|
|
os.path.join(dest_path, filename))
|
|
|
|
|
2010-07-24 22:10:47 +00:00
|
|
|
def copy_windows_files():
|
|
|
|
print u'Copying extra files for Windows...'
|
2010-10-10 15:40:54 +00:00
|
|
|
copy(os.path.join(winres_path, u'OpenLP.ico'),
|
|
|
|
os.path.join(dist_path, u'OpenLP.ico'))
|
|
|
|
copy(os.path.join(winres_path, u'LICENSE.txt'),
|
2011-05-05 13:13:12 +00:00
|
|
|
os.path.join(dist_path, u'LICENSE.txt'))
|
2011-05-23 15:41:22 +00:00
|
|
|
copy(os.path.join(winres_path, u'psvince.dll'),
|
|
|
|
os.path.join(dist_path, u'psvince.dll'))
|
2011-06-29 14:42:14 +00:00
|
|
|
if os.path.isfile(os.path.join(helpfile_path, u'OpenLP.chm')):
|
2011-05-13 01:23:01 +00:00
|
|
|
print u' Windows help file found'
|
2011-06-29 14:42:14 +00:00
|
|
|
copy(os.path.join(helpfile_path, u'OpenLP.chm'),
|
|
|
|
os.path.join(dist_path, u'OpenLP.chm'))
|
2011-05-13 01:23:01 +00:00
|
|
|
else:
|
|
|
|
print u' WARNING ---- Windows help file not found ---- WARNING'
|
2010-07-24 22:10:47 +00:00
|
|
|
|
2010-09-19 17:31:59 +00:00
|
|
|
def update_translations():
|
|
|
|
print u'Updating translations...'
|
2012-02-15 03:57:16 +00:00
|
|
|
if not os.path.exists(transifex_filename):
|
|
|
|
raise Exception(u'Could not find Transifex credentials file: %s' \
|
|
|
|
% transifex_filename)
|
|
|
|
config = ConfigParser()
|
|
|
|
config.read(transifex_filename)
|
|
|
|
if not config.has_section('transifex'):
|
|
|
|
raise Exception(u'No section named "transifex" found.')
|
|
|
|
if not config.has_option('transifex', 'username'):
|
|
|
|
raise Exception(u'No option named "username" found.')
|
|
|
|
if not config.has_option('transifex', 'password'):
|
|
|
|
raise Exception(u'No option named "password" found.')
|
|
|
|
username = config.get('transifex', 'username')
|
|
|
|
password = config.get('transifex', 'password')
|
2010-09-19 17:31:59 +00:00
|
|
|
os.chdir(script_path)
|
2012-02-15 03:57:16 +00:00
|
|
|
translation_utils = Popen([python_exe, i18n_utils, u'-qdpu', '-U',
|
|
|
|
username, '-P', password])
|
2010-09-19 17:31:59 +00:00
|
|
|
code = translation_utils.wait()
|
|
|
|
if code != 0:
|
2010-10-10 15:40:54 +00:00
|
|
|
raise Exception(u'Error running translation_utils.py')
|
2010-09-19 17:31:59 +00:00
|
|
|
|
2010-09-16 20:40:12 +00:00
|
|
|
def compile_translations():
|
2010-09-19 17:31:59 +00:00
|
|
|
print u'Compiling translations...'
|
2010-09-16 20:40:12 +00:00
|
|
|
files = os.listdir(i18n_path)
|
|
|
|
if not os.path.exists(os.path.join(dist_path, u'i18n')):
|
|
|
|
os.makedirs(os.path.join(dist_path, u'i18n'))
|
|
|
|
for file in files:
|
|
|
|
if file.endswith(u'.ts'):
|
|
|
|
source_path = os.path.join(i18n_path, file)
|
|
|
|
dest_path = os.path.join(dist_path, u'i18n',
|
|
|
|
file.replace(u'.ts', u'.qm'))
|
2010-10-10 15:40:54 +00:00
|
|
|
lconvert = Popen((lrelease_exe, u'-compress', u'-silent',
|
|
|
|
source_path, u'-qm', dest_path))
|
2010-09-16 20:40:12 +00:00
|
|
|
code = lconvert.wait()
|
|
|
|
if code != 0:
|
2010-10-10 15:40:54 +00:00
|
|
|
raise Exception('Error running lconvert on %s' % source_path)
|
2011-05-04 15:35:25 +00:00
|
|
|
print u'Copying qm files...'
|
|
|
|
source = os.path.join(site_packages, u'PyQt4', u'translations')
|
|
|
|
files = os.listdir(source)
|
|
|
|
for filename in files:
|
|
|
|
if filename.startswith(u'qt_') and filename.endswith(u'.qm') and \
|
|
|
|
len(filename) == 8:
|
|
|
|
copy(os.path.join(source, filename),
|
|
|
|
os.path.join(dist_path, u'i18n', filename))
|
2011-05-04 18:41:44 +00:00
|
|
|
|
2011-04-02 18:19:46 +00:00
|
|
|
def run_sphinx():
|
2011-05-13 11:45:41 +00:00
|
|
|
print u'Deleting previous manual build...', manual_build_path
|
2011-05-13 01:23:01 +00:00
|
|
|
if os.path.exists(manual_build_path):
|
|
|
|
rmtree(manual_build_path)
|
2011-04-02 18:19:46 +00:00
|
|
|
print u'Running Sphinx...'
|
|
|
|
os.chdir(manual_path)
|
2011-04-02 20:09:49 +00:00
|
|
|
sphinx = Popen((sphinx_exe, u'-b', u'htmlhelp', u'-d', u'build/doctrees',
|
|
|
|
u'source', u'build/htmlhelp'), stdout=PIPE)
|
2011-04-02 18:19:46 +00:00
|
|
|
output, error = sphinx.communicate()
|
|
|
|
code = sphinx.wait()
|
|
|
|
if code != 0:
|
|
|
|
print output
|
|
|
|
raise Exception(u'Error running Sphinx')
|
|
|
|
|
|
|
|
def run_htmlhelp():
|
|
|
|
print u'Running HTML Help Workshop...'
|
2011-05-13 01:23:01 +00:00
|
|
|
os.chdir(os.path.join(manual_build_path, u'htmlhelp'))
|
2011-04-02 18:19:46 +00:00
|
|
|
hhc = Popen((hhc_exe, u'OpenLP.chm'), stdout=PIPE)
|
|
|
|
output, error = hhc.communicate()
|
|
|
|
code = hhc.wait()
|
2011-04-02 20:09:49 +00:00
|
|
|
if code != 1:
|
|
|
|
print u'Exit code:', code
|
2011-04-02 18:19:46 +00:00
|
|
|
print output
|
|
|
|
raise Exception(u'Error running HTML Help Workshop')
|
|
|
|
|
2010-07-24 22:10:47 +00:00
|
|
|
def run_innosetup():
|
|
|
|
print u'Running Inno Setup...'
|
2010-10-10 15:40:54 +00:00
|
|
|
os.chdir(winres_path)
|
|
|
|
innosetup = Popen((innosetup_exe,
|
|
|
|
os.path.join(winres_path, u'OpenLP-2.0.iss'), u'/q'))
|
2010-07-24 22:10:47 +00:00
|
|
|
code = innosetup.wait()
|
|
|
|
if code != 0:
|
|
|
|
raise Exception(u'Error running Inno Setup')
|
|
|
|
|
2011-04-20 23:21:31 +00:00
|
|
|
def build_pptviewlib():
|
|
|
|
print u'Building PPTVIEWLIB.DLL...'
|
2011-04-23 10:06:47 +00:00
|
|
|
vcbuild = Popen((vcbuild_exe, u'/rebuild',
|
2011-04-22 22:32:08 +00:00
|
|
|
os.path.join(pptviewlib_path, u'pptviewlib.vcproj'), u'Release|Win32'))
|
2011-04-20 23:21:31 +00:00
|
|
|
code = vcbuild.wait()
|
|
|
|
if code != 0:
|
|
|
|
raise Exception(u'Error building pptviewlib.dll')
|
2011-04-23 10:06:47 +00:00
|
|
|
copy(os.path.join(pptviewlib_path, u'Release', u'pptviewlib.dll'),
|
2011-04-20 23:21:31 +00:00
|
|
|
pptviewlib_path)
|
|
|
|
|
2010-07-24 22:10:47 +00:00
|
|
|
def main():
|
2011-04-20 23:21:31 +00:00
|
|
|
skip_update = False
|
2010-09-16 20:40:12 +00:00
|
|
|
import sys
|
2011-04-20 23:21:31 +00:00
|
|
|
for arg in sys.argv:
|
|
|
|
if arg == u'-v' or arg == u'--verbose':
|
2011-07-05 20:17:17 +00:00
|
|
|
print "OpenLP main script: ......", openlp_main_script
|
|
|
|
print "Script path: .............", script_path
|
|
|
|
print "Branch path: .............", branch_path
|
|
|
|
print "Source path: .............", source_path
|
|
|
|
print "\"dist\" path: .............", dist_path
|
|
|
|
print "PyInstaller: .............", pyi_build
|
2011-05-13 01:23:01 +00:00
|
|
|
print "Documentation branch path:", doc_branch_path
|
2011-07-05 20:17:17 +00:00
|
|
|
print "Help file build path: ....", helpfile_path
|
|
|
|
print "Inno Setup path: .........", innosetup_exe
|
|
|
|
print "Windows resources: .......", winres_path
|
|
|
|
print "VCBuild path: ............", vcbuild_exe
|
|
|
|
print "PPTVIEWLIB path: .........", pptviewlib_path
|
|
|
|
print ""
|
2011-04-20 23:21:31 +00:00
|
|
|
elif arg == u'--skip-update':
|
|
|
|
skip_update = True
|
|
|
|
elif arg == u'/?' or arg == u'-h' or arg == u'--help':
|
|
|
|
print u'Command options:'
|
|
|
|
print u' -v --verbose : More verbose output'
|
|
|
|
print u' --skip-update : Do not update or revert current branch'
|
|
|
|
exit()
|
|
|
|
if not skip_update:
|
|
|
|
update_code()
|
|
|
|
build_pptviewlib()
|
2010-07-24 22:10:47 +00:00
|
|
|
run_pyinstaller()
|
|
|
|
write_version_file()
|
|
|
|
copy_plugins()
|
2011-11-30 17:06:57 +00:00
|
|
|
copy_media_player()
|
2011-05-13 01:23:01 +00:00
|
|
|
if os.path.exists(manual_path):
|
|
|
|
run_sphinx()
|
|
|
|
run_htmlhelp()
|
|
|
|
else:
|
|
|
|
print u' '
|
|
|
|
print u' WARNING ---- Documentation Trunk not found ---- WARNING'
|
|
|
|
print u' --- Windows Help file will not be included in build ---'
|
|
|
|
print u' '
|
2010-07-24 22:10:47 +00:00
|
|
|
copy_windows_files()
|
2010-09-19 17:31:59 +00:00
|
|
|
update_translations()
|
2010-09-16 20:40:12 +00:00
|
|
|
compile_translations()
|
2010-07-24 22:10:47 +00:00
|
|
|
run_innosetup()
|
|
|
|
print "Done."
|
|
|
|
|
|
|
|
if __name__ == u'__main__':
|
2010-07-27 09:32:52 +00:00
|
|
|
main()
|