diff --git a/packages/pyqtdeploy/README.md b/packages/pyqtdeploy/README.md new file mode 100644 index 00000000..6f052dfb --- /dev/null +++ b/packages/pyqtdeploy/README.md @@ -0,0 +1,50 @@ +This directory contains the files needed for building pyqtdeploy bundle. + +Now you can manually build the bundle for linux. Assuming your sysroot +dir will be in SYSROOTDIR (you'll need about 6GB free space there for +building Qt) and sources - in SOURCEDIR, the build steps are following: + +1. cd $SOURCEDIR && exec /path/to/PyBitmessage/packages/pyqtdeploy/download.sh +1. cd /path/to/PyBitmessage/packages/pyqtdeploy +1. pyqtdeploy-sysroot --source-dir $SOURCEDIR --sysroot $SYSROOTDIR --target linux-64 --plugin-dir plugins sysroot.json +1. virtualenv depends +1. source depends/bin/activate +1. pip install enum34 msgpack qtpy stem +1. deactivate +1. pyqtdeploy-build --sysroot $SYSROOTDIR --target linux-64 pybitmessage.pdy +1. cd build-linux-64 +1. mv resources/src resources/pybitmessage +1. sed -i "s|src/|pybitmessage/|g" resources/pyqtdeploy.qrc +1. $SYSROOTDIR/host/bin/qmake +1. make + +The resulting PyBitmessage binary may require some shared libraries, +particularly openssl. + +There is also a possible issue with pyexpat related to `sqlite3`: + +``` +2020-07-10 18:36:01,135 - WARNING - Using default logger configuration +2020-07-10 18:36:01,517 - CRITICAL - Unhandled exception +Traceback (most recent call last): + File ":/src/bitmessagemain.py", line 477, in main + File ":/src/bitmessagemain.py", line 354, in start + File ":/src/bitmessageqt/__init__.py", line 4288, in run + File ":/src/bitmessageqt/__init__.py", line 595, in __init__ + File ":/src/bitmessageqt/bitmessageui.py", line 542, in setupUi + File ":/src/bitmessageqt/blacklist.py", line 18, in __init__ + File ":/src/bitmessageqt/widgets.py", line 25, in load + File ":/PyQt5/uic/__init__.pyo", line 226, in loadUi + File ":/PyQt5/uic/Loader/loader.pyo", line 72, in loadUi + File ":/PyQt5/uic/uiparser.pyo", line 1013, in parse + File ":/xml/etree/ElementTree.py", line 1182, in parse + File ":/xml/etree/ElementTree.py", line 651, in parse + File ":/xml/etree/ElementTree.py", line 1476, in __init__ + File ":/xml/parsers/expat.py", line 4, in +SystemError: _PyImport_FixupExtension: module pyexpat not loaded +``` + +--- +ref: +(pyqtdeploy v2.5.1 User Guide)[https://www.riverbankcomputing.com/static/Docs/pyqtdeploy/index.html] +(medium article)[https://medium.com/@Lola_Dam/packaging-pyqt-application-using-pyqtdeploy-for-both-linux-and-android-32ac7824708b] diff --git a/packages/pyqtdeploy/download.sh b/packages/pyqtdeploy/download.sh new file mode 100755 index 00000000..bc0afaef --- /dev/null +++ b/packages/pyqtdeploy/download.sh @@ -0,0 +1,9 @@ +#!/bin/sh +wget https://www.zlib.net/fossils/zlib-1.2.11.tar.gz +wget http://download.qt.io/official_releases/qt/5.12/5.12.2/single/qt-everywhere-src-5.12.2.tar.xz +wget https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tar.xz +wget https://www.riverbankcomputing.com/static/Downloads/sip/4.19.23/sip-4.19.23.tar.gz +wget https://www.riverbankcomputing.com/static/Downloads/PyQt5/5.13.2/PyQt5-5.13.2.tar.gz +wget https://ftp.openssl.org/source/openssl-1.1.1g.tar.gz +wget https://github.com/libffi/libffi/releases/download/v3.3/libffi-3.3.tar.gz +wget https://github.com/libexpat/libexpat/releases/download/R_2_2_9/expat-2.2.9.tar.xz diff --git a/packages/pyqtdeploy/plugins/libffi.py b/packages/pyqtdeploy/plugins/libffi.py new file mode 100644 index 00000000..c8115b1b --- /dev/null +++ b/packages/pyqtdeploy/plugins/libffi.py @@ -0,0 +1,58 @@ +# Copyright (c) 2019, Riverbank Computing Limited +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + + +from pyqtdeploy import ComponentBase, ComponentOption + + +class libffiComponent(ComponentBase): + """The libffi component.""" + + # The component options. + options = [ + ComponentOption( + 'source', required=True, + help="The archive containing the libffi source code."), + ComponentOption( + 'static_msvc_runtime', type=bool, + help="Set if the MSVC runtime should be statically linked."), + ] + + def build(self, sysroot): + """Build libffi for the target.""" + + archive = sysroot.find_file(self.source) + sysroot.unpack_archive(archive) + + sysroot.run( + './configure', '--enable-static', + '--prefix=' + sysroot.sysroot_dir) + sysroot.run(sysroot.host_make) + sysroot.run(sysroot.host_make, 'install') + + def configure(self, sysroot): + """Complete the configuration of the component.""" + + sysroot.verify_source(self.source) diff --git a/packages/pyqtdeploy/pybitmessage.pdy b/packages/pyqtdeploy/pybitmessage.pdy new file mode 100644 index 00000000..d628b55b --- /dev/null +++ b/packages/pyqtdeploy/pybitmessage.pdy @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/packages/pyqtdeploy/sysroot.json b/packages/pyqtdeploy/sysroot.json new file mode 100644 index 00000000..2a8f2636 --- /dev/null +++ b/packages/pyqtdeploy/sysroot.json @@ -0,0 +1,109 @@ +{ + "Description": "The sysroot for PyBitmessage.", + + "android|macos|win#openssl": { + "android#source": "openssl-1.1.0l.tar.gz", + "macos|win#source": "openssl-1.0.2t.tar.gz", + "win#no_asm": true + }, + + "linux|macos|win#zlib": { + "source": "zlib-1.2.11.tar.gz", + "static_msvc_runtime": true + }, + + "libffi": { + "source": "libffi-3.3.tar.gz" + }, + + "qt5": { + "android-32#qt_dir": "android_armv7", + "android-64#qt_dir": "android_arm64_v8a", + "ios#qt_dir": "ios", + + "linux|macos|win#source": "qt-everywhere-src-5.12.2.tar.xz", + "edition": "opensource", + + "android|linux#ssl": "openssl-runtime", + "ios#ssl": "securetransport", + "macos|win#ssl": "openssl-linked", + + "configure_options": [ + "-no-gif", "-qt-libpng", "-qt-libjpeg", + "-no-dbus", "-no-cups", "-fontconfig", + "-qt-harfbuzz", "-qt-pcre", "-no-sql-db2", + "-no-sql-ibase", "-no-sql-mysql", "-no-sql-sqlite", + "-no-sql-sqlite2", "-no-sql-oci", "-no-sql-odbc", + "-no-sql-psql", "-no-sql-tds", "-qt-sqlite", "-ccache" + ], + "skip": [ + "qt3d", "qtactiveqt", "qtcanvas3d", + "qtcharts", "qtdatavis3d", "qtdeclarative", + "qtdoc", "qtgamepad", "qtgraphicaleffects", "qtlocation", + "qtpurchasing", "qtquickcontrols", "qtquickcontrols2", + "qtscript", "qtscxml", "qtsensors", "qtserialbus", + "qtserialport", "qtspeech", "qtsvg", "qttools", + "qtvirtualkeyboard", "qtwayland", + "qtwebchannel", "qtwebengine", "qtwebglplugin", + "qtwebsockets", "qtwebview", "qtxmlpatterns" + ], + + "disabled_features": [ + "concurrent", "future", + "cups", "printer", "printdialog", "printpreviewdialog", + "printpreviewwidget", "sql", "sqlmodel", "testlib" + ], + + "static_msvc_runtime": true + }, + + "python": { + "build_host_from_source": false, + "build_target_from_source": true, + "dynamic_loading": true, + "source": "Python-2.7.18.tar.xz" + }, + + "sip": { + "module_name": "PyQt5.sip", + "source": "sip-4.19.23.tar.gz" + }, + + "pyqt5": { + "android#disabled_features": [ + "PyQt_Desktop_OpenGL", "PyQt_Printer", "PyQt_PrintDialog", + "PyQt_PrintPreviewDialog", "PyQt_PrintPreviewWidget" + ], + "android#modules": [ + "QtCore", "QtGui", "QtNetwork", "QtWidgets", "QtAndroidExtras" + ], + + "ios#disabled_features": [ + "PyQt_Desktop_OpenGL", "PyQt_MacOSXOnly", + "PyQt_MacCocoaViewContainer", "PyQt_Printer", + "PyQt_PrintDialog", "PyQt_PrintPreviewDialog", + "PyQt_PrintPreviewWidget", "PyQt_Process", + "PyQt_NotBootstrapped" + ], + "ios|macos#modules": [ + "QtCore", "QtGui", "QtNetwork", "QtWidgets", "QtMacExtras" + ], + + "linux#disabled_features": [ + "PyQt_Desktop_OpenGL", "PyQt_Printer", "PyQt_PrintDialog", + "PyQt_PrintPreviewDialog", "PyQt_PrintPreviewWidget" + ], + "linux#modules": [ + "QtCore", "QtGui", "QtNetwork", "QtWidgets", "QtXml", + "QtX11Extras" + ], + + "win#disabled_features": ["PyQt_Desktop_OpenGL"], + "win#modules": [ + "QtCore", "QtGui", "QtNetwork", "QtWidgets", "QtWinExtras" + ], + + "source": "PyQt5-5.13.2.tar.gz" + } + +}