Changeset View
Changeset View
Standalone View
Standalone View
depends/packages/qt.mk
PACKAGE=qt | PACKAGE=qt | ||||
$(package)_version=5.12.11 | $(package)_version=5.12.11 | ||||
$(package)_download_path=https://download.qt.io/archive/qt/5.12/$($(package)_version)/submodules | $(package)_download_path=https://download.qt.io/archive/qt/5.12/$($(package)_version)/submodules | ||||
$(package)_suffix=everywhere-src-$($(package)_version).tar.xz | $(package)_suffix=everywhere-src-$($(package)_version).tar.xz | ||||
$(package)_file_name=qtbase-$($(package)_suffix) | $(package)_file_name=qtbase-$($(package)_suffix) | ||||
$(package)_sha256_hash=1c1b4e33137ca77881074c140d54c3c9747e845a31338cfe8680f171f0bc3a39 | $(package)_sha256_hash=1c1b4e33137ca77881074c140d54c3c9747e845a31338cfe8680f171f0bc3a39 | ||||
$(package)_dependencies=openssl | $(package)_dependencies=openssl | ||||
$(package)_linux_dependencies=freetype fontconfig libxcb libxkbcommon | $(package)_linux_dependencies=freetype fontconfig libxcb libxkbcommon | ||||
$(package)_qt_libs=corelib network widgets gui plugins testlib | $(package)_qt_libs=corelib network widgets gui plugins testlib | ||||
$(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_no_printer.patch no-xlib.patch | $(package)_linguist_tools = lrelease lupdate lconvert | ||||
$(package)_patches = qt.pro qttools_src.pro | |||||
$(package)_patches += fix_qt_pkgconfig.patch mac-qmake.conf fix_no_printer.patch no-xlib.patch | |||||
$(package)_patches+= dont_hardcode_pwd.patch | $(package)_patches+= dont_hardcode_pwd.patch | ||||
$(package)_patches+= drop_lrelease_dependency.patch no_sdk_version_check.patch | $(package)_patches+= no_sdk_version_check.patch | ||||
$(package)_patches+= fix_lib_paths.patch | $(package)_patches+= fix_lib_paths.patch | ||||
$(package)_patches+= fix_numeric_limits_compile_error.patch | $(package)_patches+= fix_numeric_limits_compile_error.patch | ||||
# Update OSX_QT_TRANSLATIONS when this is updated | # Update OSX_QT_TRANSLATIONS when this is updated | ||||
$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) | $(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) | ||||
$(package)_qttranslations_sha256_hash=577b0668a777eb2b451c61e8d026d79285371597ce9df06b6dee6c814164b7c3 | $(package)_qttranslations_sha256_hash=577b0668a777eb2b451c61e8d026d79285371597ce9df06b6dee6c814164b7c3 | ||||
$(package)_qttools_file_name=qttools-$($(package)_suffix) | $(package)_qttools_file_name=qttools-$($(package)_suffix) | ||||
Show All 36 Lines | |||||
$(package)_config_opts += -no-sql-mysql | $(package)_config_opts += -no-sql-mysql | ||||
$(package)_config_opts += -no-sql-odbc | $(package)_config_opts += -no-sql-odbc | ||||
$(package)_config_opts += -no-sql-psql | $(package)_config_opts += -no-sql-psql | ||||
$(package)_config_opts += -no-sql-sqlite | $(package)_config_opts += -no-sql-sqlite | ||||
$(package)_config_opts += -no-sql-sqlite2 | $(package)_config_opts += -no-sql-sqlite2 | ||||
$(package)_config_opts += -no-use-gold-linker | $(package)_config_opts += -no-use-gold-linker | ||||
$(package)_config_opts += -nomake examples | $(package)_config_opts += -nomake examples | ||||
$(package)_config_opts += -nomake tests | $(package)_config_opts += -nomake tests | ||||
$(package)_config_opts += -nomake tools | |||||
$(package)_config_opts += -opensource | $(package)_config_opts += -opensource | ||||
$(package)_config_opts += -openssl-linked | $(package)_config_opts += -openssl-linked | ||||
$(package)_config_opts += -pch | $(package)_config_opts += -pch | ||||
$(package)_config_opts += -pkg-config | $(package)_config_opts += -pkg-config | ||||
$(package)_config_opts += -prefix $(host_prefix) | $(package)_config_opts += -prefix $(host_prefix) | ||||
$(package)_config_opts += -qt-libpng | $(package)_config_opts += -qt-libpng | ||||
$(package)_config_opts += -qt-pcre | $(package)_config_opts += -qt-pcre | ||||
$(package)_config_opts += -qt-harfbuzz | $(package)_config_opts += -qt-harfbuzz | ||||
Show All 28 Lines | |||||
$(package)_config_opts += -no-feature-undogroup | $(package)_config_opts += -no-feature-undogroup | ||||
$(package)_config_opts += -no-feature-undostack | $(package)_config_opts += -no-feature-undostack | ||||
$(package)_config_opts += -no-feature-undoview | $(package)_config_opts += -no-feature-undoview | ||||
$(package)_config_opts += -no-feature-vnc | $(package)_config_opts += -no-feature-vnc | ||||
$(package)_config_opts += -no-feature-wizard | $(package)_config_opts += -no-feature-wizard | ||||
$(package)_config_opts += -no-feature-xml | $(package)_config_opts += -no-feature-xml | ||||
$(package)_config_opts_darwin = -no-dbus | $(package)_config_opts_darwin = -no-dbus | ||||
$(package)_config_opts_darwin += -device-option QMAKE_MACOSX_DEPLOYMENT_TARGET=$(OSX_MIN_VERSION) | $(package)_config_opts_darwin += QMAKE_MACOSX_DEPLOYMENT_TARGET=$(OSX_MIN_VERSION) | ||||
ifneq ($(build_os),darwin) | ifneq ($(build_os),darwin) | ||||
$(package)_config_opts_darwin += -xplatform macx-clang-linux | $(package)_config_opts_darwin += -xplatform macx-clang-linux | ||||
$(package)_config_opts_darwin += -device-option MAC_SDK_PATH=$(OSX_SDK) | $(package)_config_opts_darwin += -device-option MAC_SDK_PATH=$(OSX_SDK) | ||||
$(package)_config_opts_darwin += -device-option MAC_SDK_VERSION=$(OSX_SDK_VERSION) | $(package)_config_opts_darwin += -device-option MAC_SDK_VERSION=$(OSX_SDK_VERSION) | ||||
$(package)_config_opts_darwin += -device-option CROSS_COMPILE="$(host)-" | $(package)_config_opts_darwin += -device-option CROSS_COMPILE="$(host)-" | ||||
$(package)_config_opts_darwin += -device-option MAC_MIN_VERSION=$(OSX_MIN_VERSION) | |||||
$(package)_config_opts_darwin += -device-option MAC_TARGET=$(host) | $(package)_config_opts_darwin += -device-option MAC_TARGET=$(host) | ||||
$(package)_config_opts_darwin += -device-option XCODE_VERSION=$(XCODE_VERSION) | $(package)_config_opts_darwin += -device-option XCODE_VERSION=$(XCODE_VERSION) | ||||
endif | endif | ||||
$(package)_config_opts_linux = -qt-xcb | $(package)_config_opts_linux = -qt-xcb | ||||
$(package)_config_opts_linux += -no-xcb-xlib | $(package)_config_opts_linux += -no-xcb-xlib | ||||
$(package)_config_opts_linux += -no-feature-xlib | $(package)_config_opts_linux += -no-feature-xlib | ||||
$(package)_config_opts_linux += -system-freetype | $(package)_config_opts_linux += -system-freetype | ||||
Show All 33 Lines | define $(package)_extract_cmds | ||||
mkdir qttools && \ | mkdir qttools && \ | ||||
tar --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools | tar --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools | ||||
endef | endef | ||||
# Preprocessing steps work as follows: | # Preprocessing steps work as follows: | ||||
# | # | ||||
# 1. Apply our patches to the extracted source. See each patch for more info. | # 1. Apply our patches to the extracted source. See each patch for more info. | ||||
# | # | ||||
# 2. Point to lrelease in qttools/bin/lrelease; otherwise Qt will look for it in | # 2. Create a macOS-Clang-Linux mkspec using our mac-qmake.conf. | ||||
# $(host)/native/bin/lrelease and not find it. | |||||
# | # | ||||
# 3. Create a macOS-Clang-Linux mkspec using our mac-qmake.conf. | # 3. After making a copy of the mkspec for the linux-arm-gnueabi host, named | ||||
# | |||||
# 4. After making a copy of the mkspec for the linux-arm-gnueabi host, named | |||||
# bitcoin-linux-g++, replace instances of linux-arm-gnueabi with $(host). This | # bitcoin-linux-g++, replace instances of linux-arm-gnueabi with $(host). This | ||||
# way we can generically support hosts like riscv64-linux-gnu, which Qt doesn't | # way we can generically support hosts like riscv64-linux-gnu, which Qt doesn't | ||||
# ship a mkspec for. See it's usage in config_opts_* above. | # ship a mkspec for. See it's usage in config_opts_* above. | ||||
# | # | ||||
# 5. Put our C, CXX and LD FLAGS into gcc-base.conf. Only used for non-host builds. | # 4. Put our C, CXX and LD FLAGS into gcc-base.conf. Only used for non-host builds. | ||||
# | # | ||||
# 6. Do similar for the win32-g++ mkspec. | # 5. Do similar for the win32-g++ mkspec. | ||||
# | # | ||||
# 7. In clang.conf, swap out clang & clang++, for our compiler + flags. See #17466. | # 6. In clang.conf, swap out clang & clang++, for our compiler + flags. See #17466. | ||||
# | # | ||||
# 8. Adjust a regex in toolchain.prf, to accomodate Guix's usage of | # 7. Adjust a regex in toolchain.prf, to accomodate Guix's usage of | ||||
# CROSS_LIBRARY_PATH. See core#15277. | # CROSS_LIBRARY_PATH. See core#15277. | ||||
define $(package)_preprocess_cmds | define $(package)_preprocess_cmds | ||||
cp $($(package)_patch_dir)/qt.pro qt.pro && \ | |||||
cp $($(package)_patch_dir)/qttools_src.pro qttools/src/src.pro && \ | |||||
patch -p1 -i $($(package)_patch_dir)/fix_numeric_limits_compile_error.patch && \ | patch -p1 -i $($(package)_patch_dir)/fix_numeric_limits_compile_error.patch && \ | ||||
patch -p1 -i $($(package)_patch_dir)/drop_lrelease_dependency.patch && \ | |||||
patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch && \ | patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch && \ | ||||
patch -p1 -i $($(package)_patch_dir)/fix_qt_pkgconfig.patch && \ | patch -p1 -i $($(package)_patch_dir)/fix_qt_pkgconfig.patch && \ | ||||
patch -p1 -i $($(package)_patch_dir)/fix_no_printer.patch && \ | patch -p1 -i $($(package)_patch_dir)/fix_no_printer.patch && \ | ||||
patch -p1 -i $($(package)_patch_dir)/no-xlib.patch && \ | patch -p1 -i $($(package)_patch_dir)/no-xlib.patch && \ | ||||
patch -p1 -i $($(package)_patch_dir)/no_sdk_version_check.patch && \ | patch -p1 -i $($(package)_patch_dir)/no_sdk_version_check.patch && \ | ||||
patch -p1 -i $($(package)_patch_dir)/fix_lib_paths.patch && \ | patch -p1 -i $($(package)_patch_dir)/fix_lib_paths.patch && \ | ||||
sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \ | |||||
mkdir -p qtbase/mkspecs/macx-clang-linux &&\ | mkdir -p qtbase/mkspecs/macx-clang-linux &&\ | ||||
cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\ | cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\ | ||||
cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \ | cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \ | ||||
cp -r qtbase/mkspecs/linux-arm-gnueabi-g++ qtbase/mkspecs/bitcoin-linux-g++ && \ | cp -r qtbase/mkspecs/linux-arm-gnueabi-g++ qtbase/mkspecs/bitcoin-linux-g++ && \ | ||||
sed -i.old "s/arm-linux-gnueabi-/$(host)-/g" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \ | sed -i.old "s/arm-linux-gnueabi-/$(host)-/g" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \ | ||||
echo "!host_build: QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ | echo "!host_build: QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ | ||||
echo "!host_build: QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ | echo "!host_build: QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ | ||||
echo "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ | echo "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ | ||||
sed -i.old "s|QMAKE_CC = \$$$$\$$$${CROSS_COMPILE}clang|QMAKE_CC = $($(package)_cc)|" qtbase/mkspecs/common/clang.conf && \ | sed -i.old "s|QMAKE_CC = \$$$$\$$$${CROSS_COMPILE}clang|QMAKE_CC = $($(package)_cc)|" qtbase/mkspecs/common/clang.conf && \ | ||||
sed -i.old "s|QMAKE_CXX = \$$$$\$$$${CROSS_COMPILE}clang++|QMAKE_CXX = $($(package)_cxx)|" qtbase/mkspecs/common/clang.conf && \ | sed -i.old "s|QMAKE_CXX = \$$$$\$$$${CROSS_COMPILE}clang++|QMAKE_CXX = $($(package)_cxx)|" qtbase/mkspecs/common/clang.conf && \ | ||||
sed -i.old "s/LIBRARY_PATH/(CROSS_)?\0/g" qtbase/mkspecs/features/toolchain.prf | sed -i.old "s/LIBRARY_PATH/(CROSS_)?\0/g" qtbase/mkspecs/features/toolchain.prf | ||||
endef | endef | ||||
define $(package)_config_cmds | define $(package)_config_cmds | ||||
export PKG_CONFIG_SYSROOT_DIR=/ && \ | export PKG_CONFIG_SYSROOT_DIR=/ && \ | ||||
export PKG_CONFIG_LIBDIR=$(host_prefix)/lib/pkgconfig && \ | export PKG_CONFIG_LIBDIR=$(host_prefix)/lib/pkgconfig && \ | ||||
export PKG_CONFIG_PATH=$(host_prefix)/share/pkgconfig && \ | export PKG_CONFIG_PATH=$(host_prefix)/share/pkgconfig && \ | ||||
cd qtbase && \ | cd qtbase && \ | ||||
./configure $($(package)_config_opts) && \ | ./configure -top-level $($(package)_config_opts) | ||||
cd .. && \ | |||||
$(MAKE) -C qtbase sub-src-clean && \ | |||||
qtbase/bin/qmake -o qttranslations/Makefile qttranslations/qttranslations.pro && \ | |||||
qtbase/bin/qmake -o qttranslations/translations/Makefile qttranslations/translations/translations.pro && \ | |||||
qtbase/bin/qmake -o qttools/src/linguist/Makefile qttools/src/linguist/linguist.pro && \ | |||||
qtbase/bin/qmake -o qttools/src/linguist/lconvert/Makefile qttools/src/linguist/lconvert/lconvert.pro && \ | |||||
qtbase/bin/qmake -o qttools/src/linguist/lrelease/Makefile qttools/src/linguist/lrelease/lrelease.pro && \ | |||||
qtbase/bin/qmake -o qttools/src/linguist/lupdate/Makefile qttools/src/linguist/lupdate/lupdate.pro | |||||
endef | endef | ||||
define $(package)_build_cmds | define $(package)_build_cmds | ||||
$(MAKE) -j$(JOBS) -C qtbase && \ | $(MAKE) -j$(JOBS) | ||||
$(MAKE) -j$(JOBS) -C qttools/src/linguist/lconvert && \ | |||||
$(MAKE) -j$(JOBS) -C qttools/src/linguist/lrelease && \ | |||||
$(MAKE) -j$(JOBS) -C qttools/src/linguist/lupdate && \ | |||||
$(MAKE) -j$(JOBS) -C qttranslations | |||||
endef | endef | ||||
define $(package)_stage_cmds | define $(package)_stage_cmds | ||||
$(MAKE) -C qtbase INSTALL_ROOT=$($(package)_staging_dir) install && \ | $(MAKE) INSTALL_ROOT=$($(package)_staging_dir) install && \ | ||||
$(MAKE) -C qttools/src/linguist/lconvert INSTALL_ROOT=$($(package)_staging_dir) install && \ | $(MAKE) -C qttools/src/linguist INSTALL_ROOT=$($(package)_staging_dir) $(addsuffix -install_subtargets,$(addprefix sub-,$($(package)_linguist_tools))) && \ | ||||
$(MAKE) -C qttools/src/linguist/lrelease INSTALL_ROOT=$($(package)_staging_dir) install && \ | |||||
$(MAKE) -C qttools/src/linguist/lupdate INSTALL_ROOT=$($(package)_staging_dir) install && \ | |||||
$(MAKE) -C qttools/src/linguist INSTALL_ROOT=$($(package)_staging_dir) install_cmake_linguist_tools_files && \ | $(MAKE) -C qttools/src/linguist INSTALL_ROOT=$($(package)_staging_dir) install_cmake_linguist_tools_files && \ | ||||
$(MAKE) -C qttranslations INSTALL_ROOT=$($(package)_staging_dir) install_subtargets | $(MAKE) -C qttranslations INSTALL_ROOT=$($(package)_staging_dir) install_subtargets | ||||
endef | endef | ||||
define $(package)_postprocess_cmds | define $(package)_postprocess_cmds | ||||
rm -rf native/lib/ lib/lib*.la | rm -rf native/lib/ lib/lib*.la | ||||
endef | endef |