TESTED WITH: Qt-dev (from git) Python-3.5.2 sip-4.19.1 PyQt-5.8 NOTES: - installs pyqtdeploy to dev SYSROOT, symlink to ~/bin - other 'python' exes are used from respective SYSROOT TODO: - change $SYSROOT/src to $SYSROOT/build b/c that's where pyqtdeploy expects it to be BASH_PROFILE: # call the appropriate one before building/using each SYSROOT function pyqt-dev { export SYSROOT=$HOME/dev/vendor/pyqt-sysroot-dev export DYLD_LIBRARY_PATH=$SYSROOT/lib export PATH=$SYSROOT/bin:$PATH } function pyqt-ios { export SYSROOT=$HOME/dev/vendor/pyqt-sysroot-ios-64 export DYLD_LIBRARY_PATH=$SYSROOT/lib export PATH=$SYSROOT/bin:$PATH } function pyqt-simulator { export SYSROOT=$HOME/dev/vendor/pyqt-sysroot-iphonesimulator export DYLD_LIBRARY_PATH=$SYSROOT/lib export PATH=$SYSROOT/bin:$PATH } function pyqt-osx { export SYSROOT=$HOME/dev/vendor/pyqt-sysroot-osx-64 export DYLD_LIBRARY_PATH=$SYSROOT/lib2 export PATH=$SYSROOT/bin:$PATH } QT REPO: - git clone https://code.qt.io/qt/qt5.git ~/dev/vendor/pyqt-sysroot-base/src/qt5-src - ./init-repository --module-subset=qtbase PATCH PYQTDEPLOY: - site-packages/pyqtdeploy/python/configurations/config_py3.c: - extern PyObject* PyInit_time(void); extern PyObject* PyInit_math(void); extern PyObject* PyInit__pickle(void); extern PyObject* PyInit__datetime(void); extern PyObject* PyInit__struct(void); - {"time", PyInit_time}, {"math", PyInit_math}, {"pickle", PyInit__pickle}, {"_datetime", PyInit__datetime}, {"_struct", PyInit__struct}, - $PYTHON/site-packages/pyqtdeploy/python/configurations/python.pro - MODULE_SOURCES := Modules/timemodule.c \ Modules/mathmodule.c \ Modules/_math.c \ Modules/_pickle.c \ Modules/_datetimemodule.c - $PYTHON/site-packages/pyqtdeploy/python/configurations/python.pro - Modules/timemodule.c Modules/mathmodule.c Modules/_math.c Modules/_pickle.c Modules/_datetimemodule.c Modules/_struct.c Modules/binascii.c Modules/sha512module.c Modules/_randommodule.c Modules/sha256module.c Modules/sha1module.c Modules/md5module.c Modules/zlibmodule.c # Modules/zlib/adler32.c Modules/zlib/deflate.c Modules/zlib/gzlib.c Modules/zlib/infback.c Modules/zlib/inftrees.c Modules/zlib/uncompr.c Modules/zlib/compress.c Modules/zlib/example.c Modules/zlib/gzread.c Modules/zlib/inffast.c Modules/zlib/minigzip.c Modules/zlib/zutil.c Modules/zlib/crc32.c Modules/zlib/gzclose.c Modules/zlib/gzwrite.c Modules/zlib/inflate.c Modules/zlib/trees.c - site-packages/pyqtdeploy/builder/builder.py: (make sure vars are not random in .pro output for source control) - replace: " = {}" => " = Orderedict()" - replace: "set()" => "OrderedSet()" import collections class OrderedSet(collections.MutableSet): def __init__(self, iterable=None): self.end = end = [] end += [None, end, end] # sentinel node for doubly linked list self.map = collections.OrderedDict() # key --> [key, prev, next] if iterable is not None: self |= iterable def __len__(self): return len(self.map) def __contains__(self, key): return key in self.map def add(self, key): if key not in self.map: end = self.end curr = end[1] curr[2] = end[1] = self.map[key] = [key, curr, end] def discard(self, key): if key in self.map: key, prev, next = self.map.pop(key) prev[2] = next next[1] = prev def update(self, keys): for k in keys: self.add(k) def __iter__(self): end = self.end curr = end[2] while curr is not end: yield curr[0] curr = curr[2] def __reversed__(self): end = self.end curr = end[1] while curr is not end: yield curr[0] curr = curr[1] def pop(self, last=True): if not self: raise KeyError('set is empty') key = self.end[1][0] if last else self.end[2][0] self.discard(key) return key def __repr__(self): if not self: return '%s()' % (self.__class__.__name__,) return '%s(%r)' % (self.__class__.__name__, list(self)) def __eq__(self, other): if isinstance(other, OrderedSet): return len(self) == len(other) and list(self) == list(other) return set(self) == set(other) BUILD STEPS: pyqt-sysroot-dev (debug): - Qt: - ../../../pyqt-sysroot-base/src/qt5-src/configure -debug -opensource -confirm-license -nomake examples -nomake tests -prefix $PWD - make -j8 - Python: - uncomment/set SSL dir in Modules/Setup.dist - ./configure --with-pydebug --prefix=$SYSROOT -with-ensurepip=install - pip install pyqtdeploy - make -j8; make install - sip: - python configure.py —-debug - PyQt: - python configure.py --enable=QtCore --enable=QtGui --enable=QtWidgets --enable QtPrintSupport --enable QtNetwork --enable QtTest --concatenate -b $SYSROOT/bin --qmake $SYSROOT/build/qt5/qtbase/bin/qmake --no-designer-plugin --no-qml-plugin --debug --confirm-license pyqt-sysroot-ios (debug, release): - env: - ln -s ../../pyqt-sysroot-dev/bin/pyqtdeploy* $SYSROOT/bin - ln -s ../../pyqt-sysroot-dev/bin/python $SYSROOT/bin - Qt - ../../../pyqt-sysroot-base/src/qt5-src/configure -static -debug-and-release -xplatform macx-ios-clang -nomake examples -nomake tests -opensource -confirm-license -qt-pcre -developer-build - make -j10 - Python - pyqtdeploycli --package python --target ios-64 configure - qmake SYSROOT=$SYSROOT - make -j10; make install - sip: - pyqtdeploycli --package sip --target ios-64 configure - python configure.py --static --sysroot=$SYSROOT --no-tools --use-qmake --configuration=sip-ios.cfg - qmake - make -j10; make install - PyQt: - pyqtdeploycli --package pyqt5 --target ios-64 configure - python configure.py --static --debug --sysroot=$SYSROOT --no-qsci-api --no-designer-plugin --no-qml-plugin --configuration=pyqt5-ios.cfg -b $SYSROOT/bin --qmake /Users/patrick/dev/vendor/pyqt-sysroot-ios-64/build/qt5/qtbase/bin/qmake --enable=QtCore --enable=QtGui --enable=QtWidgets --enable QtPrintSupport --concatenate --confirm-license - make -j10; make install pyqt-sysroot-osx (release): - Qt: - ../../../pyqt-sysroot-base/src/qt5-src/configure -opensource -confirm-license -nomake examples -nomake tests -prefix $PWD -static -release - Python: - pyqtdeploycli --package python --target osx-64 configure - qmake SYSROOT=$SYSROOT - make -j10; make install - sip: - pyqtdeploycli --package sip --target osx-64 configure - python configure.py --static --sysroot=$SYSROOT --use-qmake --configuration=sip-osx.cfg - qmake - cp sipgen/sip ../../bin # ????? - PyQt: - pyqtdeploycli --package pyqt5 --target osx-64 configure - python configure.py --static --sysroot=$SYSROOT --no-qsci-api --no-designer-plugin --no-qml-plugin --configuration=pyqt5-osx.cfg -b $SYSROOT/bin --enable=QtCore --enable=QtGui --enable=QtNetwork --enable=QtWidgets --enable=QtPrintSupport --concatenate --qmake $SYSROOT/build/qt5/qtbase/bin/qmake --confirm-license - make -j10; make install