Path: blob/master/Utilities/Release/macos/qt-5.15.2-macosx10.13-x86_64-arm64.bash
3153 views
#!/usr/bin/env bash12# Run this script on a macOS x86_64 host to generate Qt universal binaries.3#4# This script requires the 'makeuniversal' tool from:5#6# https://github.com/fizzyade/makeuniversal7#8# Build it with an existing local Qt installation first.9#10# Set the PATH environment variable to contain the location of 'makeuniversal'.1112set -e13set -x1415umask 0221617# Verify that 'makeuniversal' is available in the PATH.18type -p makeuniversal >/dev/null1920# Download, verify, and extract sources.21curl -OL https://download.qt.io/archive/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz22shasum -a 256 qt-everywhere-src-5.15.2.tar.xz | grep -q 3a530d1b243b5dec00bc54937455471aaa3e56849d2593edb8ded0722820224023tar xjf qt-everywhere-src-5.15.2.tar.xz2425# Build the x86_64 variant.26mkdir qt-5.15.2-x86_6427cd qt-5.15.2-x86_6428../qt-everywhere-src-5.15.2/configure \29--prefix=/ \30-platform macx-clang \31-device-option QMAKE_APPLE_DEVICE_ARCHS=x86_64 \32-device-option QMAKE_MACOSX_DEPLOYMENT_TARGET=10.13 \33-release \34-opensource -confirm-license \35-gui \36-widgets \37-no-gif \38-no-icu \39-no-pch \40-no-angle \41-no-opengl \42-no-dbus \43-no-harfbuzz \44-skip declarative \45-skip multimedia \46-skip qtcanvas3d \47-skip qtcharts \48-skip qtconnectivity \49-skip qtdeclarative \50-skip qtgamepad \51-skip qtlocation \52-skip qtmultimedia \53-skip qtnetworkauth \54-skip qtpurchasing \55-skip qtremoteobjects \56-skip qtscript \57-skip qtsensors \58-skip qtserialbus \59-skip qtserialport \60-skip qtsvg \61-skip qtwebchannel \62-skip qtwebengine \63-skip qtwebsockets \64-skip qtxmlpatterns \65-nomake examples \66-nomake tests \67-nomake tools68make -j 869cd ..7071# Build the arm64 variant.72mkdir qt-5.15.2-arm6473cd qt-5.15.2-arm6474../qt-everywhere-src-5.15.2/configure \75--prefix=/ \76-platform macx-clang \77-device-option QMAKE_APPLE_DEVICE_ARCHS=arm64 \78-device-option QMAKE_MACOSX_DEPLOYMENT_TARGET=10.13 \79-release \80-opensource -confirm-license \81-gui \82-widgets \83-no-gif \84-no-icu \85-no-pch \86-no-angle \87-no-opengl \88-no-dbus \89-no-harfbuzz \90-skip declarative \91-skip multimedia \92-skip qtcanvas3d \93-skip qtcharts \94-skip qtconnectivity \95-skip qtdeclarative \96-skip qtgamepad \97-skip qtlocation \98-skip qtmultimedia \99-skip qtnetworkauth \100-skip qtpurchasing \101-skip qtremoteobjects \102-skip qtscript \103-skip qtsensors \104-skip qtserialbus \105-skip qtserialport \106-skip qtsvg \107-skip qtwebchannel \108-skip qtwebengine \109-skip qtwebsockets \110-skip qtxmlpatterns \111-nomake examples \112-nomake tests \113-nomake tools114make -j 8 -k115cd ..116117# Combine the two builds into universal binaries.118makeuniversal qt-5.15.2-univ qt-5.15.2-x86_64 qt-5.15.2-arm64119cd qt-5.15.2-univ120make install -j 8 INSTALL_ROOT=/tmp/qt-5.15.2-macosx10.13-x86_64-arm64121cd ..122123# Create the final tarball containing universal binaries.124tar cjf qt-5.15.2-macosx10.13-x86_64-arm64.tar.xz -C /tmp qt-5.15.2-macosx10.13-x86_64-arm64125126127