Merge lp:~tomasgroth/openlp/packaging-webengine into lp:openlp/packaging

Proposed by Tomas Groth
Status: Merged
Merged at revision: 41
Proposed branch: lp:~tomasgroth/openlp/packaging-webengine
Merge into: lp:openlp/packaging
Diff against target: 233 lines (+67/-30)
4 files modified
builders/builder.py (+37/-1)
builders/windows-builder.py (+26/-23)
windows/config-appveyor.ini (+4/-5)
windows/config.ini.default (+0/-1)
To merge this branch: bzr merge lp:~tomasgroth/openlp/packaging-webengine
Reviewer Review Type Date Requested Status
Tim Bentley Approve
Phill Approve
Review via email: mp+364054@code.launchpad.net

This proposal supersedes a proposal from 2019-02-16.

Commit message

Update the packaging scripts to work on windows (and appveyor) with the new webengine bacnkend.

To post a comment you must log in.
Revision history for this message
Phill (phill-ridout) wrote : Posted in a previous version of this proposal

See in lines.

review: Needs Information
Revision history for this message
Phill (phill-ridout) wrote :

Looks good

review: Approve
Revision history for this message
Tim Bentley (trb143) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'builders/builder.py'
2--- builders/builder.py 2018-12-02 06:07:08 +0000
3+++ builders/builder.py 2019-03-06 19:46:14 +0000
4@@ -65,8 +65,8 @@
5 self.setup_args()
6 self.setup_system_paths()
7 self.read_config()
8+ self.setup_paths()
9 self.setup_executables()
10- self.setup_paths()
11 self.setup_extra()
12
13 def _print(self, text, *args):
14@@ -264,6 +264,12 @@
15 self._bzr('export', self.branch_path, ['-r', 'tag:' + self.version, self.work_path],
16 'Error exporting the code')
17
18+ def get_extra_parameters(self):
19+ """
20+ Return a list of any extra parameters we wish to use
21+ """
22+ return []
23+
24 def run_pyinstaller(self):
25 """
26 Run PyInstaller on the branch to build an executable.
27@@ -280,6 +286,7 @@
28 '--runtime-hook', os.path.join(self.hooks_path, 'rthook_ssl.py'),
29 '-i', self.icon_path,
30 '-n', 'OpenLP',
31+ *self.get_extra_parameters(), # Adds any extra parameters we wish to use
32 self.openlp_script]
33 if self.args.verbose:
34 cmd.append('--log-level=DEBUG')
35@@ -365,6 +372,33 @@
36 self._print_verbose('... %s', filename)
37 copy(os.path.join(root, filename), os.path.join(dest_path, filename))
38
39+ def copy_font_files(self):
40+ """
41+ Copy OpenLP font files
42+ """
43+ self._print('Copying OpenLP fonts files...')
44+ src_dir = os.path.join(self.source_path, 'core', 'ui', 'fonts')
45+ dst_dir = os.path.join(self.dist_path, 'core', 'ui', 'fonts')
46+ font_files = ['OpenLP.ttf', 'openlp-charmap.json']
47+ os.makedirs(dst_dir)
48+ for font_file in font_files:
49+ src = os.path.join(src_dir, font_file)
50+ dst = os.path.join(dst_dir, font_file)
51+ copy(src, dst)
52+
53+ def copy_display_files(self):
54+ """
55+ Copy OpenLP display HTML files
56+ """
57+ self._print('Copying OpenLP HTML display files...')
58+ src_dir = os.path.join(self.source_path, 'core', 'display', 'html')
59+ dst_dir = os.path.join(self.dist_path, 'core', 'display', 'html')
60+ os.makedirs(dst_dir)
61+ for display_file in os.listdir(src_dir):
62+ src = os.path.join(src_dir, display_file)
63+ dst = os.path.join(dst_dir, display_file)
64+ copy(src, dst)
65+
66 def copy_extra_files(self):
67 """
68 Copy any extra files which are particular to a platform
69@@ -461,6 +495,8 @@
70 self.copy_default_theme()
71 self.copy_plugins()
72 self.copy_media_player()
73+ self.copy_font_files()
74+ self.copy_display_files()
75 if os.path.exists(self.manual_path):
76 self.run_sphinx()
77 else:
78
79=== modified file 'builders/windows-builder.py'
80--- builders/windows-builder.py 2016-12-12 19:02:33 +0000
81+++ builders/windows-builder.py 2019-03-06 19:46:14 +0000
82@@ -26,12 +26,11 @@
83 This script is used to build the Windows binary and the accompanying installer.
84 For this script to work out of the box, it depends on a number of things:
85
86-Python 3.4
87+Python 3.7
88
89 PyQt5
90 You should already have this installed, OpenLP doesn't work without it. The
91- version the script expects is the packaged one available from River Bank
92- Computing.
93+ version the script expects is the packaged one available from pypi.
94
95 PyEnchant
96 This script expects the precompiled, installable version of PyEnchant to be
97@@ -48,8 +47,7 @@
98 This is used to create the help file.
99
100 PyInstaller
101- PyInstaller should be a git clone of
102- https://github.com/matysek/pyinstaller branch develop
103+ PyInstaller can be installed from pypi.
104
105 Bazaar
106 You need the command line "bzr" client installed.
107@@ -59,10 +57,6 @@
108 shared repository directory. This means your code should be in a directory
109 structure like this: "openlp\\branch-name".
110
111-Visual C++ 2008 Express Edition
112- This is to build pptviewlib.dll, the library for controlling the
113- PowerPointViewer.
114-
115 windows-builder.py
116 This script, of course. It should be in the "windows-installer" directory
117 at the same level as OpenLP trunk.
118@@ -115,6 +109,8 @@
119 """
120
121 import os
122+import glob
123+import sys
124 from distutils import dir_util
125 from shutil import copy, move, rmtree
126
127@@ -126,17 +122,6 @@
128 The :class:`WindowsBuilder` class encapsulates everything that is needed
129 to build a Windows installer.
130 """
131- def _build_pptviewlib(self):
132- """
133- Build the PowerPoint Viewer DLL using Visual Studio.
134- """
135- self._print('Building PPTVIEWLIB.DLL...')
136- if not os.path.exists(self.vcbuild_exe):
137- self._print('... WARNING: vcbuild.exe was not found, skipping building pptviewlib.dll')
138- return
139- self._run_command([self.vcbuild_exe, '/rebuild', os.path.join(self.pptviewlib_path, 'pptviewlib.vcproj'),
140- 'Release|Win32'], 'Error building pptviewlib.dll')
141- copy(os.path.join(self.pptviewlib_path, 'Release', 'pptviewlib.dll'), self.pptviewlib_path)
142
143 def _create_innosetup_file(self):
144 """
145@@ -283,7 +268,13 @@
146 super().setup_system_paths()
147 self.python_root = os.path.dirname(self.python)
148 self.site_packages = os.path.join(self.python_root, 'Lib', 'site-packages')
149- self.program_files = os.getenv('PROGRAMFILES')
150+ # Default program_files to 'Program Files (x86)' - the folder for 32-bit programs on 64-bit systems, if that
151+ # does not exists the host system is 32-bit so fallback to 'Program Files'.
152+ self.program_files = os.getenv('PROGRAMFILES(x86)')
153+ if not self.program_files:
154+ self.program_files = os.getenv('PROGRAMFILES')
155+ self._print_verbose(' {:.<20}: {}'.format('site packages: ', self.site_packages))
156+ self._print_verbose(' {:.<20}: {}'.format('program files: ', self.program_files))
157
158 def setup_paths(self):
159 """
160@@ -293,7 +284,6 @@
161 self.dist_path = os.path.join(self.work_path, 'dist', 'OpenLP')
162 self.helpfile_path = os.path.join(self.manual_build_path, 'htmlhelp')
163 self.winres_path = os.path.join(self.branch_path, 'resources', 'windows')
164- self.pptviewlib_path = os.path.join(self.source_path, 'plugins', 'presentations', 'lib', 'pptviewlib')
165
166 def copy_extra_files(self):
167 """
168@@ -334,12 +324,25 @@
169 """
170 Build the installer
171 """
172- self._build_pptviewlib()
173 self._create_innosetup_file()
174 self._run_innosetup()
175 if self.args.portable:
176 self._run_portableapp_builder()
177
178+ def get_extra_parameters(self):
179+ """
180+ Return a list of any extra parameters we wish to use
181+ """
182+ parameters = []
183+ # Detect python instance bit size
184+ arch = 'x86' if sys.maxsize == 0x7fffffff else 'x64'
185+ dll_path = '{pf}\\Windows Kits\\10\\Redist\\ucrt\\DLLs\\{arch}\\*.dll'.format(pf=self.program_files, arch=arch)
186+ # Finds the UCRT DDLs available from the Windows 10 SDK
187+ for binary in glob.glob(dll_path):
188+ parameters.append('--add-binary')
189+ parameters.append(binary + ";.")
190+ return parameters
191+
192
193 if __name__ == '__main__':
194 WindowsBuilder().main()
195
196=== modified file 'windows/config-appveyor.ini'
197--- windows/config-appveyor.ini 2017-05-02 20:21:06 +0000
198+++ windows/config-appveyor.ini 2019-03-06 19:46:14 +0000
199@@ -1,18 +1,17 @@
200 [executables]
201 innosetup = %(progfiles)s\Inno Setup 5\ISCC.exe
202 sphinx = %(pyroot)s\Scripts\sphinx-build.exe
203-pyinstaller = %(here)s\..\..\PyInstaller-3.2\pyinstaller.py
204-vcbuild = %(progfiles)s\Microsoft Visual Studio 9.0\VC\vcpackages\vcbuild.exe
205+pyinstaller = %(pyroot)s\Scripts\pyinstaller-script.py
206 htmlhelp = %(progfiles)s\HTML Help Workshop\hhc.exe
207 psvince = %(here)s\psvince.dll
208-lrelease = C:\Qt\5.5\msvc2013\bin\lrelease.exe
209+lrelease = C:\Qt\5.12\msvc2017\bin\lrelease.exe
210 portablelauncher = %(here)s\..\..\PortableApps.comLauncher\PortableApps.comLauncherGenerator.exe
211 portableinstaller = %(here)s\..\..\PortableApps.comInstaller\PortableApps.comInstaller.exe
212-mutool = %(here)s\..\..\mupdf-1.9a-windows\mutool.exe
213+mutool = %(here)s\..\..\mupdf-1.14.0-windows\mutool.exe
214 mediainfo = %(here)s\..\..\MediaInfo\MediaInfo.exe
215
216 [paths]
217-branch = %(projects)s\trunk
218+branch = %(projects)s\openlp-branch
219 documentation = %(projects)s\documentation
220 icon = %(here)s\OpenLP.ico
221 hooks = %(here)s\..\pyinstaller-hooks
222
223=== modified file 'windows/config.ini.default'
224--- windows/config.ini.default 2016-12-06 21:02:14 +0000
225+++ windows/config.ini.default 2019-03-06 19:46:14 +0000
226@@ -2,7 +2,6 @@
227 innosetup = %(progfiles)s\Inno Setup 5\ISCC.exe
228 sphinx = %(pyroot)s\Scripts\sphinx-build.exe
229 pyinstaller = %(here)s\..\pyinstaller\pyinstaller.py
230-vcbuild = %(progfiles)s\Microsoft Visual Studio 9.0\VC\vcpackages\vcbuild.exe
231 htmlhelp = %(progfiles)s\HTML Help Workshop\hhc.exe
232 psvince = %(here)s\psvince.dll
233 lrelease = %(sitepackages)s\PyQt5\bin\lrelease.exe

Subscribers

People subscribed via source and target branches