|
| 1 | +package=native_qt |
| 2 | +include packages/qt_details.mk |
| 3 | +$(package)_version=$(qt_details_version) |
| 4 | +$(package)_download_path=$(qt_details_download_path) |
| 5 | +$(package)_file_name=$(qt_details_qtbase_file_name) |
| 6 | +$(package)_sha256_hash=$(qt_details_qtbase_sha256_hash) |
| 7 | +$(package)_patches_path := $(qt_details_patches_path) |
| 8 | +$(package)_patches := dont_hardcode_pwd.patch |
| 9 | +$(package)_patches += qtbase-moc-ignore-gcc-macro.patch |
| 10 | +$(package)_patches += qtbase_skip_tools.patch |
| 11 | +$(package)_patches += rcc_hardcode_timestamp.patch |
| 12 | +$(package)_patches += qttools_skip_dependencies.patch |
| 13 | + |
| 14 | +$(package)_qttranslations_file_name=$(qt_details_qttranslations_file_name) |
| 15 | +$(package)_qttranslations_sha256_hash=$(qt_details_qttranslations_sha256_hash) |
| 16 | + |
| 17 | +$(package)_qttools_file_name=$(qt_details_qttools_file_name) |
| 18 | +$(package)_qttools_sha256_hash=$(qt_details_qttools_sha256_hash) |
| 19 | + |
| 20 | +$(package)_extra_sources := $($(package)_qttranslations_file_name) |
| 21 | +$(package)_extra_sources += $($(package)_qttools_file_name) |
| 22 | + |
| 23 | +$(package)_top_download_path=$(qt_details_top_download_path) |
| 24 | +$(package)_top_cmakelists_file_name=$(qt_details_top_cmakelists_file_name) |
| 25 | +$(package)_top_cmakelists_download_file=$(qt_details_top_cmakelists_download_file) |
| 26 | +$(package)_top_cmakelists_sha256_hash=$(qt_details_top_cmakelists_sha256_hash) |
| 27 | +$(package)_top_cmake_download_path=$(qt_details_top_cmake_download_path) |
| 28 | +$(package)_top_cmake_ecmoptionaladdsubdirectory_file_name=$(qt_details_top_cmake_ecmoptionaladdsubdirectory_file_name) |
| 29 | +$(package)_top_cmake_ecmoptionaladdsubdirectory_download_file=$(qt_details_top_cmake_ecmoptionaladdsubdirectory_download_file) |
| 30 | +$(package)_top_cmake_ecmoptionaladdsubdirectory_sha256_hash=$(qt_details_top_cmake_ecmoptionaladdsubdirectory_sha256_hash) |
| 31 | +$(package)_top_cmake_qttoplevelhelpers_file_name=$(qt_details_top_cmake_qttoplevelhelpers_file_name) |
| 32 | +$(package)_top_cmake_qttoplevelhelpers_download_file=$(qt_details_top_cmake_qttoplevelhelpers_download_file) |
| 33 | +$(package)_top_cmake_qttoplevelhelpers_sha256_hash=$(qt_details_top_cmake_qttoplevelhelpers_sha256_hash) |
| 34 | + |
| 35 | +$(package)_extra_sources += $($(package)_top_cmakelists_file_name)-$($(package)_version) |
| 36 | +$(package)_extra_sources += $($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version) |
| 37 | +$(package)_extra_sources += $($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version) |
| 38 | + |
| 39 | +define $(package)_set_vars |
| 40 | +# Build options. |
| 41 | +$(package)_config_opts := -release |
| 42 | +$(package)_config_opts += -make tools |
| 43 | +$(package)_config_opts += -no-pkg-config |
| 44 | +$(package)_config_opts += -no-reduce-relocations |
| 45 | +$(package)_config_opts += -no-use-gold-linker |
| 46 | +$(package)_config_opts += -prefix $(host_prefix) |
| 47 | +$(package)_config_opts += -static |
| 48 | + |
| 49 | +# Modules. |
| 50 | +$(package)_config_opts += -no-feature-concurrent |
| 51 | +$(package)_config_opts += -no-feature-network |
| 52 | +$(package)_config_opts += -no-feature-printsupport |
| 53 | +$(package)_config_opts += -no-feature-sql |
| 54 | +$(package)_config_opts += -no-feature-testlib |
| 55 | +$(package)_config_opts += -no-feature-xml |
| 56 | +$(package)_config_opts += -no-gui |
| 57 | +$(package)_config_opts += -no-widgets |
| 58 | + |
| 59 | +$(package)_config_opts += -no-glib |
| 60 | +$(package)_config_opts += -no-icu |
| 61 | +$(package)_config_opts += -no-libudev |
| 62 | +$(package)_config_opts += -no-openssl |
| 63 | +$(package)_config_opts += -no-zstd |
| 64 | +$(package)_config_opts += -qt-pcre |
| 65 | +$(package)_config_opts += -qt-zlib |
| 66 | +$(package)_config_opts += -no-feature-backtrace |
| 67 | +$(package)_config_opts += -no-feature-permissions |
| 68 | +$(package)_config_opts += -no-feature-process |
| 69 | +$(package)_config_opts += -no-feature-settings |
| 70 | + |
| 71 | +# Core tools. |
| 72 | +$(package)_config_opts += -no-feature-androiddeployqt |
| 73 | +$(package)_config_opts += -no-feature-macdeployqt |
| 74 | +$(package)_config_opts += -no-feature-windeployqt |
| 75 | +$(package)_config_opts += -no-feature-qmake |
| 76 | + |
| 77 | +# Qt Tools module. |
| 78 | +$(package)_config_opts += -feature-linguist |
| 79 | +$(package)_config_opts += -no-feature-assistant |
| 80 | +$(package)_config_opts += -no-feature-clang |
| 81 | +$(package)_config_opts += -no-feature-clangcpp |
| 82 | +$(package)_config_opts += -no-feature-designer |
| 83 | +$(package)_config_opts += -no-feature-pixeltool |
| 84 | +$(package)_config_opts += -no-feature-qdoc |
| 85 | +$(package)_config_opts += -no-feature-qtattributionsscanner |
| 86 | +$(package)_config_opts += -no-feature-qtdiag |
| 87 | +$(package)_config_opts += -no-feature-qtplugininfo |
| 88 | + |
| 89 | +$(package)_config_env := CC="$$(build_CC)" |
| 90 | +$(package)_config_env += CXX="$$(build_CXX)" |
| 91 | + |
| 92 | +$(package)_cmake_opts := -DCMAKE_EXE_LINKER_FLAGS="$$(build_LDFLAGS)" |
| 93 | +ifneq ($(V),) |
| 94 | +$(package)_cmake_opts += --log-level=STATUS |
| 95 | +endif |
| 96 | +endef |
| 97 | + |
| 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 | +$(call fetch_file,$(package),$($(package)_top_download_path),$($(package)_top_cmakelists_download_file),$($(package)_top_cmakelists_file_name)-$($(package)_version),$($(package)_top_cmakelists_sha256_hash)) && \ |
| 103 | +$(call fetch_file,$(package),$($(package)_top_cmake_download_path),$($(package)_top_cmake_ecmoptionaladdsubdirectory_download_file),$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version),$($(package)_top_cmake_ecmoptionaladdsubdirectory_sha256_hash)) && \ |
| 104 | +$(call fetch_file,$(package),$($(package)_top_cmake_download_path),$($(package)_top_cmake_qttoplevelhelpers_download_file),$($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version),$($(package)_top_cmake_qttoplevelhelpers_sha256_hash)) |
| 105 | +endef |
| 106 | + |
| 107 | +define $(package)_extract_cmds |
| 108 | + mkdir -p $($(package)_extract_dir) && \ |
| 109 | + echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \ |
| 110 | + echo "$($(package)_qttranslations_sha256_hash) $($(package)_source_dir)/$($(package)_qttranslations_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ |
| 111 | + echo "$($(package)_qttools_sha256_hash) $($(package)_source_dir)/$($(package)_qttools_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ |
| 112 | + echo "$($(package)_top_cmakelists_sha256_hash) $($(package)_source_dir)/$($(package)_top_cmakelists_file_name)-$($(package)_version)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ |
| 113 | + echo "$($(package)_top_cmake_ecmoptionaladdsubdirectory_sha256_hash) $($(package)_source_dir)/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ |
| 114 | + echo "$($(package)_top_cmake_qttoplevelhelpers_sha256_hash) $($(package)_source_dir)/$($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ |
| 115 | + $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \ |
| 116 | + mkdir qtbase && \ |
| 117 | + $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source) -C qtbase && \ |
| 118 | + mkdir qttranslations && \ |
| 119 | + $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttranslations_file_name) -C qttranslations && \ |
| 120 | + mkdir qttools && \ |
| 121 | + $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools && \ |
| 122 | + cp $($(package)_source_dir)/$($(package)_top_cmakelists_file_name)-$($(package)_version) ./$($(package)_top_cmakelists_file_name) && \ |
| 123 | + mkdir cmake && \ |
| 124 | + cp $($(package)_source_dir)/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version) cmake/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name) && \ |
| 125 | + cp $($(package)_source_dir)/$($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version) cmake/$($(package)_top_cmake_qttoplevelhelpers_file_name) |
| 126 | +endef |
| 127 | + |
| 128 | +define $(package)_preprocess_cmds |
| 129 | + patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch && \ |
| 130 | + patch -p1 -i $($(package)_patch_dir)/qtbase-moc-ignore-gcc-macro.patch && \ |
| 131 | + patch -p1 -i $($(package)_patch_dir)/qtbase_skip_tools.patch && \ |
| 132 | + patch -p1 -i $($(package)_patch_dir)/rcc_hardcode_timestamp.patch && \ |
| 133 | + patch -p1 -i $($(package)_patch_dir)/qttools_skip_dependencies.patch |
| 134 | +endef |
| 135 | + |
| 136 | +define $(package)_config_cmds |
| 137 | + cd qtbase && \ |
| 138 | + ./configure -top-level $($(package)_config_opts) -- $($(package)_cmake_opts) |
| 139 | +endef |
| 140 | + |
| 141 | +define $(package)_build_cmds |
| 142 | + cmake --build . -- $$(filter -j%,$$(MAKEFLAGS)) |
| 143 | +endef |
| 144 | + |
| 145 | +define $(package)_stage_cmds |
| 146 | + cmake --install . --prefix $($(package)_staging_prefix_dir) |
| 147 | +endef |
| 148 | + |
| 149 | +define $(package)_postprocess_cmds |
| 150 | + rm -rf doc/ && \ |
| 151 | + mv -t .. translations/ |
| 152 | +endef |
0 commit comments