termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.15k stars 3.02k forks source link

[Bug]: Qt6 Unknown CMake command "qt6_android_apply_arch_suffix" #21004

Closed DuilioPerez closed 2 months ago

DuilioPerez commented 2 months ago

Problem description

Hello, I'm trying to port a KDE's game for Termux, and I've compiled some KF6 modules that aren't in the Termux's repos. But when I try to compile kf6-kiconthemes cmake can't find that macro. Acording to Qt documentation, "qt6_android_apply_arch_suffix" was introduced in Qt 6 link here. But when I try to compile I have the next error:

cmake -S . -B build -DQT_REQUIRE_HOST_PATH_CHECK=NO -DQt6HostInfo_DIR=/data/data/com.termux/files/usr/lib/cmake/Qt6HostInfo/
-- The C compiler identification is Clang 18.1.8
-- The CXX compiler identification is Clang 18.1.8
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /data/data/com.termux/files/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info                                                                                      -- Detecting CXX compiler ABI info - done                                                                               -- Check for working CXX compiler: /data/data/com.termux/files/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
--

-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Installing in the same prefix as Qt, adopting their path scheme.
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE
-- Looking for __GLIBC__
-- Looking for __GLIBC__ - not found
-- Performing Test _OFFT_IS_64BIT
-- Performing Test _OFFT_IS_64BIT - Success
-- Performing Test HAVE_DATE_TIME
-- Performing Test HAVE_DATE_TIME - Success
-- Found OpenGL: /data/data/com.termux/files/usr/lib/libOpenGL.so
-- Found WrapOpenGL: TRUE
-- Found XKB: /data/data/com.termux/files/usr/lib/libxkbcommon.so (found suitable version "1.7.0", minimum required is "0.5.0")
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
-- Found Gettext: /data/data/com.termux/files/usr/bin/msgmerge (found version "0.22.5")
CMake Error at /data/data/com.termux/files/usr/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2676 (qt6_android_apply_arch_suffix):
  Unknown CMake command "qt6_android_apply_arch_suffix".
Call Stack (most recent call first):
  /data/data/com.termux/files/usr/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2451 (_qt_internal_add_library)
  /data/data/com.termux/files/usr/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake:2043 (qt6_add_plugin)
  /data/data/com.termux/files/usr/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake:379 (qt6_add_qml_plugin)
  /data/data/com.termux/files/usr/share/ECM/modules/ECMQmlModule6.cmake:77 (qt6_add_qml_module)
  src/qml/CMakeLists.txt:1 (ecm_add_qml_module)

-- Configuring incomplete, errors occurred!

What steps will reproduce the bug?

Try to compile kf6-kiconthemes

What is the expected behavior?

Don't show that error

System information

ATermux Variables:
TERMUX_API_VERSION=0.50.1
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=24119
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://packages-cf.termux.dev/apt/termux-main/ stable main
# glibc-repo (sources.list.d/glibc.list)
deb https://packages-cf.termux.dev/apt/termux-glibc/ glibc stable
# tur-repo (sources.list.d/tur.list)
deb https://tur.kcubeterm.com tur-packages tur tur-on-device tur-continuous
# x11-repo (sources.list.d/x11.list)
deb https://packages-cf.termux.dev/apt/termux-x11/ x11 main
Updatable packages:
All packages up to date
termux-tools version:
1.43.1
Android version:
11
Kernel build information:
Linux localhost 4.14.186-22735277 #1 SMP PREEMPT Sat Feb 19 02:14:57 KST 2022 aarch64 Android
Device manufacturer:
samsung
Device model:
SM-A225M
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.api versionCode:51
com.termux.x11 versionCode:15
com.termux.styling versionCode:32
Biswa96 commented 2 months ago

The actual issue in qt6 can be fixed. Also, how many packages do you need for that KDE game? I could try to add those packages after asking permission to do so.

DuilioPerez commented 2 months ago

The actual issue in qt6 can be fixed. Also, how many packages do you need for that KDE game? I could try to add those packages after asking permission to do so.

I need the following packages: kf6-kcolorscheme kf6-kconfigwidgets kf6-kcrash kf6-kdbusaddons kf6-kiconthemes kf6-kxmlgui kf6-doctools kf6-newstuff. I've compiled most of them. I've not compiled kf6-kxmlgui, wich depends on kf6-kiconthemes, kf6-doctools and kf6-knewstuff, these I've not tried to compile. The others compile successfully. kf6-kcrash and kf6-kdbrusaddons need to be compiled with KF_IGNORE_PLATFORM_CHECK variable set to true because Android isn't supported. Also all those packages need the following configuration in cmake -DQT_REQUIRE_HOST_PATH_CHECK=NO -DQt6HostInfo_DIR=/data/data/com.termux/files/usr/lib/cmake/Qt6HostInfo/. It was confusing to me because I'm not familiar with Qt and KDE, but it seems it try cross compilation everytime, so this is needed

Biswa96 commented 2 months ago

For quick workaround, you could try to comment out the following line in $PREFIX/lib/cmake/Qt6Core/Qt6CoreMacros.cmake file.

--- a/Qt6CoreMacros.cmake
+++ b/Qt6CoreMacros.cmake
@@ -2673,7 +2673,7 @@
     if(ANDROID)
         set_property(TARGET "${target}"
                      PROPERTY _qt_android_apply_arch_suffix_called_from_qt_impl TRUE)
-        qt6_android_apply_arch_suffix("${target}")
+        # qt6_android_apply_arch_suffix("${target}")
     endif()
 endfunction()
DuilioPerez commented 2 months ago

After doing that: Screenshot_20240731-135255_Termux It happens the same error, even deleting the cmake build cache directory:

cmake -S . -B build -DQT_REQUIRE_HOST_PATH_CHECK=NO -DQt6HostInfo_DIR=/data/data/com.termux/files/usr/lib/cmake/Qt6HostInfo/
-- The C compiler identification is Clang 18.1.8
-- The CXX compiler identification is Clang 18.1.8
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /data/data/com.termux/files/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /data/data/com.termux/files/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
--

-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Installing in the same prefix as Qt, adopting their path scheme.
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE
-- Looking for __GLIBC__
-- Looking for __GLIBC__ - not found
-- Performing Test _OFFT_IS_64BIT
-- Performing Test _OFFT_IS_64BIT - Success
-- Performing Test HAVE_DATE_TIME
-- Performing Test HAVE_DATE_TIME - Success
-- Found OpenGL: /data/data/com.termux/files/usr/lib/libOpenGL.so
-- Found WrapOpenGL: TRUE
-- Found XKB: /data/data/com.termux/files/usr/lib/libxkbcommon.so (found suitable version "1.7.0", minimum required is "0.5.0")
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
-- Found Gettext: /data/data/com.termux/files/usr/bin/msgmerge (found version "0.22.5")
CMake Error at /data/data/com.termux/files/usr/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake:2149 (qt6_android_apply_arch_suffix):
  Unknown CMake command "qt6_android_apply_arch_suffix".
Call Stack (most recent call first):
  /data/data/com.termux/files/usr/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake:379 (qt6_add_qml_plugin)
  /data/data/com.termux/files/usr/share/ECM/modules/ECMQmlModule6.cmake:77 (qt6_add_qml_module)
  src/qml/CMakeLists.txt:1 (ecm_add_qml_module)
Biswa96 commented 2 months ago

Does adding -DCMAKE_SYSTEM_NAME=Linux option with cmake make any change? Also, the host info option is not required when compiling in same Android system.

DuilioPerez commented 2 months ago

Ok, it seems it worked. But it requires breeze icons. The problem is, I can't compile it because it crashes termux.

DuilioPerez commented 2 months ago

I'll try to compile the others two modules and then I'll see how to compile this one. It's just breeze icons the problem.

DuilioPerez commented 2 months ago

@Biswa96 Almost all done! Just need two modules that I can't compile, kf6-kdoctools and kf6-kxmlgui, the last depends of kf6-kiconthemes and this depends on breeze-icons

Biswa96 commented 2 months ago

Could this issue be closed now? IIUC, there is nothing actionable in this repository.

DuilioPerez commented 2 months ago

Yes, closing now