From beb92f149ba495c8b345726bccd917077f02e963 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Mon, 25 Sep 2017 21:58:43 +0200 Subject: [PATCH 01/36] Try to update packaging. --- windows/config-appveyor.ini | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/windows/config-appveyor.ini b/windows/config-appveyor.ini index 8161e61..a0ab12b 100644 --- a/windows/config-appveyor.ini +++ b/windows/config-appveyor.ini @@ -1,11 +1,12 @@ [executables] innosetup = %(progfiles)s\Inno Setup 5\ISCC.exe sphinx = %(pyroot)s\Scripts\sphinx-build.exe -pyinstaller = %(here)s\..\..\PyInstaller-3.2\pyinstaller.py +#pyinstaller = %(here)s\..\..\PyInstaller-3.2\pyinstaller.py +pyinstaller = %(pyroot)s\Script\pyinstaller 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 = C:\Qt\5.5\msvc2013\bin\lrelease.exe +lrelease = C:\Qt\5.9\msvc2015\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 From c42ac962b1948f8ac3a8be4ef0215be4268c3651 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Mon, 25 Sep 2017 22:31:41 +0200 Subject: [PATCH 02/36] update settings --- windows/config-appveyor.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/config-appveyor.ini b/windows/config-appveyor.ini index a0ab12b..231f44a 100644 --- a/windows/config-appveyor.ini +++ b/windows/config-appveyor.ini @@ -2,7 +2,7 @@ innosetup = %(progfiles)s\Inno Setup 5\ISCC.exe sphinx = %(pyroot)s\Scripts\sphinx-build.exe #pyinstaller = %(here)s\..\..\PyInstaller-3.2\pyinstaller.py -pyinstaller = %(pyroot)s\Script\pyinstaller +pyinstaller = %(pyroot)s\Script\pyinstaller-script.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 From 468f1a22c88ecea07cb4eef5e536f817c9e5c224 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Mon, 25 Sep 2017 22:59:43 +0200 Subject: [PATCH 03/36] hardcode python script path --- windows/config-appveyor.ini | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/windows/config-appveyor.ini b/windows/config-appveyor.ini index 231f44a..1437fb9 100644 --- a/windows/config-appveyor.ini +++ b/windows/config-appveyor.ini @@ -1,8 +1,10 @@ [executables] innosetup = %(progfiles)s\Inno Setup 5\ISCC.exe -sphinx = %(pyroot)s\Scripts\sphinx-build.exe +#sphinx = %(pyroot)s\Scripts\sphinx-build.exe +sphinx = C:\python36\Scripts\sphinx-build.exe #pyinstaller = %(here)s\..\..\PyInstaller-3.2\pyinstaller.py -pyinstaller = %(pyroot)s\Script\pyinstaller-script.py +#pyinstaller = %(pyroot)s\Script\pyinstaller-script.py +pyinstaller = C:\python36\Script\pyinstaller-script.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 From 40116f03f048622af4d549afba2be3ce8293c431 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Tue, 26 Sep 2017 20:24:18 +0200 Subject: [PATCH 04/36] Load paths before executables. --- builders/builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builders/builder.py b/builders/builder.py index 6aec400..0a12ff6 100644 --- a/builders/builder.py +++ b/builders/builder.py @@ -65,8 +65,8 @@ class Builder(object): self.setup_args() self.setup_system_paths() self.read_config() - self.setup_executables() self.setup_paths() + self.setup_executables() self.setup_extra() def _print(self, text, *args): From 4d8962b7e59ef37966b8b99b0816652825b3152d Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Tue, 26 Sep 2017 20:30:22 +0200 Subject: [PATCH 05/36] clean up config file --- windows/config-appveyor.ini | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/windows/config-appveyor.ini b/windows/config-appveyor.ini index 1437fb9..96db2b5 100644 --- a/windows/config-appveyor.ini +++ b/windows/config-appveyor.ini @@ -1,10 +1,7 @@ [executables] innosetup = %(progfiles)s\Inno Setup 5\ISCC.exe -#sphinx = %(pyroot)s\Scripts\sphinx-build.exe -sphinx = C:\python36\Scripts\sphinx-build.exe -#pyinstaller = %(here)s\..\..\PyInstaller-3.2\pyinstaller.py -#pyinstaller = %(pyroot)s\Script\pyinstaller-script.py -pyinstaller = C:\python36\Script\pyinstaller-script.py +sphinx = %(pyroot)s\Scripts\sphinx-build.exe +pyinstaller = %(pyroot)s\Script\pyinstaller-script.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 From d6784e38cb4e88eb9b2149d2b637b82e1d9e768d Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Tue, 26 Sep 2017 21:34:59 +0200 Subject: [PATCH 06/36] try some things --- builders/builder.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builders/builder.py b/builders/builder.py index 0a12ff6..0e6c53b 100644 --- a/builders/builder.py +++ b/builders/builder.py @@ -43,7 +43,7 @@ def _which(program): Return absolute path to a command found on system PATH. """ def is_exe(fpath): - return os.path.isfile(fpath) and os.access(fpath, os.X_OK) + return os.path.isfile(fpath) #and (os.access(fpath, os.X_OK) or fpath.endswith('.py')) fpath, fname = os.path.split(program) if fpath and is_exe(os.path.abspath(program)): @@ -189,6 +189,7 @@ class Builder(object): self._print_verbose('Executables:') for executable in self.config.options('executables'): path = self.config.get('executables', executable) + print(executable + " : " + path) if not path.strip(): path = None else: @@ -203,6 +204,7 @@ class Builder(object): self._print_verbose('Paths:') for name in self.config.options('paths'): path = os.path.abspath(self.config.get('paths', name)) + print(executable + " : " + path) setattr(self, '{name}_path'.format(name=name), path) self._print_verbose(' {name:.<20} {path}'.format(name=name + ': ', path=path)) # Make any command line options override the config file From 6ecb97abe77d5817dff2ebe422c5aab418a23f1b Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Tue, 26 Sep 2017 21:39:33 +0200 Subject: [PATCH 07/36] fix copy/paste error --- builders/builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builders/builder.py b/builders/builder.py index 0e6c53b..cbdbbf9 100644 --- a/builders/builder.py +++ b/builders/builder.py @@ -204,7 +204,7 @@ class Builder(object): self._print_verbose('Paths:') for name in self.config.options('paths'): path = os.path.abspath(self.config.get('paths', name)) - print(executable + " : " + path) + print(name + " : " + path) setattr(self, '{name}_path'.format(name=name), path) self._print_verbose(' {name:.<20} {path}'.format(name=name + ': ', path=path)) # Make any command line options override the config file From 42741cbfb2a2de571166ce4674c537c153338c2b Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Tue, 26 Sep 2017 21:58:20 +0200 Subject: [PATCH 08/36] forgot a s. --- windows/config-appveyor.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/config-appveyor.ini b/windows/config-appveyor.ini index 96db2b5..d2a7628 100644 --- a/windows/config-appveyor.ini +++ b/windows/config-appveyor.ini @@ -1,7 +1,7 @@ [executables] innosetup = %(progfiles)s\Inno Setup 5\ISCC.exe sphinx = %(pyroot)s\Scripts\sphinx-build.exe -pyinstaller = %(pyroot)s\Script\pyinstaller-script.py +pyinstaller = %(pyroot)s\Scripts\pyinstaller-script.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 From 9ae3703f76d1beb33be6ef800940276a2c3ebca4 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Tue, 26 Sep 2017 22:06:28 +0200 Subject: [PATCH 09/36] Revert some changes. --- builders/builder.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/builders/builder.py b/builders/builder.py index cbdbbf9..6aec400 100644 --- a/builders/builder.py +++ b/builders/builder.py @@ -43,7 +43,7 @@ def _which(program): Return absolute path to a command found on system PATH. """ def is_exe(fpath): - return os.path.isfile(fpath) #and (os.access(fpath, os.X_OK) or fpath.endswith('.py')) + return os.path.isfile(fpath) and os.access(fpath, os.X_OK) fpath, fname = os.path.split(program) if fpath and is_exe(os.path.abspath(program)): @@ -65,8 +65,8 @@ class Builder(object): 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): @@ -189,7 +189,6 @@ class Builder(object): self._print_verbose('Executables:') for executable in self.config.options('executables'): path = self.config.get('executables', executable) - print(executable + " : " + path) if not path.strip(): path = None else: @@ -204,7 +203,6 @@ class Builder(object): self._print_verbose('Paths:') for name in self.config.options('paths'): path = os.path.abspath(self.config.get('paths', name)) - print(name + " : " + path) setattr(self, '{name}_path'.format(name=name), path) self._print_verbose(' {name:.<20} {path}'.format(name=name + ': ', path=path)) # Make any command line options override the config file From 0ad2a6186abe30e8aa76f10e4f869d0333f60bca Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Tue, 26 Sep 2017 23:58:42 +0200 Subject: [PATCH 10/36] Try to include new ucrt distributables in win build. --- builders/builder.py | 8 ++++++++ builders/windows-builder.py | 18 +++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/builders/builder.py b/builders/builder.py index 6aec400..d740e16 100644 --- a/builders/builder.py +++ b/builders/builder.py @@ -262,6 +262,12 @@ class Builder(object): self._bzr('export', self.branch_path, ['-r', 'tag:' + self.version, self.work_path], 'Error exporting the code') + def get_binaries(self): + """ + Return a list of the binaries to include + """ + return [] + def run_pyinstaller(self): """ Run PyInstaller on the branch to build an executable. @@ -269,6 +275,7 @@ class Builder(object): self._print('Running PyInstaller...') copy(os.path.join(self.work_path, 'openlp.py'), self.openlp_script) os.chdir(self.work_path) + # Create the binary list cmd = [self.python, self.pyinstaller_exe, '--clean', @@ -279,6 +286,7 @@ class Builder(object): '--runtime-hook', os.path.join(self.hooks_path, 'rthook_ssl.py'), '-i', self.icon_path, '-n', 'OpenLP', + *get_binaries(), # Adds any binaries we wish to include self.openlp_script] if self.args.verbose: cmd.append('--log-level=DEBUG') diff --git a/builders/windows-builder.py b/builders/windows-builder.py index a0086f3..5b873a9 100644 --- a/builders/windows-builder.py +++ b/builders/windows-builder.py @@ -26,12 +26,11 @@ 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: -Python 3.4 +Python 3.6 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 @@ HTML Help Workshop 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. @@ -340,6 +338,16 @@ class WindowsBuilder(Builder): if self.args.portable: self._run_portableapp_builder() + def get_binaries(self): + """ + Return a list of the binaries to include + """ + binaries = [] + for binary in glob.glob('C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\x86\*.dll'): + binaries.append('--add-binary') + binaries.append(binary + ";.") + return binaries + if __name__ == '__main__': WindowsBuilder().main() From 1b12ae51e1bf1ce406739046ae4b597d15acab20 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Wed, 27 Sep 2017 22:15:53 +0200 Subject: [PATCH 11/36] Fix idention. --- builders/windows-builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builders/windows-builder.py b/builders/windows-builder.py index 5b873a9..7ccd5d4 100644 --- a/builders/windows-builder.py +++ b/builders/windows-builder.py @@ -346,7 +346,7 @@ class WindowsBuilder(Builder): for binary in glob.glob('C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\x86\*.dll'): binaries.append('--add-binary') binaries.append(binary + ";.") - return binaries + return binaries if __name__ == '__main__': From d13c07c58e30d2cfe4e4955d738535d9bc715909 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Wed, 27 Sep 2017 22:26:18 +0200 Subject: [PATCH 12/36] Try some backslash escaping --- builders/windows-builder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builders/windows-builder.py b/builders/windows-builder.py index 7ccd5d4..4b648ba 100644 --- a/builders/windows-builder.py +++ b/builders/windows-builder.py @@ -343,7 +343,8 @@ class WindowsBuilder(Builder): Return a list of the binaries to include """ binaries = [] - for binary in glob.glob('C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\x86\*.dll'): + # Finds the UCRT DDLs available from the Windows SDK + for binary in glob.glob('C:\\Program Files (x86)\\Windows Kits\\10\\Redist\\ucrt\\DLLs\\x86\\*.dll'): binaries.append('--add-binary') binaries.append(binary + ";.") return binaries From 770caefae7473f9db45192d4af9c1f75bf934d93 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Wed, 27 Sep 2017 22:33:01 +0200 Subject: [PATCH 13/36] Fix idention. --- builders/builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builders/builder.py b/builders/builder.py index d740e16..851c589 100644 --- a/builders/builder.py +++ b/builders/builder.py @@ -266,7 +266,7 @@ class Builder(object): """ Return a list of the binaries to include """ - return [] + return [] def run_pyinstaller(self): """ From 645a55b3b3cb8f8f9cd8a43eaff3ebfe77ca4812 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Wed, 27 Sep 2017 22:39:45 +0200 Subject: [PATCH 14/36] fix method call --- builders/builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builders/builder.py b/builders/builder.py index 851c589..d1e7734 100644 --- a/builders/builder.py +++ b/builders/builder.py @@ -286,7 +286,7 @@ class Builder(object): '--runtime-hook', os.path.join(self.hooks_path, 'rthook_ssl.py'), '-i', self.icon_path, '-n', 'OpenLP', - *get_binaries(), # Adds any binaries we wish to include + *self.get_binaries(), # Adds any binaries we wish to include self.openlp_script] if self.args.verbose: cmd.append('--log-level=DEBUG') From 2df10e780d3255f4003075991305f89b980e8ee4 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Wed, 27 Sep 2017 22:53:43 +0200 Subject: [PATCH 15/36] forgot to import glob --- builders/windows-builder.py | 1 + 1 file changed, 1 insertion(+) diff --git a/builders/windows-builder.py b/builders/windows-builder.py index 4b648ba..3e7f656 100644 --- a/builders/windows-builder.py +++ b/builders/windows-builder.py @@ -113,6 +113,7 @@ Portable App Builds """ import os +import glob from distutils import dir_util from shutil import copy, move, rmtree From d05247ea479c7f903b8e0f37269c7c6245849157 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Thu, 28 Sep 2017 21:25:51 +0200 Subject: [PATCH 16/36] Change method name --- builders/builder.py | 7 +++---- builders/windows-builder.py | 14 +++++++------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/builders/builder.py b/builders/builder.py index d1e7734..5226da4 100644 --- a/builders/builder.py +++ b/builders/builder.py @@ -262,9 +262,9 @@ class Builder(object): self._bzr('export', self.branch_path, ['-r', 'tag:' + self.version, self.work_path], 'Error exporting the code') - def get_binaries(self): + def get_extra_parameters(self): """ - Return a list of the binaries to include + Return a list of any extra parameters we wish to use """ return [] @@ -275,7 +275,6 @@ class Builder(object): self._print('Running PyInstaller...') copy(os.path.join(self.work_path, 'openlp.py'), self.openlp_script) os.chdir(self.work_path) - # Create the binary list cmd = [self.python, self.pyinstaller_exe, '--clean', @@ -286,7 +285,7 @@ class Builder(object): '--runtime-hook', os.path.join(self.hooks_path, 'rthook_ssl.py'), '-i', self.icon_path, '-n', 'OpenLP', - *self.get_binaries(), # Adds any binaries we wish to include + *self.get_extra_parameters(), # Adds any extra parameters we wish to use self.openlp_script] if self.args.verbose: cmd.append('--log-level=DEBUG') diff --git a/builders/windows-builder.py b/builders/windows-builder.py index 3e7f656..1562789 100644 --- a/builders/windows-builder.py +++ b/builders/windows-builder.py @@ -339,16 +339,16 @@ class WindowsBuilder(Builder): if self.args.portable: self._run_portableapp_builder() - def get_binaries(self): + def get_extra_parameters(self): """ - Return a list of the binaries to include + Return a list of any extra parameters we wish to use """ - binaries = [] - # Finds the UCRT DDLs available from the Windows SDK + 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\\x86\\*.dll'): - binaries.append('--add-binary') - binaries.append(binary + ";.") - return binaries + parameters.append('--add-binary') + parameters.append(binary + ";.") + return parameters if __name__ == '__main__': From ba1564c7be68f7c7ffe47a45d3c1fb56a410b46b Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Fri, 15 Feb 2019 21:43:26 +0100 Subject: [PATCH 17/36] try some new values --- windows/config-appveyor.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/windows/config-appveyor.ini b/windows/config-appveyor.ini index da9fbc5..b3ed60c 100644 --- a/windows/config-appveyor.ini +++ b/windows/config-appveyor.ini @@ -7,8 +7,8 @@ psvince = %(here)s\psvince.dll 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 = %(project)s\openlp-branch\mutool.exe -mediainfo = %(project)s\openlp-branch\MediaInfo.exe +mutool = %(here)s\..\..openlp-branch\mutool.exe +mediainfo = %(here)s\..\..openlp-branch\MediaInfo.exe [paths] branch = %(projects)s\openlp-branch From aace963ea60a1cfefbea6976df0a53821bb906bc Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Fri, 15 Feb 2019 21:50:35 +0100 Subject: [PATCH 18/36] remove pptlibview build --- builders/windows-builder.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/builders/windows-builder.py b/builders/windows-builder.py index b893d3b..9ef30f8 100644 --- a/builders/windows-builder.py +++ b/builders/windows-builder.py @@ -277,7 +277,6 @@ class WindowsBuilder(Builder): 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): """ @@ -318,7 +317,6 @@ class WindowsBuilder(Builder): """ Build the installer """ - self._build_pptviewlib() self._create_innosetup_file() self._run_innosetup() if self.args.portable: From eb4711d70da7cd87becbe4c7bc2421122c9a1f27 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Fri, 15 Feb 2019 22:12:24 +0100 Subject: [PATCH 19/36] try some new values --- windows/config-appveyor.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/windows/config-appveyor.ini b/windows/config-appveyor.ini index b3ed60c..76d8f76 100644 --- a/windows/config-appveyor.ini +++ b/windows/config-appveyor.ini @@ -7,8 +7,8 @@ psvince = %(here)s\psvince.dll 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\..\..openlp-branch\mutool.exe -mediainfo = %(here)s\..\..openlp-branch\MediaInfo.exe +mutool = %(here)s\..openlp-branch\mutool.exe +mediainfo = %(here)s\..openlp-branch\MediaInfo.exe [paths] branch = %(projects)s\openlp-branch From 75abfc27d9712db9859504b80aa5c3ec22f28839 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Fri, 15 Feb 2019 22:34:14 +0100 Subject: [PATCH 20/36] debug print --- builders/builder.py | 1 + windows/config-appveyor.ini | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/builders/builder.py b/builders/builder.py index 72e3d4d..66fdd79 100644 --- a/builders/builder.py +++ b/builders/builder.py @@ -90,6 +90,7 @@ class Builder(object): Return text from stdout. """ + _print(cmd) proc = Popen(cmd, stdout=PIPE, stderr=PIPE, universal_newlines=True) output, error = proc.communicate() code = proc.wait() diff --git a/windows/config-appveyor.ini b/windows/config-appveyor.ini index 76d8f76..9dd0298 100644 --- a/windows/config-appveyor.ini +++ b/windows/config-appveyor.ini @@ -7,8 +7,8 @@ psvince = %(here)s\psvince.dll 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\..openlp-branch\mutool.exe -mediainfo = %(here)s\..openlp-branch\MediaInfo.exe +mutool = %(here)s\..\..\mupdf-1.14.0-windows\mutool.exe +mediainfo = %(here)s\..\..\MediaInfo\MediaInfo.exe [paths] branch = %(projects)s\openlp-branch From fb4a66d47bd8bc3a784f7de9f1da95fa4f0785c2 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Fri, 15 Feb 2019 22:41:41 +0100 Subject: [PATCH 21/36] debug print --- builders/builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builders/builder.py b/builders/builder.py index 66fdd79..37f5958 100644 --- a/builders/builder.py +++ b/builders/builder.py @@ -90,7 +90,7 @@ class Builder(object): Return text from stdout. """ - _print(cmd) + print(cmd) proc = Popen(cmd, stdout=PIPE, stderr=PIPE, universal_newlines=True) output, error = proc.communicate() code = proc.wait() From 888a61ec2bb71e174dbebbcc5bf9e2be249f2e23 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Fri, 15 Feb 2019 23:06:24 +0100 Subject: [PATCH 22/36] try to load paths before exe --- builders/builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builders/builder.py b/builders/builder.py index 37f5958..ff8a20e 100644 --- a/builders/builder.py +++ b/builders/builder.py @@ -63,10 +63,10 @@ class Builder(object): """ def __init__(self): self.setup_args() + self.setup_paths() self.setup_system_paths() self.read_config() self.setup_executables() - self.setup_paths() self.setup_extra() def _print(self, text, *args): From 6fc4e61f9fead4c7e7d84476f491a4c5cffdd23a Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Fri, 15 Feb 2019 23:12:48 +0100 Subject: [PATCH 23/36] try to load config earlier --- builders/builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builders/builder.py b/builders/builder.py index ff8a20e..b0f91e8 100644 --- a/builders/builder.py +++ b/builders/builder.py @@ -63,9 +63,9 @@ class Builder(object): """ def __init__(self): self.setup_args() + self.read_config() self.setup_paths() self.setup_system_paths() - self.read_config() self.setup_executables() self.setup_extra() From 3ae58f56df1414a711d4c8605d1ee138aebe09dd Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Sat, 16 Feb 2019 21:19:52 +0100 Subject: [PATCH 24/36] reorder initialization --- builders/builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builders/builder.py b/builders/builder.py index b0f91e8..92d52b8 100644 --- a/builders/builder.py +++ b/builders/builder.py @@ -62,8 +62,8 @@ class Builder(object): A Generic class to base other operating system specific builders on """ def __init__(self): - self.setup_args() self.read_config() + self.setup_args() self.setup_paths() self.setup_system_paths() self.setup_executables() From 936fa3fc7860276b855a34e14b4ad6eea21a2eb5 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Sat, 16 Feb 2019 21:34:36 +0100 Subject: [PATCH 25/36] reorder initialization again --- builders/builder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builders/builder.py b/builders/builder.py index 92d52b8..9e5233f 100644 --- a/builders/builder.py +++ b/builders/builder.py @@ -62,10 +62,10 @@ class Builder(object): A Generic class to base other operating system specific builders on """ def __init__(self): - self.read_config() self.setup_args() - self.setup_paths() self.setup_system_paths() + self.read_config() + self.setup_paths() self.setup_executables() self.setup_extra() From 64a22bd80cef96fdf8c245573d05b1526c628555 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Sat, 16 Feb 2019 22:01:03 +0100 Subject: [PATCH 26/36] some debug print --- builders/windows-builder.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builders/windows-builder.py b/builders/windows-builder.py index 9ef30f8..07b9319 100644 --- a/builders/windows-builder.py +++ b/builders/windows-builder.py @@ -268,6 +268,8 @@ class WindowsBuilder(Builder): 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._print_verbose(' {:.<20}: {}'.format('site packages: ', self.site_packages)) + self._print_verbose(' {:.<20}: {}'.format('program files: ', self.program_files)) def setup_paths(self): """ From ccc6b44e2cdb44c318ef0dfb3684e1a0c04eec4b Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Sat, 16 Feb 2019 22:13:16 +0100 Subject: [PATCH 27/36] support program files path on x64 --- builders/windows-builder.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builders/windows-builder.py b/builders/windows-builder.py index 07b9319..f9321df 100644 --- a/builders/windows-builder.py +++ b/builders/windows-builder.py @@ -267,7 +267,9 @@ class WindowsBuilder(Builder): 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)) From b2cb30f31babe025ff70b5c26ef66dca51f5ee6a Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Sun, 17 Feb 2019 21:26:29 +0100 Subject: [PATCH 28/36] remove debug print again --- builders/builder.py | 1 - 1 file changed, 1 deletion(-) diff --git a/builders/builder.py b/builders/builder.py index 9e5233f..3441ddc 100644 --- a/builders/builder.py +++ b/builders/builder.py @@ -90,7 +90,6 @@ class Builder(object): Return text from stdout. """ - print(cmd) proc = Popen(cmd, stdout=PIPE, stderr=PIPE, universal_newlines=True) output, error = proc.communicate() code = proc.wait() From 80eef6fc5b769ce2334cd53bd62487284955e3f5 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Sun, 17 Feb 2019 22:12:05 +0100 Subject: [PATCH 29/36] include font in package --- builders/builder.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/builders/builder.py b/builders/builder.py index 3441ddc..f5e4d57 100644 --- a/builders/builder.py +++ b/builders/builder.py @@ -372,6 +372,15 @@ class Builder(object): self._print_verbose('... %s', filename) copy(os.path.join(root, filename), os.path.join(dest_path, filename)) + def copy_font(self): + """ + Copy OpenLP font file + """ + self._print('Copying OpenLP font...') + source = os.path.join(self.source_path, 'core', 'ui', 'fonts', 'OpenLP.ttf') + dest = os.path.join(self.dist_path, 'core', 'ui', 'fonts', 'OpenLP.ttf') + copy(source, dest) + def copy_extra_files(self): """ Copy any extra files which are particular to a platform @@ -468,6 +477,7 @@ class Builder(object): self.copy_default_theme() self.copy_plugins() self.copy_media_player() + self.copy_font() if os.path.exists(self.manual_path): self.run_sphinx() else: From 815ef71a54dad0d6a1a9f31880ed0751f244e9c4 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Sun, 17 Feb 2019 22:23:18 +0100 Subject: [PATCH 30/36] create folder before copying font --- builders/builder.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builders/builder.py b/builders/builder.py index f5e4d57..d2af1ad 100644 --- a/builders/builder.py +++ b/builders/builder.py @@ -378,7 +378,9 @@ class Builder(object): """ self._print('Copying OpenLP font...') source = os.path.join(self.source_path, 'core', 'ui', 'fonts', 'OpenLP.ttf') - dest = os.path.join(self.dist_path, 'core', 'ui', 'fonts', 'OpenLP.ttf') + dest_dir = os.path.join(self.dist_path, 'core', 'ui', 'fonts') + dest = os.path.join(self.dest_dir, 'OpenLP.ttf') + os.makedirs(dest_dir) copy(source, dest) def copy_extra_files(self): From 78a7c9bcda9fd4b24a8018335744ceac7ac4c530 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Sun, 17 Feb 2019 22:28:05 +0100 Subject: [PATCH 31/36] fix c/p error --- builders/builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builders/builder.py b/builders/builder.py index d2af1ad..047ddb8 100644 --- a/builders/builder.py +++ b/builders/builder.py @@ -379,7 +379,7 @@ class Builder(object): self._print('Copying OpenLP font...') source = os.path.join(self.source_path, 'core', 'ui', 'fonts', 'OpenLP.ttf') dest_dir = os.path.join(self.dist_path, 'core', 'ui', 'fonts') - dest = os.path.join(self.dest_dir, 'OpenLP.ttf') + dest = os.path.join(dest_dir, 'OpenLP.ttf') os.makedirs(dest_dir) copy(source, dest) From 2827fdf90bdf01449cade06d1c3f756ddd89d6b8 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Mon, 18 Feb 2019 20:48:44 +0100 Subject: [PATCH 32/36] copy font and display files --- builders/builder.py | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/builders/builder.py b/builders/builder.py index 047ddb8..3201c47 100644 --- a/builders/builder.py +++ b/builders/builder.py @@ -372,16 +372,33 @@ class Builder(object): self._print_verbose('... %s', filename) copy(os.path.join(root, filename), os.path.join(dest_path, filename)) - def copy_font(self): + def copy_font_files(self): """ - Copy OpenLP font file + Copy OpenLP font files """ - self._print('Copying OpenLP font...') - source = os.path.join(self.source_path, 'core', 'ui', 'fonts', 'OpenLP.ttf') - dest_dir = os.path.join(self.dist_path, 'core', 'ui', 'fonts') - dest = os.path.join(dest_dir, 'OpenLP.ttf') - os.makedirs(dest_dir) - copy(source, dest) + self._print('Copying OpenLP fonts files...') + src_dir = os.path.join(self.source_path, 'core', 'display', 'html') + dst_dir = os.path.join(self.dist_path, 'core', 'display', 'html') + font_files = ['OpenLP.ttf', 'openlp-charmap.json'] + os.makedirs(dst_dir) + for font_file in font_files + src = os.path.join(src_dir, font_file) + dst = os.path.join(dest_dir, font_file) + copy(src, dst) + + def copy_display_files(self): + """ + Copy OpenLP display HTML files + """ + self._print('Copying OpenLP HTML display files...') + src_dir = os.path.join(self.source_path, 'core', 'ui', 'fonts') + dst_dir = os.path.join(self.dist_path, 'core', 'ui', 'fonts') + html_files = ['OpenLP.ttf', 'openlp-charmap.json'] + os.makedirs(dst_dir) + for display_file in os.listdir(src_dir) + src = os.path.join(src_dir, display_file) + dst = os.path.join(dest_dir, display_file) + copy(src, dst) def copy_extra_files(self): """ @@ -479,7 +496,8 @@ class Builder(object): self.copy_default_theme() self.copy_plugins() self.copy_media_player() - self.copy_font() + self.copy_font_files() + self.copy_display_files() if os.path.exists(self.manual_path): self.run_sphinx() else: From fdc1afa8e81adb1ae76ccce88c95f0f517b41e38 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Mon, 18 Feb 2019 20:59:28 +0100 Subject: [PATCH 33/36] fix syntax error --- builders/builder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builders/builder.py b/builders/builder.py index 3201c47..3d2c51e 100644 --- a/builders/builder.py +++ b/builders/builder.py @@ -381,7 +381,7 @@ class Builder(object): dst_dir = os.path.join(self.dist_path, 'core', 'display', 'html') font_files = ['OpenLP.ttf', 'openlp-charmap.json'] os.makedirs(dst_dir) - for font_file in font_files + for font_file in font_files: src = os.path.join(src_dir, font_file) dst = os.path.join(dest_dir, font_file) copy(src, dst) @@ -395,7 +395,7 @@ class Builder(object): dst_dir = os.path.join(self.dist_path, 'core', 'ui', 'fonts') html_files = ['OpenLP.ttf', 'openlp-charmap.json'] os.makedirs(dst_dir) - for display_file in os.listdir(src_dir) + for display_file in os.listdir(src_dir): src = os.path.join(src_dir, display_file) dst = os.path.join(dest_dir, display_file) copy(src, dst) From 03c3ea43191864ba02b4d4590f0f727f93e83e98 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Mon, 18 Feb 2019 21:04:40 +0100 Subject: [PATCH 34/36] fix typo --- builders/builder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builders/builder.py b/builders/builder.py index 3d2c51e..4edfbef 100644 --- a/builders/builder.py +++ b/builders/builder.py @@ -383,7 +383,7 @@ class Builder(object): os.makedirs(dst_dir) for font_file in font_files: src = os.path.join(src_dir, font_file) - dst = os.path.join(dest_dir, font_file) + dst = os.path.join(dst_dir, font_file) copy(src, dst) def copy_display_files(self): @@ -397,7 +397,7 @@ class Builder(object): os.makedirs(dst_dir) for display_file in os.listdir(src_dir): src = os.path.join(src_dir, display_file) - dst = os.path.join(dest_dir, display_file) + dst = os.path.join(dst_dir, display_file) copy(src, dst) def copy_extra_files(self): From b049edfb4885e82b7fe4946ea0c5d72e021aabba Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Mon, 18 Feb 2019 21:10:59 +0100 Subject: [PATCH 35/36] fix c/p error --- builders/builder.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/builders/builder.py b/builders/builder.py index 4edfbef..0139c4b 100644 --- a/builders/builder.py +++ b/builders/builder.py @@ -377,8 +377,8 @@ class Builder(object): Copy OpenLP font files """ self._print('Copying OpenLP fonts files...') - src_dir = os.path.join(self.source_path, 'core', 'display', 'html') - dst_dir = os.path.join(self.dist_path, 'core', 'display', 'html') + src_dir = os.path.join(self.source_path, 'core', 'ui', 'fonts') + dst_dir = os.path.join(self.dist_path, 'core', 'ui', 'fonts') font_files = ['OpenLP.ttf', 'openlp-charmap.json'] os.makedirs(dst_dir) for font_file in font_files: @@ -391,9 +391,8 @@ class Builder(object): Copy OpenLP display HTML files """ self._print('Copying OpenLP HTML display files...') - src_dir = os.path.join(self.source_path, 'core', 'ui', 'fonts') - dst_dir = os.path.join(self.dist_path, 'core', 'ui', 'fonts') - html_files = ['OpenLP.ttf', 'openlp-charmap.json'] + src_dir = os.path.join(self.source_path, 'core', 'display', 'html') + dst_dir = os.path.join(self.dist_path, 'core', 'display', 'html') os.makedirs(dst_dir) for display_file in os.listdir(src_dir): src = os.path.join(src_dir, display_file) From f95a43be24cd9ba2310c7ee7d9a82f08c0a11e06 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Tue, 5 Mar 2019 20:55:59 +0100 Subject: [PATCH 36/36] Make the windows builder more bit-aware --- builders/windows-builder.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/builders/windows-builder.py b/builders/windows-builder.py index f9321df..054a2c6 100644 --- a/builders/windows-builder.py +++ b/builders/windows-builder.py @@ -110,6 +110,7 @@ Portable App Builds import os import glob +import sys from distutils import dir_util from shutil import copy, move, rmtree @@ -267,6 +268,8 @@ class WindowsBuilder(Builder): super().setup_system_paths() self.python_root = os.path.dirname(self.python) self.site_packages = os.path.join(self.python_root, 'Lib', 'site-packages') + # Default program_files to 'Program Files (x86)' - the folder for 32-bit programs on 64-bit systems, if that + # does not exists the host system is 32-bit so fallback to 'Program Files'. self.program_files = os.getenv('PROGRAMFILES(x86)') if not self.program_files: self.program_files = os.getenv('PROGRAMFILES') @@ -331,8 +334,11 @@ class WindowsBuilder(Builder): Return a list of any extra parameters we wish to use """ parameters = [] + # Detect python instance bit size + arch = 'x86' if sys.maxsize == 0x7fffffff else 'x64' + dll_path = '{pf}\\Windows Kits\\10\\Redist\\ucrt\\DLLs\\{arch}\\*.dll'.format(pf=self.program_files, arch=arch) # 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'): + for binary in glob.glob(dll_path): parameters.append('--add-binary') parameters.append(binary + ";.") return parameters