native_qt.mk raw
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_skip_tools.patch
10 $(package)_patches += rcc_hardcode_timestamp.patch
11 $(package)_patches += qttools_skip_dependencies.patch
12 $(package)_patches += fix-macos26-qyield.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 ifeq ($(build_os),darwin)
92 $(package)_config_env += OBJC="$$(build_CC)"
93 $(package)_config_env += OBJCXX="$$(build_CXX)"
94 endif
95
96 $(package)_cmake_opts := -DCMAKE_EXE_LINKER_FLAGS="$$(build_LDFLAGS)"
97 ifneq ($(V),)
98 $(package)_cmake_opts += --log-level=STATUS
99 endif
100
101 ifeq ($(build_os),darwin)
102 $(package)_cmake_opts += -DQT_NO_APPLE_SDK_MAX_VERSION_CHECK=ON
103 $(package)_cmake_opts += -DQT_NO_XCODE_MIN_VERSION_CHECK=ON
104 endif
105 endef
106
107 define $(package)_fetch_cmds
108 $(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \
109 $(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttranslations_file_name),$($(package)_qttranslations_file_name),$($(package)_qttranslations_sha256_hash)) && \
110 $(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttools_file_name),$($(package)_qttools_file_name),$($(package)_qttools_sha256_hash)) && \
111 $(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)) && \
112 $(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)) && \
113 $(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))
114 endef
115
116 define $(package)_extract_cmds
117 mkdir -p $($(package)_extract_dir) && \
118 echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \
119 echo "$($(package)_qttranslations_sha256_hash) $($(package)_source_dir)/$($(package)_qttranslations_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
120 echo "$($(package)_qttools_sha256_hash) $($(package)_source_dir)/$($(package)_qttools_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
121 echo "$($(package)_top_cmakelists_sha256_hash) $($(package)_source_dir)/$($(package)_top_cmakelists_file_name)-$($(package)_version)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
122 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 && \
123 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 && \
124 $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \
125 mkdir -p qtbase && \
126 $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source) -C qtbase && \
127 mkdir -p qttranslations && \
128 $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttranslations_file_name) -C qttranslations && \
129 mkdir -p qttools && \
130 $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools && \
131 cp $($(package)_source_dir)/$($(package)_top_cmakelists_file_name)-$($(package)_version) ./$($(package)_top_cmakelists_file_name) && \
132 mkdir -p cmake && \
133 cp $($(package)_source_dir)/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version) cmake/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name) && \
134 cp $($(package)_source_dir)/$($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version) cmake/$($(package)_top_cmake_qttoplevelhelpers_file_name)
135 endef
136
137 define $(package)_preprocess_cmds
138 patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch && \
139 patch -p1 -i $($(package)_patch_dir)/qtbase_skip_tools.patch && \
140 patch -p1 -i $($(package)_patch_dir)/rcc_hardcode_timestamp.patch && \
141 patch -p1 -i $($(package)_patch_dir)/qttools_skip_dependencies.patch && \
142 patch -p1 -i $($(package)_patch_dir)/fix-macos26-qyield.patch
143 endef
144
145 define $(package)_config_cmds
146 cd qtbase && \
147 ./configure -top-level $($(package)_config_opts) -- $($(package)_cmake_opts)
148 endef
149
150 define $(package)_build_cmds
151 cmake --build . -- $$(filter -j%,$$(MAKEFLAGS))
152 endef
153
154 define $(package)_stage_cmds
155 cmake --install . --prefix $($(package)_staging_prefix_dir) --strip
156 endef
157
158 define $(package)_postprocess_cmds
159 rm -rf doc/ && \
160 mv translations/ ..
161 endef
162