qt-5.15.2-macosx10.13-x86_64-arm64.bash 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. #!/usr/bin/env bash
  2. # 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/makeuniversal
  7. #
  8. # Build it with an existing local Qt installation first.
  9. #
  10. # Set the PATH environment variable to contain the location of 'makeuniversal'.
  11. set -e
  12. set -x
  13. umask 022
  14. # Verify that 'makeuniversal' is available in the PATH.
  15. type -p makeuniversal >/dev/null
  16. # Download, verify, and extract sources.
  17. curl -OL https://download.qt.io/archive/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz
  18. shasum -a 256 qt-everywhere-src-5.15.2.tar.xz | grep -q 3a530d1b243b5dec00bc54937455471aaa3e56849d2593edb8ded07228202240
  19. tar xjf qt-everywhere-src-5.15.2.tar.xz
  20. # Build the x86_64 variant.
  21. mkdir qt-5.15.2-x86_64
  22. cd qt-5.15.2-x86_64
  23. ../qt-everywhere-src-5.15.2/configure \
  24. --prefix=/ \
  25. -platform macx-clang \
  26. -device-option QMAKE_APPLE_DEVICE_ARCHS=x86_64 \
  27. -device-option QMAKE_MACOSX_DEPLOYMENT_TARGET=10.13 \
  28. -release \
  29. -opensource -confirm-license \
  30. -gui \
  31. -widgets \
  32. -no-gif \
  33. -no-icu \
  34. -no-pch \
  35. -no-angle \
  36. -no-opengl \
  37. -no-dbus \
  38. -no-harfbuzz \
  39. -skip declarative \
  40. -skip multimedia \
  41. -skip qtcanvas3d \
  42. -skip qtcharts \
  43. -skip qtconnectivity \
  44. -skip qtdeclarative \
  45. -skip qtgamepad \
  46. -skip qtlocation \
  47. -skip qtmultimedia \
  48. -skip qtnetworkauth \
  49. -skip qtpurchasing \
  50. -skip qtremoteobjects \
  51. -skip qtscript \
  52. -skip qtsensors \
  53. -skip qtserialbus \
  54. -skip qtserialport \
  55. -skip qtsvg \
  56. -skip qtwebchannel \
  57. -skip qtwebengine \
  58. -skip qtwebsockets \
  59. -skip qtxmlpatterns \
  60. -nomake examples \
  61. -nomake tests \
  62. -nomake tools
  63. make -j 8
  64. cd ..
  65. # Build the arm64 variant.
  66. mkdir qt-5.15.2-arm64
  67. cd qt-5.15.2-arm64
  68. ../qt-everywhere-src-5.15.2/configure \
  69. --prefix=/ \
  70. -platform macx-clang \
  71. -device-option QMAKE_APPLE_DEVICE_ARCHS=arm64 \
  72. -device-option QMAKE_MACOSX_DEPLOYMENT_TARGET=10.13 \
  73. -release \
  74. -opensource -confirm-license \
  75. -gui \
  76. -widgets \
  77. -no-gif \
  78. -no-icu \
  79. -no-pch \
  80. -no-angle \
  81. -no-opengl \
  82. -no-dbus \
  83. -no-harfbuzz \
  84. -skip declarative \
  85. -skip multimedia \
  86. -skip qtcanvas3d \
  87. -skip qtcharts \
  88. -skip qtconnectivity \
  89. -skip qtdeclarative \
  90. -skip qtgamepad \
  91. -skip qtlocation \
  92. -skip qtmultimedia \
  93. -skip qtnetworkauth \
  94. -skip qtpurchasing \
  95. -skip qtremoteobjects \
  96. -skip qtscript \
  97. -skip qtsensors \
  98. -skip qtserialbus \
  99. -skip qtserialport \
  100. -skip qtsvg \
  101. -skip qtwebchannel \
  102. -skip qtwebengine \
  103. -skip qtwebsockets \
  104. -skip qtxmlpatterns \
  105. -nomake examples \
  106. -nomake tests \
  107. -nomake tools
  108. make -j 8 -k
  109. cd ..
  110. # Combine the two builds into universal binaries.
  111. makeuniversal qt-5.15.2-univ qt-5.15.2-x86_64 qt-5.15.2-arm64
  112. cd qt-5.15.2-univ
  113. make install -j 8 INSTALL_ROOT=/tmp/qt-5.15.2-macosx10.13-x86_64-arm64
  114. cd ..
  115. # Create the final tarball containing universal binaries.
  116. tar cjf qt-5.15.2-macosx10.13-x86_64-arm64.tar.xz -C /tmp qt-5.15.2-macosx10.13-x86_64-arm64