diff --git a/3rdparty/ext_qt/show-proper-error.patch b/3rdparty/ext_qt/show-proper-error.patch new file mode 100644 index 0000000000..a49eddc027 --- /dev/null +++ b/3rdparty/ext_qt/show-proper-error.patch @@ -0,0 +1,13 @@ +--- a/src/plugins/platforms/android/qandroidplatformopenglwindow.cpp ++++ b/src/plugins/platforms/android/qandroidplatformopenglwindow.cpp +@@ -180,9 +180,9 @@ + m_nativeWindow = ANativeWindow_fromSurface(env, m_androidSurfaceObject.object()); + m_androidSurfaceObject = QJNIObjectPrivate(); + m_eglSurface = eglCreateWindowSurface(m_eglDisplay, config, m_nativeWindow, NULL); ++ EGLint error = eglGetError(); + m_format = q_glFormatFromConfig(m_eglDisplay, config, window()->requestedFormat()); + if (Q_UNLIKELY(m_eglSurface == EGL_NO_SURFACE)) { +- EGLint error = eglGetError(); + eglTerminate(m_eglDisplay); + qFatal("EGL Error : Could not create the egl surface: error = 0x%x\n", error); + } diff --git a/3rdparty/ext_qt/workaround-null-eglconfig-crash.patch b/3rdparty/ext_qt/workaround-null-eglconfig-crash.patch new file mode 100644 index 0000000000..db06883ff8 --- /dev/null +++ b/3rdparty/ext_qt/workaround-null-eglconfig-crash.patch @@ -0,0 +1,11 @@ +--- a/src/plugins/platforms/android/qandroidplatformopenglwindow.cpp ++++ b/src/plugins/platforms/android/qandroidplatformopenglwindow.cpp +@@ -176,6 +176,8 @@ + void QAndroidPlatformOpenGLWindow::createEgl(EGLConfig config) + { + clearEgl(); ++ if (config == nullptr) ++ return; + QJNIEnvironmentPrivate env; + m_nativeWindow = ANativeWindow_fromSurface(env, m_androidSurfaceObject.object()); + m_androidSurfaceObject = QJNIObjectPrivate(); diff --git a/packaging/android/build_ext.sh b/packaging/android/build_ext.sh index d61a68a5ca..f3b43bb8aa 100755 --- a/packaging/android/build_ext.sh +++ b/packaging/android/build_ext.sh @@ -1,41 +1,40 @@ -#!/bin/bash +#!/bin/bash -e # See more: 3rdparty/README.md # Build external dependencies in $KRITA_ROOT/3rdparty # assuming in $KRITA_ROOT/b : ${KRITA_ROOT?"Project root path must be set"} : ${CMAKE_ANDROID_NDK?"Android NDK path must be set"} : ${ANDROID_API_LEVEL?"Android API level is required"} : ${QT_ANDROID?"Path to QT root is required"} : ${BUILD_ROOT? "Build root must be set"} if [[ -z $ANDROID_ABI ]]; then echo "ANDROID_ABI not specified, using the default one: armeabi-v7a" ANDROID_ABI=armeabi-v7a fi ANDROID_NATIVE_API_LEVEL=android-$ANDROID_API_LEVEL cmake $KRITA_ROOT/3rdparty \ -DINSTALL_ROOT=$BUILD_ROOT/i \ -DEXTERNALS_DOWNLOAD_DIR=$BUILD_ROOT/d \ -DCMAKE_INSTALL_PREFIX=$BUILD_ROOT/i \ -DCMAKE_TOOLCHAIN_FILE=$CMAKE_ANDROID_NDK/build/cmake/android.toolchain.cmake \ -DANDROID_PLATFORM=$ANDROID_NATIVE_API_LEVEL \ -DANDROID_ABI=$ANDROID_ABI \ -DANDROID_STL=c++_static - # You can comment these and build them individually cmake --build . --config RelWithDebInfo --target ext_png cmake --build . --config RelWithDebInfo --target ext_zlib cmake --build . --config RelWithDebInfo --target ext_quazip cmake --build . --config RelWithDebInfo --target ext_lcms2 # this one SHOULD be built before exiv cmake --build . --config RelWithDebInfo --target ext_expat cmake --build . --config RelWithDebInfo --target ext_exiv2 cmake --build . --config RelWithDebInfo --target ext_gsl diff --git a/packaging/android/build_qt.sh b/packaging/android/build_qt.sh new file mode 100755 index 0000000000..9327f08e64 --- /dev/null +++ b/packaging/android/build_qt.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +: ${KRITA_ROOT?"Project root path must be set"} +: ${CMAKE_ANDROID_NDK?"Android NDK path must be set"} +: ${BUILD_ROOT? "Build root must be set"} +: ${ANDROID_SDK_ROOT? "Android SDK path must be set"} + +if [[ -z $ANDROID_ABI ]]; then + echo "ANDROID_ABI not specified, using the default one: armeabi-v7a" + ANDROID_ABI=armeabi-v7a +fi + +cmake $KRITA_ROOT/3rdparty \ + -DINSTALL_ROOT=$BUILD_ROOT/i \ + -DEXTERNALS_DOWNLOAD_DIR=$BUILD_ROOT/d \ + -DCMAKE_INSTALL_PREFIX=$BUILD_ROOT/i \ + -DCMAKE_TOOLCHAIN_FILE=$CMAKE_ANDROID_NDK/build/cmake/android.toolchain.cmake \ + -DANDROID_ABI=$ANDROID_ABI \ + -DANDROID_STL=c++_static \ + -DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT + +cmake --build . --config RelWithDebInfo --target ext_qt +