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.

qt.mk 9.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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
  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
  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 += -qt-zlib
  72. $(package)_config_opts += -reduce-exports
  73. $(package)_config_opts += -static
  74. $(package)_config_opts += -silent
  75. $(package)_config_opts += -v
  76. ifneq ($(build_os),darwin)
  77. $(package)_config_opts_darwin = -xplatform macx-clang-linux
  78. $(package)_config_opts_darwin += -device-option MAC_SDK_PATH=$(OSX_SDK)
  79. $(package)_config_opts_darwin += -device-option MAC_SDK_VERSION=$(OSX_SDK_VERSION)
  80. $(package)_config_opts_darwin += -device-option CROSS_COMPILE="$(host)-"
  81. $(package)_config_opts_darwin += -device-option MAC_MIN_VERSION=$(OSX_MIN_VERSION)
  82. $(package)_config_opts_darwin += -device-option MAC_TARGET=$(host)
  83. $(package)_config_opts_darwin += -device-option MAC_LD64_VERSION=$(LD64_VERSION)
  84. endif
  85. $(package)_config_opts_linux = -qt-xkbcommon
  86. $(package)_config_opts_linux += -qt-xcb
  87. $(package)_config_opts_linux += -system-freetype
  88. $(package)_config_opts_linux += -no-sm
  89. $(package)_config_opts_linux += -fontconfig
  90. $(package)_config_opts_linux += -no-opengl
  91. $(package)_config_opts_arm_linux = -platform linux-g++ -xplatform $(host)
  92. $(package)_config_opts_i686_linux = -xplatform linux-g++-32
  93. $(package)_config_opts_mingw32 = -no-opengl -xplatform win32-g++ -device-option CROSS_COMPILE="$(host)-"
  94. $(package)_build_env = QT_RCC_TEST=1
  95. endef
  96. define $(package)_fetch_cmds
  97. $(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \
  98. $(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttranslations_file_name),$($(package)_qttranslations_file_name),$($(package)_qttranslations_sha256_hash)) && \
  99. $(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttools_file_name),$($(package)_qttools_file_name),$($(package)_qttools_sha256_hash))
  100. endef
  101. define $(package)_extract_cmds
  102. mkdir -p $($(package)_extract_dir) && \
  103. echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \
  104. echo "$($(package)_qttranslations_sha256_hash) $($(package)_source_dir)/$($(package)_qttranslations_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
  105. echo "$($(package)_qttools_sha256_hash) $($(package)_source_dir)/$($(package)_qttools_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
  106. $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \
  107. mkdir qtbase && \
  108. tar --strip-components=1 -xf $($(package)_source) -C qtbase && \
  109. mkdir qttranslations && \
  110. tar --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttranslations_file_name) -C qttranslations && \
  111. mkdir qttools && \
  112. tar --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools
  113. endef
  114. define $(package)_preprocess_cmds
  115. sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \
  116. sed -i.old "s/src_plugins.depends = src_sql src_xml src_network/src_plugins.depends = src_xml src_network/" qtbase/src/src.pro && \
  117. sed -i.old "s|X11/extensions/XIproto.h|X11/X.h|" qtbase/src/plugins/platforms/xcb/qxcbxsettings.cpp && \
  118. sed -i.old 's/if \[ "$$$$XPLATFORM_MAC" = "yes" \]; then xspecvals=$$$$(macSDKify/if \[ "$$$$BUILD_ON_MAC" = "yes" \]; then xspecvals=$$$$(macSDKify/' qtbase/configure && \
  119. sed -i.old 's/CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, 0)/CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, kCGMouseButtonLeft)/' qtbase/src/plugins/platforms/cocoa/qcocoacursor.mm && \
  120. mkdir -p qtbase/mkspecs/macx-clang-linux &&\
  121. cp -f qtbase/mkspecs/macx-clang/Info.plist.lib qtbase/mkspecs/macx-clang-linux/ &&\
  122. cp -f qtbase/mkspecs/macx-clang/Info.plist.app qtbase/mkspecs/macx-clang-linux/ &&\
  123. cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\
  124. cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \
  125. patch -p1 < $($(package)_patch_dir)/mingw-uuidof.patch && \
  126. patch -p1 < $($(package)_patch_dir)/pidlist_absolute.patch && \
  127. patch -p1 < $($(package)_patch_dir)/fix-xcb-include-order.patch && \
  128. patch -p1 < $($(package)_patch_dir)/fix_qt_pkgconfig.patch && \
  129. echo "QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
  130. echo "QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
  131. echo "QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
  132. sed -i.old "s|QMAKE_CFLAGS = |QMAKE_CFLAGS = $($(package)_cflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \
  133. sed -i.old "s|QMAKE_LFLAGS = |QMAKE_LFLAGS = $($(package)_ldflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \
  134. sed -i.old "s|QMAKE_CXXFLAGS = |QMAKE_CXXFLAGS = $($(package)_cxxflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf
  135. endef
  136. define $(package)_config_cmds
  137. export PKG_CONFIG_SYSROOT_DIR=/ && \
  138. export PKG_CONFIG_LIBDIR=$(host_prefix)/lib/pkgconfig && \
  139. export PKG_CONFIG_PATH=$(host_prefix)/share/pkgconfig && \
  140. ./configure $($(package)_config_opts) && \
  141. $(MAKE) sub-src-clean && \
  142. cd ../qttranslations && ../qtbase/bin/qmake qttranslations.pro -o Makefile && \
  143. cd translations && ../../qtbase/bin/qmake translations.pro -o Makefile && cd ../.. &&\
  144. cd qttools/src/linguist/lrelease/ && ../../../../qtbase/bin/qmake lrelease.pro -o Makefile
  145. endef
  146. define $(package)_build_cmds
  147. $(MAKE) -C src $(addprefix sub-,$($(package)_qt_libs)) && \
  148. $(MAKE) -C ../qttools/src/linguist/lrelease && \
  149. $(MAKE) -C ../qttranslations
  150. endef
  151. define $(package)_stage_cmds
  152. $(MAKE) -C src INSTALL_ROOT=$($(package)_staging_dir) $(addsuffix -install_subtargets,$(addprefix sub-,$($(package)_qt_libs))) && cd .. &&\
  153. $(MAKE) -C qttools/src/linguist/lrelease INSTALL_ROOT=$($(package)_staging_dir) install_target && \
  154. $(MAKE) -C qttranslations INSTALL_ROOT=$($(package)_staging_dir) install_subtargets && \
  155. if `test -f qtbase/src/plugins/platforms/xcb/xcb-static/libxcb-static.a`; then \
  156. cp qtbase/src/plugins/platforms/xcb/xcb-static/libxcb-static.a $($(package)_staging_prefix_dir)/lib; \
  157. fi
  158. endef
  159. define $(package)_postprocess_cmds
  160. rm -rf native/mkspecs/ native/lib/ lib/cmake/ && \
  161. rm -f lib/lib*.la lib/*.prl plugins/*/*.prl
  162. endef