From 128de147e0cf1adff7597be1d7b8aa379ebc050f Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Thu, 2 Sep 2021 17:53:21 -0700 Subject: [PATCH] Some updates to the macOS builder - Apparently we don't need to sign the app anymore - Add hooks for websockets --- builders/macosx-builder.py | 9 +++---- pyinstaller-hooks/hook-websockets.legacy.py | 26 +++++++++++++++++++++ 2 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 pyinstaller-hooks/hook-websockets.legacy.py diff --git a/builders/macosx-builder.py b/builders/macosx-builder.py index 6157a2c..79001cb 100644 --- a/builders/macosx-builder.py +++ b/builders/macosx-builder.py @@ -92,7 +92,6 @@ like this: import glob import os -import distutils from pathlib import Path from shutil import copy, copytree, move, rmtree @@ -349,12 +348,10 @@ class MacOSXBuilder(Builder): size += 10 os.chdir(os.path.dirname(self.dmg_settings_path)) - dmgbuild_exe = os.path.join(distutils.sys.exec_prefix, 'bin', 'dmgbuild') - argv = [dmgbuild_exe, '-s', self.dmg_settings_path, '-D', 'size={size}M'.format(size=size), + argv = ['-s', self.dmg_settings_path, '-D', 'size={size}M'.format(size=size), '-D', 'icon={icon_path}'.format(icon_path=self.icon_path), '-D', 'app={dist_app_path}'.format(dist_app_path=self.dist_app_path), dmg_title, self.dmg_file] - self._run_path(dmgbuild_exe, argv, 'Error running dmgbuild') - # Dmg done. + self._run_module('dmgbuild', argv, 'Error running dmgbuild') self._print('Finished creating dmg file, resulting file: %s' % self.dmg_file) def get_platform(self): @@ -416,7 +413,7 @@ class MacOSXBuilder(Builder): Build the actual DMG """ self._fix_qt_paths() - self._code_sign() + # self._code_sign() self._create_dmg() diff --git a/pyinstaller-hooks/hook-websockets.legacy.py b/pyinstaller-hooks/hook-websockets.legacy.py new file mode 100644 index 0000000..44db636 --- /dev/null +++ b/pyinstaller-hooks/hook-websockets.legacy.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 + +########################################################################## +# OpenLP - Open Source Lyrics Projection # +# ---------------------------------------------------------------------- # +# Copyright (c) 2008-2019 OpenLP Developers # +# ---------------------------------------------------------------------- # +# 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, either version 3 of the License, or # +# (at your option) any later version. # +# # +# 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, see . # +########################################################################## +import websockets.legacy.client +import websockets.legacy.server + + +hiddenimports = ['websockets.legacy.server', 'websockets.legacy.client']