feather/contrib/depends/packages/native_qt.mk

183 lines
9.3 KiB
Makefile
Raw Normal View History

2022-12-21 15:15:22 +00:00
package=native_qt
2024-12-07 15:54:42 +00:00
$(package)_version=6.8.1
2024-11-02 18:03:44 +00:00
$(package)_download_path=https://download.qt.io/official_releases/qt/6.8/$($(package)_version)/submodules
2022-12-21 15:15:22 +00:00
$(package)_suffix=everywhere-src-$($(package)_version).tar.xz
$(package)_file_name=qtbase-$($(package)_suffix)
2024-12-07 15:54:42 +00:00
$(package)_sha256_hash=40b14562ef3bd779bc0e0418ea2ae08fa28235f8ea6e8c0cb3bce1d6ad58dcaf
2024-11-03 16:42:34 +00:00
$(package)_linux_dependencies=native_wayland
2022-12-21 15:15:22 +00:00
$(package)_qt_libs=corelib network widgets gui plugins testlib
2022-12-27 11:55:49 +00:00
$(package)_patches = dont_hardcode_pwd.patch
$(package)_patches += fast_fixed_dtoa_no_optimize.patch
$(package)_patches += guix_cross_lib_path.patch
2022-12-21 15:15:22 +00:00
$(package)_patches += qtbase-moc-ignore-gcc-macro.patch
$(package)_patches += rcc_hardcode_timestamp.patch
2022-12-27 11:55:49 +00:00
$(package)_patches += root_CMakeLists.txt
2022-12-21 15:15:22 +00:00
$(package)_qttools_file_name=qttools-$($(package)_suffix)
2024-12-07 15:54:42 +00:00
$(package)_qttools_sha256_hash=9d43d409be08b8681a0155a9c65114b69c9a3fc11aef6487bb7fdc5b283c432d
2022-12-21 15:15:22 +00:00
$(package)_qtsvg_file_name=qtsvg-$($(package)_suffix)
2024-12-07 15:54:42 +00:00
$(package)_qtsvg_sha256_hash=3d0de73596e36b2daa7c48d77c4426bb091752856912fba720215f756c560dd0
2022-12-21 15:15:22 +00:00
$(package)_qtmultimedia_file_name=qtmultimedia-$($(package)_suffix)
2024-12-07 15:54:42 +00:00
$(package)_qtmultimedia_sha256_hash=75fa87134f9afab7f0a62c55a4744799ac79519560d19c8e1d4c32bdd173f953
2022-12-21 15:15:22 +00:00
$(package)_qtshadertools_file_name=qtshadertools-$($(package)_suffix)
2024-12-07 15:54:42 +00:00
$(package)_qtshadertools_sha256_hash=55b70cd632473a8043c74ba89310f7ba9c5041d253bc60e7ae1fa789169c4846
2022-12-21 15:15:22 +00:00
2024-11-03 16:42:34 +00:00
$(package)_qtwayland_file_name=qtwayland-$($(package)_suffix)
2024-12-07 15:54:42 +00:00
$(package)_qtwayland_sha256_hash=2226fbde4e2ddd12f8bf4b239c8f38fd706a54e789e63467dfddc77129eca203
2024-11-03 16:42:34 +00:00
2022-12-21 15:15:22 +00:00
$(package)_extra_sources += $($(package)_qttools_file_name)
$(package)_extra_sources += $($(package)_qtsvg_file_name)
$(package)_extra_sources += $($(package)_qtmultimedia_file_name)
$(package)_extra_sources += $($(package)_qtshadertools_file_name)
2024-11-03 16:42:34 +00:00
$(package)_extra_sources += $($(package)_qtwayland_file_name)
2022-12-21 15:15:22 +00:00
define $(package)_set_vars
$(package)_config_opts_release = -release
$(package)_config_opts_debug = -debug
$(package)_config_opts_debug += -optimized-tools
$(package)_config_opts += -libexecdir $(build_prefix)/qt-host/bin
$(package)_config_opts += -c++std c++17
$(package)_config_opts += -confirm-license
$(package)_config_opts += -opensource
$(package)_config_opts += -pkg-config
$(package)_config_opts += -prefix $(build_prefix)/qt-host
$(package)_config_opts += -static
2023-07-02 16:03:39 +00:00
$(package)_config_opts += -platform linux-g++ -xplatform linux-g++
ifneq (,$(findstring -stdlib=libc++,$($(1)_cxx)))
$(package)_config_opts_x86_64 = -xplatform linux-clang-libc++
endif
$(package)_config_opts += -no-cups
$(package)_config_opts += -no-egl
$(package)_config_opts += -no-eglfs
$(package)_config_opts += -no-evdev
$(package)_config_opts += -no-feature-androiddeployqt
2022-12-21 15:15:22 +00:00
$(package)_config_opts += -no-feature-colordialog
$(package)_config_opts += -no-feature-dial
$(package)_config_opts += -no-feature-fontcombobox
2023-07-02 16:03:39 +00:00
$(package)_config_opts += -no-feature-fontconfig
$(package)_config_opts += -no-feature-freetype
$(package)_config_opts += -no-feature-harfbuzz
2022-12-21 15:15:22 +00:00
$(package)_config_opts += -no-feature-http
$(package)_config_opts += -no-feature-image_heuristic_mask
$(package)_config_opts += -no-feature-keysequenceedit
$(package)_config_opts += -no-feature-lcdnumber
$(package)_config_opts += -no-feature-networkdiskcache
$(package)_config_opts += -no-feature-pdf
2023-07-02 16:03:39 +00:00
$(package)_config_opts += -no-feature-png
2022-12-21 15:15:22 +00:00
$(package)_config_opts += -no-feature-printdialog
$(package)_config_opts += -no-feature-printer
$(package)_config_opts += -no-feature-printpreviewdialog
$(package)_config_opts += -no-feature-printpreviewwidget
2023-07-02 16:03:39 +00:00
$(package)_config_opts += -no-feature-qmake
2022-12-21 15:15:22 +00:00
$(package)_config_opts += -no-feature-sessionmanager
2023-07-02 14:26:36 +00:00
$(package)_config_opts += -no-feature-spatialaudio
2022-12-21 15:15:22 +00:00
$(package)_config_opts += -no-feature-sql
$(package)_config_opts += -no-feature-syntaxhighlighter
2023-07-02 16:03:39 +00:00
$(package)_config_opts += -no-feature-testlib
2022-12-21 15:15:22 +00:00
$(package)_config_opts += -no-feature-textmarkdownwriter
$(package)_config_opts += -no-feature-textodfwriter
$(package)_config_opts += -no-feature-topleveldomain
$(package)_config_opts += -no-feature-undocommand
$(package)_config_opts += -no-feature-undogroup
$(package)_config_opts += -no-feature-undostack
$(package)_config_opts += -no-feature-undoview
$(package)_config_opts += -no-feature-vnc
2023-07-02 16:03:39 +00:00
$(package)_config_opts += -no-feature-vulkan
$(package)_config_opts += -no-feature-widgets
2023-07-02 14:26:36 +00:00
$(package)_config_opts += -no-feature-xkbcommon
2023-07-02 16:03:39 +00:00
$(package)_config_opts += -no-feature-xlib
$(package)_config_opts += -no-gif
$(package)_config_opts += -no-glib
$(package)_config_opts += -no-ico
$(package)_config_opts += -no-icu
$(package)_config_opts += -no-kms
$(package)_config_opts += -no-libjpeg
$(package)_config_opts += -no-libudev
$(package)_config_opts += -no-linuxfb
$(package)_config_opts += -nomake examples
$(package)_config_opts += -nomake tests
$(package)_config_opts += -no-mtdev
$(package)_config_opts += -no-opengl
$(package)_config_opts += -no-openssl
$(package)_config_opts += -no-openvg
2022-12-21 15:15:22 +00:00
$(package)_config_opts += -no-pch
2023-07-02 16:03:39 +00:00
$(package)_config_opts += -no-reduce-relocations
2024-12-07 15:54:42 +00:00
$(package)_config_opts += -no-sbom
2023-07-02 16:03:39 +00:00
$(package)_config_opts += -no-schannel
$(package)_config_opts += -no-sctp
$(package)_config_opts += -no-securetransport
$(package)_config_opts += -no-system-proxies
$(package)_config_opts += -no-use-gold-linker
$(package)_config_opts += -no-xcb-xlib
$(package)_config_opts += -no-zstd
2022-12-21 15:15:22 +00:00
ifneq ($(LTO),)
$(package)_config_opts += -ltcg
endif
endef
define $(package)_fetch_cmds
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttools_file_name),$($(package)_qttools_file_name),$($(package)_qttools_sha256_hash)) && \
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qtsvg_file_name),$($(package)_qtsvg_file_name),$($(package)_qtsvg_sha256_hash)) && \
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qtmultimedia_file_name),$($(package)_qtmultimedia_file_name),$($(package)_qtmultimedia_sha256_hash)) && \
2024-11-03 16:42:34 +00:00
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qtshadertools_file_name),$($(package)_qtshadertools_file_name),$($(package)_qtshadertools_sha256_hash)) && \
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qtwayland_file_name),$($(package)_qtwayland_file_name),$($(package)_qtwayland_sha256_hash))
2022-12-21 15:15:22 +00:00
endef
define $(package)_extract_cmds
mkdir -p $($(package)_extract_dir) && \
echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \
echo "$($(package)_qttools_sha256_hash) $($(package)_source_dir)/$($(package)_qttools_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
echo "$($(package)_qtsvg_sha256_hash) $($(package)_source_dir)/$($(package)_qtsvg_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
echo "$($(package)_qtmultimedia_sha256_hash) $($(package)_source_dir)/$($(package)_qtmultimedia_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
echo "$($(package)_qtshadertools_sha256_hash) $($(package)_source_dir)/$($(package)_qtshadertools_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
2024-11-03 16:42:34 +00:00
echo "$($(package)_qtwayland_sha256_hash) $($(package)_source_dir)/$($(package)_qtwayland_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
2022-12-21 15:15:22 +00:00
$(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \
mkdir qtbase && \
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source) -C qtbase && \
mkdir qttools && \
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools && \
mkdir qtsvg && \
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qtsvg_file_name) -C qtsvg && \
mkdir qtmultimedia && \
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qtmultimedia_file_name) -C qtmultimedia && \
mkdir qtshadertools && \
2024-11-03 16:42:34 +00:00
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qtshadertools_file_name) -C qtshadertools && \
mkdir qtwayland && \
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qtwayland_file_name) -C qtwayland
2022-12-21 15:15:22 +00:00
endef
define $(package)_preprocess_cmds
cp $($(package)_patch_dir)/root_CMakeLists.txt CMakeLists.txt && \
patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch && \
patch -p1 -i $($(package)_patch_dir)/qtbase-moc-ignore-gcc-macro.patch && \
patch -p1 -i $($(package)_patch_dir)/rcc_hardcode_timestamp.patch && \
patch -p1 -i $($(package)_patch_dir)/fast_fixed_dtoa_no_optimize.patch && \
2023-07-02 16:03:39 +00:00
patch -p1 -i $($(package)_patch_dir)/guix_cross_lib_path.patch
2022-12-21 15:15:22 +00:00
endef
define $(package)_config_cmds
export PKG_CONFIG_SYSROOT_DIR=/ && \
export PKG_CONFIG_LIBDIR=$(build_prefix)/lib/pkgconfig && \
export QT_MAC_SDK_NO_VERSION_CHECK=1 && \
2023-03-24 15:40:37 +00:00
unset CMAKE_PREFIX_PATH && \
2023-03-29 13:17:12 +00:00
export CMAKE_PREFIX_PATH="$(QT_LIBS)" && \
2022-12-21 15:15:22 +00:00
cd qtbase && \
./configure -top-level $($(package)_config_opts)
endef
define $(package)_build_cmds
2023-02-11 20:04:43 +00:00
export LD_LIBRARY_PATH=${build_prefix}/lib/ && \
2023-03-24 15:40:37 +00:00
unset CMAKE_PREFIX_PATH && \
2023-05-27 19:26:43 +00:00
cmake --build . --parallel
2022-12-21 15:15:22 +00:00
endef
define $(package)_stage_cmds
DESTDIR=$($(package)_staging_dir) cmake --install .
endef