From 3a86f56f36045af8e4e99bfefabe9e4f0474d148 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Sat, 10 Feb 2024 12:23:52 +0100 Subject: [PATCH] Made the build work and updated copyright year --- builders/builder.py | 1 + builders/linux-builder.py | 67 +++++-------------- launchpad-ppa/debian/copyright | 2 +- linux/config.ini.default | 4 +- osx/settings.py | 2 +- pyinstaller-hooks/hook-mysql.connector.py | 2 +- .../hook-openlp.core.ui.media.py | 2 +- ...ugins.presentations.lib.maclocontroller.py | 2 +- ...lugins.presentations.presentationplugin.py | 2 +- pyinstaller-hooks/hook-openlp.py | 2 +- pyinstaller-hooks/hook-pymediainfo.py | 5 +- pyinstaller-hooks/hook-ssl.py | 2 +- pyinstaller-hooks/hook-websockets.legacy.py | 2 +- pyinstaller-hooks/rthook_qtwebengine.py | 27 ++++++++ pyinstaller-hooks/rthook_ssl.py | 2 +- scripts/deb_version.py | 2 +- scripts/fix_bzr.py | 2 +- scripts/openlp_tweeter.py | 2 +- scripts/openlp_version.py | 2 +- scripts/openlptweet.py | 2 +- 20 files changed, 65 insertions(+), 69 deletions(-) create mode 100644 pyinstaller-hooks/rthook_qtwebengine.py diff --git a/builders/builder.py b/builders/builder.py index 16ec9f6..0558132 100644 --- a/builders/builder.py +++ b/builders/builder.py @@ -344,6 +344,7 @@ class Builder(object): '--noupx', '--additional-hooks-dir', self.hooks_path, '--runtime-hook', os.path.join(self.hooks_path, 'rthook_ssl.py'), + '--runtime-hook', os.path.join(self.hooks_path, 'rthook_qtwebengine.py'), # Import to make sqlalchemy work. # Can't be in the custom hook folder because it will conflict with PyInstallers hook '--hidden-import', 'sqlalchemy.ext.baked', diff --git a/builders/linux-builder.py b/builders/linux-builder.py index dbc6993..76f5c7e 100644 --- a/builders/linux-builder.py +++ b/builders/linux-builder.py @@ -26,20 +26,9 @@ Linux Build Script This script is used to build the Linux app bundle. -Python 3.7 +Look in setup.py in the openlp code repo for dependencies -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. - -PyEnchant - This script expects the precompiled, installable version of PyEnchant to be - installed. You can find this on the PyEnchant site. - -Sphinx - This is used to build the documentation. The documentation trunk must be at - the same directory level as OpenLP trunk and named "documentation". +Other dependencies: PyInstaller PyInstaller can be installed with pip @@ -47,46 +36,11 @@ PyInstaller Git You need the command line "git" 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". - -macosx-builder.py - This script, of course. It should be in the "osx-package" directory - at the same level as OpenLP trunk. - -Mako - Mako Templates for Python. This package is required for building the - remote plugin. - -Alembic - Required for upgrading the databases used in OpenLP. - -PyMuPDF - Required for PDF support in OpenLP. Install using pip. - -MachOLib - Python library to analyze and edit Mach-O headers, the executable format - used by Mac OS X. Used to relink the mudraw binary from MuPDF to the bundled - libraries. Install using macports or pip. - config.ini.default The configuration file contains settings of the version string to include in the bundle as well as directory and file settings for different purposes (e.g. PyInstaller location or installer background image) -To install everything you should install latest python 3.7 from python.org. It -is recommended to create virtual environment. You can install all dependencies -like this: - - $ python -m pip install sqlalchemy alembic appdirs chardet beautifulsoup4 \ - lxml Mako mysql-connector-python pytest mock psycopg2-binary \ - websockets asyncio waitress six webob requests QtAwesome PyQt5 \ - PyQtWebEngine pymediainfo PyMuPDF==1.16.7 QDarkStyle python-vlc \ - Pyro4 zeroconf flask-cors pytest-qt pyenchant pysword pyobjc-core \ - pyobjc-framework-Cocoa dmgbuild sphinx PyInstaller - """ import glob @@ -117,12 +71,27 @@ class LinuxBuilder(Builder): qt_library_path = QCoreApplication.libraryPaths()[0] return os.path.join(os.path.dirname(qt_library_path), 'translations') + def setup_paths(self): + """ + Set up a variety of paths that we use throughout the build process. + """ + super().setup_paths() + self.dist_path = os.path.join(self.work_path, 'dist', 'OpenLP') + def copy_extra_files(self): """ Copy any extra files which are particular to a platform """ self._print('Copying extra files for Linux...') - + self._print_verbose('... LICENSE.txt') + copy(self.license_path, os.path.join(self.dist_path, 'LICENSE.txt')) + lib_path = '/usr/lib/' # TODO: detect + vlc_plugin_path = lib_path + 'vlc' + vlc_plugin_dest = os.path.join(self.dist_path, '_internal') + if os.path.exists(os.path.join(vlc_plugin_dest, 'vlc')): + rmtree(os.path.join(vlc_plugin_dest, 'vlc')) + self._print_verbose('... copying VLC plugins') + copytree(vlc_plugin_path, os.path.join(vlc_plugin_dest, 'vlc')) def build_package(self): """ diff --git a/launchpad-ppa/debian/copyright b/launchpad-ppa/debian/copyright index 6518f3d..1e9115f 100644 --- a/launchpad-ppa/debian/copyright +++ b/launchpad-ppa/debian/copyright @@ -4,7 +4,7 @@ Upstream-Maintainer: OpenLP Developers Upstream-Source: http://openlp.org/ Files: * -Copyright: (c) 2008-2015 OpenLP Developers +Copyright: (c) 2008-2024 OpenLP Developers License: GPL-2 X-Comment: On Debian GNU/Linux systems, the complete text of the GPL-2 License can be found in /usr/share/common-licenses/GPL-2 diff --git a/linux/config.ini.default b/linux/config.ini.default index 9cab404..339263d 100644 --- a/linux/config.ini.default +++ b/linux/config.ini.default @@ -1,13 +1,11 @@ [executables] -lrelease = /opt/local/libexec/qt5/bin/lrelease +lrelease = /usr/bin/lrelease [paths] branch = path/to/openlp/trunk documentation = path/to/openlp/documentation icon = %(here)s/OpenLP.icns -bundle_info = %(here)s/Info.plist hooks = %(here)s/../pyinstaller-hooks -dmg_settings = %(here)s/settings.py license = %(here)s/LICENSE.txt [transifex] diff --git a/osx/settings.py b/osx/settings.py index 379e84e..d9c7113 100644 --- a/osx/settings.py +++ b/osx/settings.py @@ -4,7 +4,7 @@ ########################################################################## # OpenLP - Open Source Lyrics Projection # # ---------------------------------------------------------------------- # -# Copyright (c) 2008-2019 OpenLP Developers # +# Copyright (c) 2008-2024 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 # diff --git a/pyinstaller-hooks/hook-mysql.connector.py b/pyinstaller-hooks/hook-mysql.connector.py index 810c528..93cb30f 100644 --- a/pyinstaller-hooks/hook-mysql.connector.py +++ b/pyinstaller-hooks/hook-mysql.connector.py @@ -4,7 +4,7 @@ ########################################################################## # OpenLP - Open Source Lyrics Projection # # ---------------------------------------------------------------------- # -# Copyright (c) 2008-2019 OpenLP Developers # +# Copyright (c) 2008-2024 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 # diff --git a/pyinstaller-hooks/hook-openlp.core.ui.media.py b/pyinstaller-hooks/hook-openlp.core.ui.media.py index f39a5f3..df7c830 100644 --- a/pyinstaller-hooks/hook-openlp.core.ui.media.py +++ b/pyinstaller-hooks/hook-openlp.core.ui.media.py @@ -4,7 +4,7 @@ ########################################################################## # OpenLP - Open Source Lyrics Projection # # ---------------------------------------------------------------------- # -# Copyright (c) 2008-2019 OpenLP Developers # +# Copyright (c) 2008-2024 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 # diff --git a/pyinstaller-hooks/hook-openlp.plugins.presentations.lib.maclocontroller.py b/pyinstaller-hooks/hook-openlp.plugins.presentations.lib.maclocontroller.py index f0e75ee..3f58c8f 100644 --- a/pyinstaller-hooks/hook-openlp.plugins.presentations.lib.maclocontroller.py +++ b/pyinstaller-hooks/hook-openlp.plugins.presentations.lib.maclocontroller.py @@ -4,7 +4,7 @@ ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # -# Copyright (c) 2008-2019 OpenLP Developers # +# Copyright (c) 2008-2024 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 # diff --git a/pyinstaller-hooks/hook-openlp.plugins.presentations.presentationplugin.py b/pyinstaller-hooks/hook-openlp.plugins.presentations.presentationplugin.py index 1d5f691..573f507 100644 --- a/pyinstaller-hooks/hook-openlp.plugins.presentations.presentationplugin.py +++ b/pyinstaller-hooks/hook-openlp.plugins.presentations.presentationplugin.py @@ -4,7 +4,7 @@ ########################################################################## # OpenLP - Open Source Lyrics Projection # # ---------------------------------------------------------------------- # -# Copyright (c) 2008-2019 OpenLP Developers # +# Copyright (c) 2008-2024 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 # diff --git a/pyinstaller-hooks/hook-openlp.py b/pyinstaller-hooks/hook-openlp.py index a932da1..5314250 100644 --- a/pyinstaller-hooks/hook-openlp.py +++ b/pyinstaller-hooks/hook-openlp.py @@ -4,7 +4,7 @@ ########################################################################## # OpenLP - Open Source Lyrics Projection # # ---------------------------------------------------------------------- # -# Copyright (c) 2008-2019 OpenLP Developers # +# Copyright (c) 2008-2024 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 # diff --git a/pyinstaller-hooks/hook-pymediainfo.py b/pyinstaller-hooks/hook-pymediainfo.py index 0efc1b9..5f77a3a 100644 --- a/pyinstaller-hooks/hook-pymediainfo.py +++ b/pyinstaller-hooks/hook-pymediainfo.py @@ -4,7 +4,7 @@ ########################################################################## # OpenLP - Open Source Lyrics Projection # # ---------------------------------------------------------------------- # -# Copyright (c) 2008-2019 OpenLP Developers # +# Copyright (c) 2008-2024 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 # @@ -31,9 +31,10 @@ elif sys.platform.startswith('darwin'): dll = 'libmediainfo.0.dylib' if sys.platform.startswith('linux'): + # TODO: verify that this works on non-arch distros dll_path = '/usr/lib/libmediainfo.so' else: dll_path = os.path.join(os.path.dirname(pymediainfo.__file__), dll) -hiddenimports = ['pymediainfo'] +hiddenimports = ['pymediainfo', 'uno', 'unohelper'] binaries = [(dll_path, '.')] diff --git a/pyinstaller-hooks/hook-ssl.py b/pyinstaller-hooks/hook-ssl.py index 71329df..b6793d2 100644 --- a/pyinstaller-hooks/hook-ssl.py +++ b/pyinstaller-hooks/hook-ssl.py @@ -4,7 +4,7 @@ ########################################################################## # OpenLP - Open Source Lyrics Projection # # ---------------------------------------------------------------------- # -# Copyright (c) 2008-2019 OpenLP Developers # +# Copyright (c) 2008-2024 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 # diff --git a/pyinstaller-hooks/hook-websockets.legacy.py b/pyinstaller-hooks/hook-websockets.legacy.py index 44db636..7186f93 100644 --- a/pyinstaller-hooks/hook-websockets.legacy.py +++ b/pyinstaller-hooks/hook-websockets.legacy.py @@ -4,7 +4,7 @@ ########################################################################## # OpenLP - Open Source Lyrics Projection # # ---------------------------------------------------------------------- # -# Copyright (c) 2008-2019 OpenLP Developers # +# Copyright (c) 2008-2024 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 # diff --git a/pyinstaller-hooks/rthook_qtwebengine.py b/pyinstaller-hooks/rthook_qtwebengine.py new file mode 100644 index 0000000..d9578d8 --- /dev/null +++ b/pyinstaller-hooks/rthook_qtwebengine.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 + +########################################################################## +# OpenLP - Open Source Lyrics Projection # +# ---------------------------------------------------------------------- # +# Copyright (c) 2008-2024 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 os +import sys + +if sys.platform.startswith('linux'): + # TODO: check if this is valid on non-arch distros. Maybe search for QtWebEngineProcess ? + os.environ['QTWEBENGINEPROCESS_PATH'] = '_internal/PyQt5/Qt5/lib/qt/libexec/QtWebEngineProcess' diff --git a/pyinstaller-hooks/rthook_ssl.py b/pyinstaller-hooks/rthook_ssl.py index dbce3e7..c6b7ef0 100644 --- a/pyinstaller-hooks/rthook_ssl.py +++ b/pyinstaller-hooks/rthook_ssl.py @@ -4,7 +4,7 @@ ########################################################################## # OpenLP - Open Source Lyrics Projection # # ---------------------------------------------------------------------- # -# Copyright (c) 2008-2019 OpenLP Developers # +# Copyright (c) 2008-2024 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 # diff --git a/scripts/deb_version.py b/scripts/deb_version.py index ad5927f..738e342 100755 --- a/scripts/deb_version.py +++ b/scripts/deb_version.py @@ -5,7 +5,7 @@ ########################################################################## # OpenLP - Open Source Lyrics Projection # # ---------------------------------------------------------------------- # -# Copyright (c) 2008-2019 OpenLP Developers # +# Copyright (c) 2008-2024 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 # diff --git a/scripts/fix_bzr.py b/scripts/fix_bzr.py index 6871c48..d7c3491 100755 --- a/scripts/fix_bzr.py +++ b/scripts/fix_bzr.py @@ -5,7 +5,7 @@ ########################################################################## # OpenLP - Open Source Lyrics Projection # # ---------------------------------------------------------------------- # -# Copyright (c) 2008-2019 OpenLP Developers # +# Copyright (c) 2008-2024 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 # diff --git a/scripts/openlp_tweeter.py b/scripts/openlp_tweeter.py index 82d079f..166825c 100755 --- a/scripts/openlp_tweeter.py +++ b/scripts/openlp_tweeter.py @@ -5,7 +5,7 @@ ########################################################################## # OpenLP - Open Source Lyrics Projection # # ---------------------------------------------------------------------- # -# Copyright (c) 2008-2019 OpenLP Developers # +# Copyright (c) 2008-2024 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 # diff --git a/scripts/openlp_version.py b/scripts/openlp_version.py index 36eab0d..104b45b 100755 --- a/scripts/openlp_version.py +++ b/scripts/openlp_version.py @@ -5,7 +5,7 @@ ########################################################################## # OpenLP - Open Source Lyrics Projection # # ---------------------------------------------------------------------- # -# Copyright (c) 2008-2019 OpenLP Developers # +# Copyright (c) 2008-2024 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 # diff --git a/scripts/openlptweet.py b/scripts/openlptweet.py index 25da2a0..b3fa240 100755 --- a/scripts/openlptweet.py +++ b/scripts/openlptweet.py @@ -5,7 +5,7 @@ ########################################################################## # OpenLP - Open Source Lyrics Projection # # ---------------------------------------------------------------------- # -# Copyright (c) 2008-2019 OpenLP Developers # +# Copyright (c) 2008-2024 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 #