← Back to team overview

openlp-core team mailing list archive

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

 

Tomas Groth has proposed merging lp:~tomasgroth/openlp/packaging-webengine into lp:openlp/packaging.

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

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~tomasgroth/openlp/packaging-webengine/+merge/363286
-- 
Your team OpenLP Core is requested to review the proposed merge of lp:~tomasgroth/openlp/packaging-webengine into lp:openlp/packaging.
=== modified file 'builders/builder.py'
--- builders/builder.py	2018-12-02 06:07:08 +0000
+++ builders/builder.py	2019-02-16 21:23:26 +0000
@@ -65,8 +65,8 @@
         self.setup_args()
         self.setup_system_paths()
         self.read_config()
+        self.setup_paths()
         self.setup_executables()
-        self.setup_paths()
         self.setup_extra()
 
     def _print(self, text, *args):
@@ -90,6 +90,7 @@
 
         Return text from stdout.
         """
+        print(cmd)
         proc = Popen(cmd, stdout=PIPE, stderr=PIPE, universal_newlines=True)
         output, error = proc.communicate()
         code = proc.wait()
@@ -264,6 +265,12 @@
         self._bzr('export', self.branch_path, ['-r', 'tag:' + self.version, self.work_path],
                   'Error exporting the code')
 
+    def get_extra_parameters(self):
+        """
+        Return a list of any extra parameters we wish to use
+        """
+        return []
+
     def run_pyinstaller(self):
         """
         Run PyInstaller on the branch to build an executable.
@@ -280,6 +287,7 @@
                '--runtime-hook', os.path.join(self.hooks_path, 'rthook_ssl.py'),
                '-i', self.icon_path,
                '-n', 'OpenLP',
+               *self.get_extra_parameters(),  # Adds any extra parameters we wish to use
                self.openlp_script]
         if self.args.verbose:
             cmd.append('--log-level=DEBUG')

=== modified file 'builders/windows-builder.py'
--- builders/windows-builder.py	2016-12-12 19:02:33 +0000
+++ builders/windows-builder.py	2019-02-16 21:23:26 +0000
@@ -26,12 +26,11 @@
 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:
 
-Python 3.4
+Python 3.7
 
 PyQt5
     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.
+    version the script expects is the packaged one available from pypi.
 
 PyEnchant
     This script expects the precompiled, installable version of PyEnchant to be
@@ -48,8 +47,7 @@
     This is used to create the help file.
 
 PyInstaller
-    PyInstaller should be a git clone of
-    https://github.com/matysek/pyinstaller branch develop
+    PyInstaller can be installed from pypi.
 
 Bazaar
     You need the command line "bzr" client installed.
@@ -59,10 +57,6 @@
     shared repository directory. This means your code should be in a directory
     structure like this: "openlp\\branch-name".
 
-Visual C++ 2008 Express Edition
-    This is to build pptviewlib.dll, the library for controlling the
-    PowerPointViewer.
-
 windows-builder.py
     This script, of course. It should be in the "windows-installer" directory
     at the same level as OpenLP trunk.
@@ -115,6 +109,7 @@
 """
 
 import os
+import glob
 from distutils import dir_util
 from shutil import copy, move, rmtree
 
@@ -126,17 +121,6 @@
     The :class:`WindowsBuilder` class encapsulates everything that is needed
     to build a Windows installer.
     """
-    def _build_pptviewlib(self):
-        """
-        Build the PowerPoint Viewer DLL using Visual Studio.
-        """
-        self._print('Building PPTVIEWLIB.DLL...')
-        if not os.path.exists(self.vcbuild_exe):
-            self._print('... WARNING: vcbuild.exe was not found, skipping building pptviewlib.dll')
-            return
-        self._run_command([self.vcbuild_exe, '/rebuild', os.path.join(self.pptviewlib_path, 'pptviewlib.vcproj'),
-                           'Release|Win32'], 'Error building pptviewlib.dll')
-        copy(os.path.join(self.pptviewlib_path, 'Release', 'pptviewlib.dll'), self.pptviewlib_path)
 
     def _create_innosetup_file(self):
         """
@@ -283,7 +267,11 @@
         super().setup_system_paths()
         self.python_root = os.path.dirname(self.python)
         self.site_packages = os.path.join(self.python_root, 'Lib', 'site-packages')
-        self.program_files = os.getenv('PROGRAMFILES')
+        self.program_files = os.getenv('PROGRAMFILES(x86)')
+        if not self.program_files:
+            self.program_files = os.getenv('PROGRAMFILES')
+        self._print_verbose('   {:.<20}: {}'.format('site packages: ', self.site_packages))
+        self._print_verbose('   {:.<20}: {}'.format('program files: ', self.program_files))
 
     def setup_paths(self):
         """
@@ -293,7 +281,6 @@
         self.dist_path = os.path.join(self.work_path, 'dist', 'OpenLP')
         self.helpfile_path = os.path.join(self.manual_build_path, 'htmlhelp')
         self.winres_path = os.path.join(self.branch_path, 'resources', 'windows')
-        self.pptviewlib_path = os.path.join(self.source_path, 'plugins', 'presentations', 'lib', 'pptviewlib')
 
     def copy_extra_files(self):
         """
@@ -334,12 +321,22 @@
         """
         Build the installer
         """
-        self._build_pptviewlib()
         self._create_innosetup_file()
         self._run_innosetup()
         if self.args.portable:
             self._run_portableapp_builder()
 
+    def get_extra_parameters(self):
+        """
+        Return a list of any extra parameters we wish to use
+        """
+        parameters = []
+        # Finds the UCRT DDLs available from the Windows 10 SDK
+        for binary in glob.glob('C:\\Program Files (x86)\\Windows Kits\\10\\Redist\\ucrt\\DLLs\\x64\\*.dll'):
+            parameters.append('--add-binary')
+            parameters.append(binary + ";.")
+        return parameters
+
 
 if __name__ == '__main__':
     WindowsBuilder().main()

=== modified file 'windows/config-appveyor.ini'
--- windows/config-appveyor.ini	2017-05-02 20:21:06 +0000
+++ windows/config-appveyor.ini	2019-02-16 21:23:26 +0000
@@ -1,18 +1,17 @@
 [executables]
 innosetup = %(progfiles)s\Inno Setup 5\ISCC.exe
 sphinx = %(pyroot)s\Scripts\sphinx-build.exe
-pyinstaller = %(here)s\..\..\PyInstaller-3.2\pyinstaller.py
-vcbuild = %(progfiles)s\Microsoft Visual Studio 9.0\VC\vcpackages\vcbuild.exe
+pyinstaller = %(pyroot)s\Scripts\pyinstaller-script.py
 htmlhelp = %(progfiles)s\HTML Help Workshop\hhc.exe
 psvince = %(here)s\psvince.dll
-lrelease = C:\Qt\5.5\msvc2013\bin\lrelease.exe
+lrelease = C:\Qt\5.12\msvc2017\bin\lrelease.exe
 portablelauncher = %(here)s\..\..\PortableApps.comLauncher\PortableApps.comLauncherGenerator.exe
 portableinstaller = %(here)s\..\..\PortableApps.comInstaller\PortableApps.comInstaller.exe
-mutool = %(here)s\..\..\mupdf-1.9a-windows\mutool.exe
+mutool = %(here)s\..\..\mupdf-1.14.0-windows\mutool.exe
 mediainfo = %(here)s\..\..\MediaInfo\MediaInfo.exe
 
 [paths]
-branch = %(projects)s\trunk
+branch = %(projects)s\openlp-branch
 documentation = %(projects)s\documentation
 icon = %(here)s\OpenLP.ico
 hooks = %(here)s\..\pyinstaller-hooks

=== modified file 'windows/config.ini.default'
--- windows/config.ini.default	2016-12-06 21:02:14 +0000
+++ windows/config.ini.default	2019-02-16 21:23:26 +0000
@@ -2,7 +2,6 @@
 innosetup = %(progfiles)s\Inno Setup 5\ISCC.exe
 sphinx = %(pyroot)s\Scripts\sphinx-build.exe
 pyinstaller = %(here)s\..\pyinstaller\pyinstaller.py
-vcbuild = %(progfiles)s\Microsoft Visual Studio 9.0\VC\vcpackages\vcbuild.exe
 htmlhelp = %(progfiles)s\HTML Help Workshop\hhc.exe
 psvince = %(here)s\psvince.dll
 lrelease = %(sitepackages)s\PyQt5\bin\lrelease.exe


Follow ups