Skip to content

Commit

Permalink
darwin fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Sep 28, 2024
1 parent 2d2275b commit c53414e
Showing 1 changed file with 25 additions and 16 deletions.
41 changes: 25 additions & 16 deletions depends/packages/qt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ $(package)_config_opts += -no-feature-undostack
$(package)_config_opts += -no-feature-undoview
$(package)_config_opts += -no-feature-vnc

ifeq ($(host),$(build))
# Qt Tools module.
$(package)_config_opts += -feature-linguist
$(package)_config_opts += -no-feature-assistant
Expand All @@ -106,26 +107,14 @@ $(package)_config_opts += -no-feature-pixeltool
$(package)_config_opts += -no-feature-qtattributionsscanner
$(package)_config_opts += -no-feature-qtdiag
$(package)_config_opts += -no-feature-qtplugininfo
endif

$(package)_config_opts_darwin = -no-dbus
$(package)_config_opts_darwin += -no-opengl
$(package)_config_opts_darwin += -pch
$(package)_config_opts_darwin += -no-pch
$(package)_config_opts_darwin += -no-freetype
$(package)_config_opts_darwin += QMAKE_MACOSX_DEPLOYMENT_TARGET=$(OSX_MIN_VERSION)

ifneq ($(build_os),darwin)
$(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_VERSION=$(OSX_SDK_VERSION)
$(package)_config_opts_darwin += -device-option CROSS_COMPILE="llvm-"
$(package)_config_opts_darwin += -device-option MAC_TARGET=$(host)
$(package)_config_opts_darwin += -device-option XCODE_VERSION=$(XCODE_VERSION)
endif

ifneq ($(build_arch),$(host_arch))
$(package)_config_opts_aarch64_darwin += -device-option QMAKE_APPLE_DEVICE_ARCHS=arm64
$(package)_config_opts_x86_64_darwin += -device-option QMAKE_APPLE_DEVICE_ARCHS=x86_64
endif
$(package)_config_opts_darwin += -no-feature-printsupport
$(package)_config_opts_darwin += -no-feature-vulkan

$(package)_config_opts_linux = -xcb
$(package)_config_opts_linux += -no-xcb-xlib
Expand Down Expand Up @@ -167,12 +156,22 @@ $(package)_cmake_opts += --log-level=STATUS
ifneq ($(host),$(build))
$(package)_cmake_opts += -DCMAKE_SYSTEM_NAME=$($(host_os)_cmake_system_name)
endif
ifeq ($(host_os),darwin)
$(package)_cmake_opts += -DCMAKE_INSTALL_NAME_TOOL=true
$(package)_cmake_opts += -DCMAKE_FRAMEWORK_PATH=$(OSX_SDK)/System/Library/Frameworks
$(package)_cmake_opts += -DQT_INTERNAL_APPLE_SDK_VERSION=$(OSX_SDK_VERSION)
$(package)_cmake_opts += -DQT_NO_XCODE_MIN_VERSION_CHECK=TRUE
endif

$(package)_config_env := CC="$$($(package)_cc)"
$(package)_config_env += CFLAGS="$$($(package)_cppflags) $$($(package)_cflags)"
$(package)_config_env += CXX="$$($(package)_cxx)"
$(package)_config_env += CXXFLAGS="$$($(package)_cppflags) $$($(package)_cxxflags)"
$(package)_config_env += LDFLAGS="$$($(package)_ldflags)"
$(package)_config_env_darwin := OBJC="$$($(package)_cc)"
$(package)_config_env_darwin += OBJCFLAGS="$$($(package)_cppflags) $$($(package)_cflags)"
$(package)_config_env_darwin += OBJCXX="$$($(package)_cxx)"
$(package)_config_env_darwin += OBJCXXFLAGS="$$($(package)_cppflags) $$($(package)_cxxflags)"
endef

define $(package)_fetch_cmds
Expand All @@ -181,6 +180,7 @@ $(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttranslat
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttools_file_name),$($(package)_qttools_file_name),$($(package)_qttools_sha256_hash))
endef

ifeq ($(host),$(build))
define $(package)_extract_cmds
mkdir -p $($(package)_extract_dir) && \
echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \
Expand All @@ -194,6 +194,15 @@ define $(package)_extract_cmds
mkdir qttools && \
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools
endef
else
define $(package)_extract_cmds
mkdir -p $($(package)_extract_dir) && \
echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \
$(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
endef
endif

define $(package)_preprocess_cmds
cp $($(package)_patch_dir)/top_level_CMakeLists.txt CMakeLists.txt && \
Expand Down

0 comments on commit c53414e

Please sign in to comment.