Skip to content

Commit 6dd9db4

Browse files
committed
build: add Qt6 package definitions
1 parent 93c0143 commit 6dd9db4

File tree

2 files changed

+182
-0
lines changed

2 files changed

+182
-0
lines changed

depends/packages/native_qt.mk

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
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+
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+
endef
101+
102+
define $(package)_fetch_cmds
103+
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \
104+
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttranslations_file_name),$($(package)_qttranslations_file_name),$($(package)_qttranslations_sha256_hash)) && \
105+
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttools_file_name),$($(package)_qttools_file_name),$($(package)_qttools_sha256_hash)) && \
106+
$(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)) && \
107+
$(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)) && \
108+
$(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))
109+
endef
110+
111+
define $(package)_extract_cmds
112+
mkdir -p $($(package)_extract_dir) && \
113+
echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \
114+
echo "$($(package)_qttranslations_sha256_hash) $($(package)_source_dir)/$($(package)_qttranslations_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
115+
echo "$($(package)_qttools_sha256_hash) $($(package)_source_dir)/$($(package)_qttools_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
116+
echo "$($(package)_top_cmakelists_sha256_hash) $($(package)_source_dir)/$($(package)_top_cmakelists_file_name)-$($(package)_version)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
117+
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 && \
118+
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 && \
119+
$(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \
120+
mkdir qtbase && \
121+
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source) -C qtbase && \
122+
mkdir qttranslations && \
123+
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttranslations_file_name) -C qttranslations && \
124+
mkdir qttools && \
125+
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools && \
126+
cp $($(package)_source_dir)/$($(package)_top_cmakelists_file_name)-$($(package)_version) ./$($(package)_top_cmakelists_file_name) && \
127+
mkdir cmake && \
128+
cp $($(package)_source_dir)/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version) cmake/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name) && \
129+
cp $($(package)_source_dir)/$($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version) cmake/$($(package)_top_cmake_qttoplevelhelpers_file_name)
130+
endef
131+
132+
define $(package)_preprocess_cmds
133+
patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch && \
134+
patch -p1 -i $($(package)_patch_dir)/qtbase-moc-ignore-gcc-macro.patch && \
135+
patch -p1 -i $($(package)_patch_dir)/qtbase_skip_tools.patch && \
136+
patch -p1 -i $($(package)_patch_dir)/rcc_hardcode_timestamp.patch && \
137+
patch -p1 -i $($(package)_patch_dir)/qttools_skip_dependencies.patch
138+
endef
139+
140+
define $(package)_config_cmds
141+
cd qtbase && \
142+
./configure -top-level $($(package)_config_opts) -- $($(package)_cmake_opts)
143+
endef
144+
145+
define $(package)_build_cmds
146+
cmake --build . -- $$(filter -j%,$$(MAKEFLAGS))
147+
endef
148+
149+
define $(package)_stage_cmds
150+
cmake --install . --prefix $($(package)_staging_prefix_dir) --strip
151+
endef
152+
153+
define $(package)_postprocess_cmds
154+
rm -rf doc/ && \
155+
mv translations/ ..
156+
endef

depends/packages/qt_details.mk

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
qt_details_version := 6.7.3
2+
qt_details_download_path := https://download.qt.io/archive/qt/6.7/$(qt_details_version)/submodules
3+
qt_details_suffix := everywhere-src-$(qt_details_version).tar.xz
4+
5+
qt_details_qtbase_file_name := qtbase-$(qt_details_suffix)
6+
qt_details_qtbase_sha256_hash := 8ccbb9ab055205ac76632c9eeddd1ed6fc66936fc56afc2ed0fd5d9e23da3097
7+
8+
qt_details_qttranslations_file_name := qttranslations-$(qt_details_suffix)
9+
qt_details_qttranslations_sha256_hash := dcc762acac043b9bb5e4d369b6d6f53e0ecfcf76a408fe0db5f7ef071c9d6dc8
10+
11+
qt_details_qttools_file_name := qttools-$(qt_details_suffix)
12+
qt_details_qttools_sha256_hash := f03bb7df619cd9ac9dba110e30b7bcab5dd88eb8bdc9cc752563b4367233203f
13+
14+
qt_details_patches_path := $(PATCHES_PATH)/qt
15+
16+
qt_details_top_download_path := https://code.qt.io/cgit/qt/qt5.git/plain
17+
qt_details_top_cmakelists_file_name := CMakeLists.txt
18+
qt_details_top_cmakelists_download_file := $(qt_details_top_cmakelists_file_name)?h=$(qt_details_version)
19+
qt_details_top_cmakelists_sha256_hash := 9fb720a633c0c0a21c31fe62a34bf617726fed72480d4064f29ca5d6973d513f
20+
qt_details_top_cmake_download_path := $(qt_details_top_download_path)/cmake
21+
qt_details_top_cmake_ecmoptionaladdsubdirectory_file_name := ECMOptionalAddSubdirectory.cmake
22+
qt_details_top_cmake_ecmoptionaladdsubdirectory_download_file := $(qt_details_top_cmake_ecmoptionaladdsubdirectory_file_name)?h=$(qt_details_version)
23+
qt_details_top_cmake_ecmoptionaladdsubdirectory_sha256_hash := 97ee8bbfcb0a4bdcc6c1af77e467a1da0c5b386c42be2aa97d840247af5f6f70
24+
qt_details_top_cmake_qttoplevelhelpers_file_name := QtTopLevelHelpers.cmake
25+
qt_details_top_cmake_qttoplevelhelpers_download_file := $(qt_details_top_cmake_qttoplevelhelpers_file_name)?h=$(qt_details_version)
26+
qt_details_top_cmake_qttoplevelhelpers_sha256_hash := 5ac2a7159ee27b5b86d26ecff44922e7b8f319aa847b7b5766dc17932fd4a294

0 commit comments

Comments
 (0)