You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. PACKAGE=qt
  2. $(package)_version=5.7.1
  3. $(package)_download_path=http://download.qt.io/official_releases/qt/5.7/$($(package)_version)/submodules
  4. $(package)_suffix=opensource-src-$($(package)_version).tar.gz
  5. $(package)_file_name=qtbase-$($(package)_suffix)
  6. $(package)_sha256_hash=95f83e532d23b3ddbde7973f380ecae1bac13230340557276f75f2e37984e410
  7. $(package)_dependencies=openssl zlib
  8. $(package)_linux_dependencies=freetype fontconfig libxcb libX11 xproto libXext
  9. $(package)_build_subdir=qtbase
  10. $(package)_qt_libs=corelib network widgets gui plugins testlib
  11. $(package)_patches=mac-qmake.conf mingw-uuidof.patch pidlist_absolute.patch fix-xcb-include-order.patch fix_qt_pkgconfig.patch fix-cocoahelpers-macos.patch
  12. $(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
  13. $(package)_qttranslations_sha256_hash=3a15aebd523c6d89fb97b2d3df866c94149653a26d27a00aac9b6d3020bc5a1d
  14. $(package)_qttools_file_name=qttools-$($(package)_suffix)
  15. $(package)_qttools_sha256_hash=22d67de915cb8cd93e16fdd38fa006224ad9170bd217c2be1e53045a8dd02f0f
  16. $(package)_extra_sources = $($(package)_qttranslations_file_name)
  17. $(package)_extra_sources += $($(package)_qttools_file_name)
  18. define $(package)_set_vars
  19. $(package)_config_opts_release = -release
  20. $(package)_config_opts_debug = -debug
  21. $(package)_config_opts += -bindir $(build_prefix)/bin
  22. $(package)_config_opts += -c++std c++11
  23. $(package)_config_opts += -confirm-license
  24. $(package)_config_opts += -dbus-runtime
  25. $(package)_config_opts += -hostprefix $(build_prefix)
  26. $(package)_config_opts += -no-alsa
  27. $(package)_config_opts += -no-audio-backend
  28. $(package)_config_opts += -no-cups
  29. $(package)_config_opts += -no-egl
  30. $(package)_config_opts += -no-eglfs
  31. $(package)_config_opts += -no-feature-style-windowsmobile
  32. $(package)_config_opts += -no-feature-style-windowsce
  33. $(package)_config_opts += -no-freetype
  34. $(package)_config_opts += -no-gif
  35. $(package)_config_opts += -no-glib
  36. $(package)_config_opts += -no-gstreamer
  37. $(package)_config_opts += -no-icu
  38. $(package)_config_opts += -no-iconv
  39. $(package)_config_opts += -no-kms
  40. $(package)_config_opts += -no-linuxfb
  41. $(package)_config_opts += -no-libudev
  42. $(package)_config_opts += -no-mitshm
  43. $(package)_config_opts += -no-mtdev
  44. $(package)_config_opts += -no-pulseaudio
  45. $(package)_config_opts += -no-openvg
  46. $(package)_config_opts += -no-reduce-relocations
  47. $(package)_config_opts += -no-qml-debug
  48. $(package)_config_opts += -no-sql-db2
  49. $(package)_config_opts += -no-sql-ibase
  50. $(package)_config_opts += -no-sql-oci
  51. $(package)_config_opts += -no-sql-tds
  52. $(package)_config_opts += -no-sql-mysql
  53. $(package)_config_opts += -no-sql-odbc
  54. $(package)_config_opts += -no-sql-psql
  55. $(package)_config_opts += -no-sql-sqlite
  56. $(package)_config_opts += -no-sql-sqlite2
  57. $(package)_config_opts += -no-use-gold-linker
  58. $(package)_config_opts += -no-xinput2
  59. $(package)_config_opts += -no-xrender
  60. $(package)_config_opts += -nomake examples
  61. $(package)_config_opts += -nomake tests
  62. $(package)_config_opts += -opensource
  63. $(package)_config_opts += -openssl-linked
  64. $(package)_config_opts += -optimized-qmake
  65. $(package)_config_opts += -pch
  66. $(package)_config_opts += -pkg-config
  67. $(package)_config_opts += -prefix $(host_prefix)
  68. $(package)_config_opts += -qt-libpng
  69. $(package)_config_opts += -qt-libjpeg
  70. $(package)_config_opts += -qt-pcre
  71. $(package)_config_opts += -system-zlib
  72. $(package)_config_opts += -reduce-exports
  73. $(package)_config_opts += -static
  74. $(package)_config_opts += -silent
  75. $(package)_config_opts += -v
  76. $(package)_config_opts += -no-feature-printer
  77. $(package)_config_opts += -no-feature-printdialog
  78. ifneq ($(build_os),darwin)
  79. $(package)_config_opts_darwin = -xplatform macx-clang-linux
  80. $(package)_config_opts_darwin += -device-option MAC_SDK_PATH=$(OSX_SDK)
  81. $(package)_config_opts_darwin += -device-option MAC_SDK_VERSION=$(OSX_SDK_VERSION)
  82. $(package)_config_opts_darwin += -device-option CROSS_COMPILE="$(host)-"
  83. $(package)_config_opts_darwin += -device-option MAC_MIN_VERSION=$(OSX_MIN_VERSION)
  84. $(package)_config_opts_darwin += -device-option MAC_TARGET=$(host)
  85. $(package)_config_opts_darwin += -device-option MAC_LD64_VERSION=$(LD64_VERSION)
  86. endif
  87. $(package)_config_opts_linux = -qt-xkbcommon
  88. $(package)_config_opts_linux += -qt-xcb
  89. $(package)_config_opts_linux += -system-freetype
  90. $(package)_config_opts_linux += -no-sm
  91. $(package)_config_opts_linux += -fontconfig
  92. $(package)_config_opts_linux += -no-opengl
  93. $(package)_config_opts_arm_linux = -platform linux-g++ -xplatform $(host)
  94. $(package)_config_opts_i686_linux = -xplatform linux-g++-32
  95. $(package)_config_opts_mingw32 = -no-opengl -xplatform win32-g++ -device-option CROSS_COMPILE="$(host)-"
  96. $(package)_build_env = QT_RCC_TEST=1
  97. endef
  98. define $(package)_fetch_cmds
  99. $(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \
  100. $(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttranslations_file_name),$($(package)_qttranslations_file_name),$($(package)_qttranslations_sha256_hash)) && \
  101. $(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttools_file_name),$($(package)_qttools_file_name),$($(package)_qttools_sha256_hash))
  102. endef
  103. define $(package)_extract_cmds
  104. mkdir -p $($(package)_extract_dir) && \
  105. echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \
  106. echo "$($(package)_qttranslations_sha256_hash) $($(package)_source_dir)/$($(package)_qttranslations_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
  107. echo "$($(package)_qttools_sha256_hash) $($(package)_source_dir)/$($(package)_qttools_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
  108. $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \
  109. mkdir qtbase && \
  110. tar --strip-components=1 -xf $($(package)_source) -C qtbase && \
  111. mkdir qttranslations && \
  112. tar --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttranslations_file_name) -C qttranslations && \
  113. mkdir qttools && \
  114. tar --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools
  115. endef
  116. define $(package)_preprocess_cmds
  117. sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \
  118. sed -i.old "/updateqm.depends =/d" qttranslations/translations/translations.pro && \
  119. sed -i.old "s/src_plugins.depends = src_sql src_xml src_network/src_plugins.depends = src_xml src_network/" qtbase/src/src.pro && \
  120. sed -i.old "s|X11/extensions/XIproto.h|X11/X.h|" qtbase/src/plugins/platforms/xcb/qxcbxsettings.cpp && \
  121. sed -i.old 's/if \[ "$$$$XPLATFORM_MAC" = "yes" \]; then xspecvals=$$$$(macSDKify/if \[ "$$$$BUILD_ON_MAC" = "yes" \]; then xspecvals=$$$$(macSDKify/' qtbase/configure && \
  122. sed -i.old 's/CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, 0)/CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, kCGMouseButtonLeft)/' qtbase/src/plugins/platforms/cocoa/qcocoacursor.mm && \
  123. mkdir -p qtbase/mkspecs/macx-clang-linux &&\
  124. cp -f qtbase/mkspecs/macx-clang/Info.plist.lib qtbase/mkspecs/macx-clang-linux/ &&\
  125. cp -f qtbase/mkspecs/macx-clang/Info.plist.app qtbase/mkspecs/macx-clang-linux/ &&\
  126. cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\
  127. cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \
  128. patch -p1 < $($(package)_patch_dir)/mingw-uuidof.patch && \
  129. patch -p1 < $($(package)_patch_dir)/pidlist_absolute.patch && \
  130. patch -p1 < $($(package)_patch_dir)/fix-xcb-include-order.patch && \
  131. patch -p1 < $($(package)_patch_dir)/fix_qt_pkgconfig.patch && \
  132. patch -p1 < $($(package)_patch_dir)/fix-cocoahelpers-macos.patch && \
  133. echo "!host_build: QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
  134. echo "!host_build: QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
  135. echo "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
  136. sed -i.old "s|QMAKE_CFLAGS = |!host_build: QMAKE_CFLAGS = $($(package)_cflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \
  137. sed -i.old "s|QMAKE_LFLAGS = |!host_build: QMAKE_LFLAGS = $($(package)_ldflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \
  138. sed -i.old "s|QMAKE_CXXFLAGS = |!host_build: QMAKE_CXXFLAGS = $($(package)_cxxflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf
  139. endef
  140. define $(package)_config_cmds
  141. export PKG_CONFIG_SYSROOT_DIR=/ && \
  142. export PKG_CONFIG_LIBDIR=$(host_prefix)/lib/pkgconfig && \
  143. export PKG_CONFIG_PATH=$(host_prefix)/share/pkgconfig && \
  144. ./configure $($(package)_config_opts) && \
  145. echo "host_build: QT_CONFIG ~= s/system-zlib/zlib" >> mkspecs/qconfig.pri && \
  146. echo "CONFIG += force_bootstrap" >> mkspecs/qconfig.pri && \
  147. $(MAKE) sub-src-clean && \
  148. cd ../qttranslations && ../qtbase/bin/qmake qttranslations.pro -o Makefile && \
  149. cd translations && ../../qtbase/bin/qmake translations.pro -o Makefile && cd ../.. &&\
  150. cd qttools/src/linguist/lrelease/ && ../../../../qtbase/bin/qmake lrelease.pro -o Makefile
  151. endef
  152. define $(package)_build_cmds
  153. $(MAKE) -C src $(addprefix sub-,$($(package)_qt_libs)) && \
  154. $(MAKE) -C ../qttools/src/linguist/lrelease && \
  155. $(MAKE) -C ../qttranslations
  156. endef
  157. define $(package)_stage_cmds
  158. $(MAKE) -C src INSTALL_ROOT=$($(package)_staging_dir) $(addsuffix -install_subtargets,$(addprefix sub-,$($(package)_qt_libs))) && cd .. &&\
  159. $(MAKE) -C qttools/src/linguist/lrelease INSTALL_ROOT=$($(package)_staging_dir) install_target && \
  160. $(MAKE) -C qttranslations INSTALL_ROOT=$($(package)_staging_dir) install_subtargets && \
  161. if `test -f qtbase/src/plugins/platforms/xcb/xcb-static/libxcb-static.a`; then \
  162. cp qtbase/src/plugins/platforms/xcb/xcb-static/libxcb-static.a $($(package)_staging_prefix_dir)/lib; \
  163. fi
  164. endef
  165. define $(package)_postprocess_cmds
  166. rm -rf native/mkspecs/ native/lib/ lib/cmake/ && \
  167. rm -f lib/lib*.la lib/*.prl plugins/*/*.prl
  168. endef