Here is a bash script I made to automate building my development sysroot on macOS. Edit to your liking.
[bash]
#!/bin/sh
set -e
export QT_VERSION=5.14.0-patched
export PYTHON_VERSION=3.6.4-patched
export SIP_VERSION=4.19.19
export PYQT_VERSION=5.13.1
export PYQT_PURCHASING_VERSION=5.13.0-patched
export QSCINTILLA_VERSION=2.11.2
if [ `hostname` = "vedanamedia" ]; then # production
export QT_CONFIG_OPTS="-release -no-gui -no-feature-network -no-feature-xml -skip qtdeclarative"
else
export QT_CONFIG_OPTS="-debug -no-framework"
fi
NCORES=1
PLATFORM=’unknown’
OS=`uname`
if [[ "$OS" == ‘Linux’ ]]; then
NCORES=`cat /proc/cpuinfo | grep processor | wc -l`
elif [[ "$OS" == ‘Darwin’ ]]; then
NCORES=`sysctl -n hw.ncpu`
fi
echo "Detected $NCORES CPU cores"
# if [ $NCORES = "0" ]; then
# export _MAKEOPTS="-j$(($NCORES-1))"
# fi
export _MAKEOPTS="-j$(($NCORES-1))"
if [ -z ${SYSROOT+x} ]; then
export SYSROOT=/Users/patrick/dev/vendor/sysroot-dev
fi
export PATH=$SYSROOT/bin:$PATH
mkdir -p $SYSROOT/build
echo "Building Qt $QT_VERSION…"
cd $SYSROOT/build
tar zxf ../../src/qt-everywhere-src-$QT_VERSION.tar.gz
cd qt-everywhere-src-$QT_VERSION
./configure -opensource -confirm-license -debug -nomake examples -nomake tests -prefix $SYSROOT $QT_CONFIG_OPTS -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtgamepad -skip qtremoteobjects -skip qtscript -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebglplugin -skip qtwebsockets -skip qtwebview -skip qtlottie -skip qtdatavis3d -skip qtconnectivity -skip qtcharts -skip qtandroidextras -skip qtdoc -skip qtnetworkauth -skip qtqa -skip qtrepotools -skip qtscxml -skip qtsensors -skip qtsvg -skip qttools -skip qttranslations -skip qtwinextras -skip qtx11extras -skip qtxmlpatterns -skip qtmultimedia
make $_MAKEOPTS && make $_MAKEOPTS install
echo "Building Python-$PYTHON_VERSION…"
cd $SYSROOT/build
tar zxf ../../src/Python-$PYTHON_VERSION.tgz
cd Python-$PYTHON_VERSION
export CFLAGS="-I$(brew –prefix openssl)/include -I$(xcrun –show-sdk-path)/usr/include -Wno-nullability-completeness -Wno-strict-prototypes"
export LDFLAGS="-L$(brew –prefix openssl)/lib -I$(xcrun –show-sdk-path)/usr/lib"
pwd
cp ../../../src/Python-$PYTHON_VERSION-Setup.dist ./Modules
./configure –prefix=$SYSROOT -with-ensurepip=install –with-system-expat –with-pydebug
make $_MAKEOPTS && make $_MAKEOPTS install
cd $SYSROOT/bin && ln -sf python3 python && ln -sf pip3 pip
$SYSROOT/bin/pip install –upgrade pip
echo "Building sip-$SIP_VERSION…"
cd $SYSROOT/build
tar zxvf ../../src/sip-$SIP_VERSION.tar.gz && cd sip-$SIP_VERSION/
python configure.py –sip-module PyQt5.sip –debug –sysroot=$SYSROOT
make $_MAKEOPTS && make $_MAKEOPTS install
echo "Building PyQt-$PYQT_VERSION…"
cd $SYSROOT/build
tar zxf ../../src/PyQt5_gpl-$PYQT_VERSION.tar.gz && cd PyQt5_gpl-$PYQT_VERSION
python configure.py –enable QtCore –enable QtGui –enable QtWidgets –enable QtPrintSupport –enable QtNetwork –enable QtQuick –enable QtQuickWidgets –enable QtLocation –enable QtQml –enable QtPositioning –enable QtMacExtras –enable QtTest –concatenate -b $SYSROOT/bin –qmake `which qmake` –no-designer-plugin –no-qml-plugin –debug –confirm-license
make $_MAKEOPTS && make install # no multiprocessing on make install, it tends to fail
echo "Building PyQtPurchasing-$PYQT_PURCHASING_VERSION…"
cd $SYSROOT/build
tar zxf ../../src/PyQtPurchasing_gpl-$PYQT_PURCHASING_VERSION.tar.gz && cd PyQtPurchasing_gpl-$PYQT_PURCHASING_VERSION
python configure.py –debug –sysroot=$SYSROOT
make install # multiprocessing tends to fail.
echo "Building QScintilla-$QSCINTILLA_VERSION…"
cd $SYSROOT/build
tar zxf ../../src/QScintilla_gpl-$QSCINTILLA_VERSION.tar.gz && cd QScintilla_gpl-$QSCINTILLA_VERSION
cd Qt4Qt5 && qmake && make -j12 install
cd ../Python && python configure.py –pyqt=PyQt5 –debug && make -j12 install
echo "Installing pip packages…"
pip install profilehooks netifaces pytest pytest-qt requests flask pycallgraph python-dateutil coverage pytest-cov
[/bash]