On Tuesday 19 July 2016, Axel Richter wrote:
> Am 17.07.2016 um 15:58 schrieb Willem Ferguson:
> > Hallo Axel,
> > I hope that the text underneath is not too unreadable.
> > 
> > The short version of my request:
> >     I get an error when running a cross-built Subsurface
> > 
> > Android,
> > indicating kirigami has not been loaded.
> > 
> > The long version of my request;
> > 
> >     I installed Qt5.7 (see location in build.sh)
> >     Did the patches you suggested.
> >     Exported JAVA_HOME
> >     The build runs ok, creating the .apk
> >     
> >     Underneath the listings of:
> >         build.sh in packaging/android
> >         mobile-resources.qrc
> >         mobile-components.sh
> >         adb logcat output.
> > 
> > Any ideas what I am doing wrong?
> > 
> > Kind regards,
> > willem
> > 
> > git describe
> > ==========
> > v4.5.2-1475-geaed18b
> > 
> > Build.sh:
> > =================
> > set -e
> > PLATFORM=$(uname)
> > # (trick to get the absolute path, either if we're called
> > with a
> > # absolute path or a relative path)
> > pushd $(dirname $0)/../../
> > export SUBSURFACE_SOURCE=$PWD
> > popd
> > 
> > # is this a release or debug build
> > BUILD_TYPE=Debug
> > if [ "$1" = "release" ] || [ "$1" = "Release" ] ; then
> > 
> >     shift
> >     BUILD_TYPE=Release
> > 
> > fi
> > if [ "$1" = "debug" ] || [ "$1" = "Debug" ] ; then
> > 
> >     # this is the default - still need to eat the argument
> > 
> > if given
> > 
> >     shift
> > 
> > fi
> > 
> > if [ "$1" = "-buildnr" ] ; then
> > 
> >     shift
> >     BUILD_NR="\"$1\""
> >     shift
> > 
> > else
> > 
> >     BUILD_NR="\"0\""
> > 
> > fi
> > 
> > # Configure where we can find things here
> > export ANDROID_NDK_ROOT=/usr/share/android-ndk-r12     # --->
> > export QT5_ANDROID=/home/willem/Qt/5.7                 # --->
> > 
> > #if [ ! -z "$QT5_ANDROID" ] ; then
> > #    echo "Using Qt5 in $QT5_ANDROID"
> > #elif [ -d "$SUBSURFACE_SOURCE/../Qt/5.7" ] ; then
> > #    export QT5_ANDROID=$SUBSURFACE_SOURCE/../Qt/5.7
> > #elif [ -d "$SUBSURFACE_SOURCE/../Qt/5.6" ] ; then
> > #    export QT5_ANDROID=$SUBSURFACE_SOURCE/../Qt/5.6
> > #elif [ -d "$SUBSURFACE_SOURCE/../Qt/5.5" ] ; then
> > #    export QT5_ANDROID=$SUBSURFACE_SOURCE/../Qt/5.5
> > #else
> > #    echo "Cannot find Qt 5.7, 5.6 or 5.5 under
> > $SUBSURFACE_SOURCE/../Qt"
> > #    exit 1
> > #fi
> > 
> > if [ $PLATFORM = Darwin ] ; then
> > 
> >        export
> > 
> > ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT-$SUBSURFACE_SOURCE/../android-sdk-mac
> > osx}
> > 
> >        export ANDROID_NDK_HOST=darwin-x86_64
> > 
> > else
> > 
> >        export
> > 
> > ANDROID_SDK_ROOT=/usr/share/android-sdk-linux     # --->
> > 
> >        export ANDROID_NDK_HOST=linux-x86
> > 
> > fi
> > 
> >     ........................................
> > 
> > export QT5_ANDROID_BIN=${QT5_ANDROID}/android_${QT_ARCH}/bin
> > 
> > if [ ! -e ndk-$ARCH ] ; then
> > 
> >  $ANDROID_NDK_ROOT/build/tools/make_standalone_toolchain.py
> > 
> > --arch=$ARCH --install-dir=ndk-$ARCH --api=16
> > fi
> > export BUILDROOT=$PWD
> > export PATH=${BUILDROOT}/ndk-$ARCH/bin:$PATH
> > export PREFIX=${BUILDROOT}/ndk-$ARCH/sysroot/usr
> > export PKG_CONFIG_LIBDIR=${PREFIX}/lib/pkgconfig
> > export CC=${BUILDROOT}/ndk-$ARCH/bin/${BUILDCHAIN}-gcc
> > export CXX=${BUILDROOT}/ndk-$ARCH/bin/${BUILDCHAIN}-g++
> > # autoconf seems to get lost without this
> > export SYSROOT=${BUILDROOT}/ndk-$ARCH/sysroot
> > export CFLAGS="--sysroot=${SYSROOT}"
> > export CPPFLAGS="--sysroot=${SYSROOT}"
> > export CXXFLAGS="--sysroot=${SYSROOT}"
> > # Junk needed for qt-android-cmake
> > export ANDROID_STANDALONE_TOOLCHAIN=${BUILDROOT}/ndk-$ARCH
> > #if [ $PLATFORM = Darwin ] ; then
> > #    JAVA_HOME=$(/usr/libexec/java_home)
> > #    export JAVA_HOME
> > #else
> > 
> >     export JAVA_HOME=/usr/share/jdk1.8.0_77             #
> > 
> > ----->
> > #    export JAVA_HOME=/usr                              #
> > ----->
> > #fi
> > 
> > 
> > mobile-resouces.qrc
> > ===================
> > <RCC>
> > 
> >     <qresource prefix="/qml">
> >     
> >         <file>main.qml</file>
> >         <file>Preferences.qml</file>
> >         <file>About.qml</file>
> >         <file>CloudCredentials.qml</file>
> >         
> >             ...........
> >         
> >         <file
> > 
> > alias="menu-edit.png">icons/menu-edit.png</file>
> > 
> >         <file
> > 
> > alias="menu-back.png">icons/menu-back.png</file>
> > 
> >         <file alias="nocloud.svg">icons/nocloud.svg</file>
> >     
> >     </qresource>
> >     <qresource prefix="/imports">
> >     
> >         <file
> > 
> > alias="org/kde/kirigami/Action.qml">kirigami/Action.qml</file>
> > 
> >                 # ---->
> >         
> >         <file
> > 
> > alias="org/kde/kirigami/ApplicationWindow.qml">kirigami/ApplicationWindow
> > .qml</file>
> > 
> > 
> > 
> > Mobile-components.sh
> > =====================
> > #!/bin/bash
> > #
> > # if you run the build.sh script to build Subsurface
> > you'll never need
> > # this, but if you build your binaries differently for
> > some reason and
> > # you want to build Subsurface-mobile, running this from
> > within the
> > # checked out source directory (not your build directory)
> > should do the
> > # trick - you can also run this to update to the latest
> > upstream when
> > # you don't want to rerun the whole build.sh script.
> > 
> > SRC=$(cd .. ; pwd)
> > 
> > if [ ! -d "$SRC/subsurface" ] || [ ! -d "mobile-widgets" ]
> > 
> > || [ ! -d
> > 
> > "core" ] ; then
> > 
> >     echo "please start this script from the Subsurface
> > 
> > source directory
> > (which needs to be named \"subsurface\")."
> > 
> >     exit 1
> > 
> > fi
> > 
> > if [ "$1" = "-nopull" ] ; then
> > 
> >     NOPULL=1
> > 
> > fi
> > 
> > # now bring in the latest Kirigami mobile components plus
> > a couple of
> > icons that we need
> > # first, get the latest from upstream
> > # yes, this is a bit overkill as we clone a lot of stuff
> > for just a few
> > files, but this way
> > # we stop having to manually merge our code with upstream
> > all the time
> > # as we get closer to shipping a production version we'll
> > likely check
> > out specific tags
> > # or SHAs from upstream
> > cd $SRC
> > if [ ! -d kirigami ] ; then
> > 
> >     git clone git://github.com/KDE/kirigami
> > 
> > fi
> > if [ "$NOPULL" = "" ] ; then
> > 
> >     pushd kirigami
> >     git pull
> >     popd
> > 
> > fi
> > if [ ! -d breeze-icons ] ; then
> > 
> >     git clone git://anongit.kde.org/breeze-icons
> > 
> > fi
> > if [ "$NOPULL" = "" ] ; then
> > 
> >     pushd breeze-icons
> >     git pull
> >     popd
> > 
> > fi
> > 
> > # now copy the components and a couple of icons into plae
> > MC=$SRC/subsurface/mobile-widgets/qml/kirigami
> > PMMC=kirigami/src/controls
> > # ------------->
> > BREEZE=breeze-icons
> > 
> > rm -rf $MC
> > mkdir -p $MC/icons
> > cp -R $PMMC/* $MC/
> > #cp $PMMC/../fallbacktheme/*qml $MC/
> > cp -R $PMMC/templates/*
> > $MC/                                  #
> > ----------->
> > 
> > # fix plugin requirement
> > sed -i -e 's/^plugin kirigamiplugin/# plugin
> > kirigamiplugin/' $MC/qmldir
> > 
> > 
> > adb logcat | -i subsurface:
> > ===========================
> > 07-17 11:08:38.755  4145  4145 I ApplicationPackageManager:
> > load=org.subsurfacedivelog.mobile, bg=192-192, dr=192-192
> > 07-17 11:08:48.805  4438  4438 I Timeline: Timeline:
> > Activity_launch_request id:org.subsurfacedivelog.mobile
> > time:9386825
> > 07-17 11:08:48.835 13025 13025 W SELinux : SELinux:
> > seapp_context_lookup: seinfo=default, level=s0:c512,c768,
> > pkgname=org.subsurfacedivelog.mobile
> > 07-17 11:08:48.875  3468  3579 D ISSUE_DEBUG:
> > InputChannelName : 8ae118c
> > Starting org.subsurfacedivelog.mobile
> > 07-17 11:08:48.875 13025 13025 D InjectionManager:
> > fillFeatureStoreMap
> > org.subsurfacedivelog.mobile
> > 07-17 11:08:48.875 13025 13025 I InjectionManager:
> > Constructor
> > org.subsurfacedivelog.mobile, Feature store :{}
> > 07-17 11:08:48.925  3468  3579 V WindowStateAnimator:
> > Finishing drawing
> > window Window{8ae118c u0 d0 Starting
> > org.subsurfacedivelog.mobile}:
> > mDrawState=DRAW_PENDING
> > 07-17 11:08:48.925  3468  3579 V WindowStateAnimator:
> > Finishing drawing
> > window Window{8ae118c u0 d0 Starting
> > org.subsurfacedivelog.mobile}:
> > mDrawState=COMMIT_DRAW_PENDING
> > 07-17 11:08:49.065 13025 13025 W linker  :
> > /data/app/org.subsurfacedivelog.mobile-1/lib/arm/libQt5Concurrent.so:
> > 
> > unused DT entry: type 0x1d arg 0xc8e
> > 07-17 11:08:49.065 13025 13025 W linker  :
> > /data/app/org.subsurfacedivelog.mobile-1/lib/arm/libQt5Concurrent.so:
> > 
> > unsupported flags DT_FLAGS_1=0x81
> > 07-17 11:08:49.065 13025 13025 W linker  :
> > /data/app/org.subsurfacedivelog.mobile-1/lib/arm/libQt5Gui.so:
> > unused DT
> > entry: type 0x1d arg 0x5066f
> > 07-17 11:08:49.065 13025 13025 W linker  :
> > /data/app/org.subsurfacedivelog.mobile-1/lib/arm/libQt5Gui.so:
> > 
> > unsupported flags DT_FLAGS_1=0x81
> > 07-17 11:08:49.075 13025 13025 W linker  :
> > /data/app/org.subsurfacedivelog.mobile-1/lib/arm/libQt5Widgets.so:
> > 
> > unused DT entry: type 0x1d arg 0x6b435
> > 07-17 11:08:49.075 13025 13025 W linker  :
> > /data/app/org.subsurfacedivelog.mobile-1/lib/arm/libQt5Widgets.so:
> > 
> > unsupported flags DT_FLAGS_1=0x81
> > 07-17 11:08:49.085 13025 13025 W linker  :
> > /data/app/org.subsurfacedivelog.mobile-1/lib/arm/libQt5Svg.so:
> > unused DT
> > entry: type 0x1d arg 0x8f3b
> > 07-17 11:08:49.085 13025 13025 W linker  :
> > /data/app/org.subsurfacedivelog.mobile-1/lib/arm/libQt5Svg.so:
> > 
> > unsupported flags DT_FLAGS_1=0x81
> > 07-17 11:08:49.095 13025 13025 W linker  :
> > /data/app/org.subsurfacedivelog.mobile-1/lib/arm/libQt5Positioning.so:
> > 
> > unused DT entry: type 0x1d arg 0x5afb
> > 07-17 11:08:49.095 13025 13025 W linker  :
> > /data/app/org.subsurfacedivelog.mobile-1/lib/arm/libQt5Positioning.so:
> > 
> > unsupported flags DT_FLAGS_1=0x81
> > 07-17 11:08:49.105 13025 13025 W linker  :
> > /data/app/org.subsurfacedivelog.mobile-1/lib/arm/libQt5Network.so:
> > 
> > unused DT entry: type 0x1d arg 0x119fc
> > 07-17 11:08:49.105 13025 13025 W linker  :
> > /data/app/org.subsurfacedivelog.mobile-1/lib/arm/libQt5Network.so:
> > 
> > unsupported flags DT_FLAGS_1=0x81
> > 07-17 11:08:49.105 13025 13025 W linker  :
> > /data/app/org.subsurfacedivelog.mobile-1/lib/arm/libQt5Qml.so:
> > unused DT
> > entry: type 0x1d arg 0x33ce0
> > 07-17 11:08:49.105 13025 13025 W linker  :
> > /data/app/org.subsurfacedivelog.mobile-1/lib/arm/libQt5Qml.so:
> > 
> > unsupported flags DT_FLAGS_1=0x81
> > 07-17 11:08:49.115 13025 13025 W linker  :
> > /data/app/org.subsurfacedivelog.mobile-1/lib/arm/libQt5Quick.so:
> > unused
> > DT entry: type 0x1d arg 0x3d948
> > 07-17 11:08:49.115 13025 13025 W linker  :
> > /data/app/org.subsurfacedivelog.mobile-1/lib/arm/libQt5Quick.so:
> > 
> > unsupported flags DT_FLAGS_1=0x81
> > 07-17 11:08:49.125 13025 13025 W linker  :
> > /data/app/org.subsurfacedivelog.mobile-1/lib/arm/libQt5AndroidExtras.so:
> > 
> > unused DT entry: type 0x1d arg 0x5920
> > 07-17 11:08:49.125 13025 13025 W linker  :
> > /data/app/org.subsurfacedivelog.mobile-1/lib/arm/libQt5AndroidExtras.so:
> > 
> > unsupported flags DT_FLAGS_1=0x81
> > 07-17 11:08:49.135 13025 13025 W linker  :
> > /data/app/org.subsurfacedivelog.mobile-1/lib/arm/libQt5Bluetooth.so:
> > 
> > unused DT entry: type 0x1d arg 0x6e39
> > 07-17 11:08:49.135 13025 13025 W linker  :
> > /data/app/org.subsurfacedivelog.mobile-1/lib/arm/libQt5Bluetooth.so:
> > 
> > unsupported flags DT_FLAGS_1=0x81
> > 07-17 11:08:49.135 13025 13025 W linker  :
> > /data/app/org.subsurfacedivelog.mobile-1/lib/arm/libQt5QuickParticles.so:
> > unused
> > DT entry: type 0x1d arg 0x365b
> > 07-17 11:08:49.135 13025 13025 W linker  :
> > /data/app/org.subsurfacedivelog.mobile-1/lib/arm/libQt5QuickParticles.so:
> > unsupported
> > flags DT_FLAGS_1=0x81
> > 07-17 11:08:49.145 13025 13025 W linker  :
> > /data/data/org.subsurfacedivelog.mobile/qt-reserved-files/plugins/platfor
> > ms/android/libqtforandroid.so:
> > 
> > unused DT entry: type 0x1d arg 0x9315
> > 07-17 11:08:49.145 13025 13025 W linker  :
> > /data/data/org.subsurfacedivelog.mobile/qt-reserved-files/plugins/platfor
> > ms/android/libqtforandroid.so:
> > 
> > unsupported flags DT_FLAGS_1=0x81
> > 07-17 11:08:49.145 13025 13025 W linker  :
> > /data/data/org.subsurfacedivelog.mobile/qt-reserved-files/plugins/platfor
> > ms/android/libqtforandroid.so:
> > 
> > is missing DT_SONAME will use basename as a replacement:
> > "libqtforandroid.so"
> > 07-17 11:08:49.155 13025 13025 W linker  :
> > /data/data/org.subsurfacedivelog.mobile/qt-reserved-files/plugins/bearer/
> > libqandroidbearer.so:
> > 
> > unused DT entry: type 0x1d arg 0x1746
> > 07-17 11:08:49.155 13025 13025 W linker  :
> > /data/data/org.subsurfacedivelog.mobile/qt-reserved-files/plugins/bearer/
> > libqandroidbearer.so:
> > 
> > unsupported flags DT_FLAGS_1=0x81
> > 07-17 11:08:49.155 13025 13025 W linker  :
> > /data/data/org.subsurfacedivelog.mobile/qt-reserved-files/plugins/bearer/
> > libqandroidbearer.so:
> > 
> > is missing DT_SONAME will use basename as a replacement:
> > "libqandroidbearer.so"
> > 07-17 11:08:49.155 13025 13025 W linker  :
> > /data/data/org.subsurfacedivelog.mobile/qt-reserved-files/plugins/positio
> > n/libqtposition_android.so:
> > 
> > unused DT entry: type 0x1d arg 0x132d
> > 07-17 11:08:49.155 13025 13025 W linker  :
> > /data/data/org.subsurfacedivelog.mobile/qt-reserved-files/plugins/positio
> > n/libqtposition_android.so:
> > 
> > unsupported flags DT_FLAGS_1=0x81
> > 07-17 11:08:49.155 13025 13025 W linker  :
> > /data/data/org.subsurfacedivelog.mobile/qt-reserved-files/plugins/positio
> > n/libqtposition_android.so:
> > 
> > is missing DT_SONAME will use basename as a replacement:
> > "libqtposition_android.so"
> > 07-17 11:08:49.205  3468  4436 D ISSUE_DEBUG:
> > InputChannelName : 8e404c1
> > org.subsurfacedivelog.mobile/org.qtproject.qt5.android.bindings.QtActivit
> > y
> > 
> > 07-17 11:08:49.345 13025 13077 D libGLESv1: DTS_GLAPI :
> > DTS is not
> > allowed for Package : org.subsurfacedivelog.mobile
> > 07-17 11:08:49.385  3468  4451 V WindowStateAnimator:
> > Finishing drawing
> > window Window{8e404c1 u0 d0
> > org.subsurfacedivelog.mobile/org.qtproject.qt5.android.bindings.QtActivit
> > y}:
> > 
> > mDrawState=DRAW_PENDING
> > 07-17 11:08:49.405  3468  3579 I ActivityManager: Displayed
> > org.subsurfacedivelog.mobile/org.qtproject.qt5.android.bindings.QtActivit
> > y:
> > 
> > +587ms
> > 07-17 11:08:49.405  3468  3579 I Timeline: Timeline:
> > Activity_windows_visible id: ActivityRecord{523995c u0
> > org.subsurfacedivelog.mobile/org.qtproject.qt5.android.bindings.QtActivit
> > y
> > 
> > t83} time:9387428
> > 07-17 11:08:49.415 13025 13091 W Subsurface: (null):0
> > ((null)):
> > QFont::setPointSizeF: Point size <= 0 (-1.000000), must be
> > greater than 0
> > 07-17 11:08:49.435 13025 13105 W linker  :
> > /data/data/org.subsurfacedivelog.mobile/qt-reserved-files/qml/QtQuick.2/l
> > ibqtquick2plugin.so:
> > 
> > unused DT entry: type 0x1d arg 0x4bd
> > 07-17 11:08:49.435 13025 13105 W linker  :
> > /data/data/org.subsurfacedivelog.mobile/qt-reserved-files/qml/QtQuick.2/l
> > ibqtquick2plugin.so:
> > 
> > unsupported flags DT_FLAGS_1=0x81
> > 07-17 11:08:49.435 13025 13105 W linker  :
> > /data/data/org.subsurfacedivelog.mobile/qt-reserved-files/qml/QtQuick.2/l
> > ibqtquick2plugin.so:
> > 
> > is missing DT_SONAME will use basename as a replacement:
> > "libqtquick2plugin.so"
> > 07-17 11:08:49.445 13025 13105 W linker  :
> > /data/data/org.subsurfacedivelog.mobile/qt-reserved-files/qml/QtQuick/Con
> > trols/libqtquickcontrolsplugin.so:
> > 
> > unused DT entry: type 0x1d arg 0x41f5
> > 07-17 11:08:49.445 13025 13105 W linker  :
> > /data/data/org.subsurfacedivelog.mobile/qt-reserved-files/qml/QtQuick/Con
> > trols/libqtquickcontrolsplugin.so:
> > 
> > unsupported flags DT_FLAGS_1=0x81
> > 07-17 11:08:49.445 13025 13105 W linker  :
> > /data/data/org.subsurfacedivelog.mobile/qt-reserved-files/qml/QtQuick/Con
> > trols/libqtquickcontrolsplugin.so:
> > 
> > is missing DT_SONAME will use basename as a replacement:
> > "libqtquickcontrolsplugin.so"
> > 07-17 11:08:49.455 13025 13105 W linker  :
> > /data/data/org.subsurfacedivelog.mobile/qt-reserved-files/qml/QtQuick/Win
> > dow.2/libwindowplugin.so:
> > 
> > unused DT entry: type 0x1d arg 0x493
> > 07-17 11:08:49.455 13025 13105 W linker  :
> > /data/data/org.subsurfacedivelog.mobile/qt-reserved-files/qml/QtQuick/Win
> > dow.2/libwindowplugin.so:
> > 
> > unsupported flags DT_FLAGS_1=0x81
> > 07-17 11:08:49.455 13025 13105 W linker  :
> > /data/data/org.subsurfacedivelog.mobile/qt-reserved-files/qml/QtQuick/Win
> > dow.2/libwindowplugin.so:
> > 
> > is missing DT_SONAME will use basename as a replacement:
> > "libwindowplugin.so"
> > 07-17 11:08:49.455 13025 13105 W linker  :
> > /data/data/org.subsurfacedivelog.mobile/qt-reserved-files/qml/QtQuick/Dia
> > logs/libdialogplugin.so:
> > 
> > unused DT entry: type 0x1d arg 0x249b
> > 07-17 11:08:49.455 13025 13105 W linker  :
> > /data/data/org.subsurfacedivelog.mobile/qt-reserved-files/qml/QtQuick/Dia
> > logs/libdialogplugin.so:
> > 
> > unsupported flags DT_FLAGS_1=0x81
> > 07-17 11:08:49.455 13025 13105 W linker  :
> > /data/data/org.subsurfacedivelog.mobile/qt-reserved-files/qml/QtQuick/Dia
> > logs/libdialogplugin.so:
> > 
> > is missing DT_SONAME will use basename as a replacement:
> > "libdialogplugin.so"
> > 07-17 11:08:49.465 13025 13105 W linker  :
> > /data/data/org.subsurfacedivelog.mobile/qt-reserved-files/qml/QtQuick/Lay
> > outs/libqquicklayoutsplugin.so:
> > 
> > unused DT entry: type 0x1d arg 0x1b00
> > 07-17 11:08:49.465 13025 13105 W linker  :
> > /data/data/org.subsurfacedivelog.mobile/qt-reserved-files/qml/QtQuick/Lay
> > outs/libqquicklayoutsplugin.so:
> > 
> > unsupported flags DT_FLAGS_1=0x81
> > 07-17 11:08:49.465 13025 13105 W linker  :
> > /data/data/org.subsurfacedivelog.mobile/qt-reserved-files/qml/QtQuick/Lay
> > outs/libqquicklayoutsplugin.so:
> > 
> > is missing DT_SONAME will use basename as a replacement:
> > "libqquicklayoutsplugin.so"
> > 07-17 11:08:49.475 13025 13091 W Subsurface: (null):0
> > ((null)):
> > QQmlApplicationEngine failed to load component
> > 07-17 11:08:49.475 13025 13091 W Subsurface: (null):0
> > ((null)):
> > qrc:///qml/main.qml:9 module "org.kde.kirigami" is not
> > installed
> > 07-17 11:08:49.475 13025 13091 W Subsurface:
> > 07-17 11:08:49.855  4145  4145 I ApplicationPackageManager:
> > load=org.subsurfacedivelog.mobile, bg=192-192, dr=192-192
> > 
> > 
> > 
> > 
> > 
> > 
> > _______________________________________________
> > subsurface mailing list
> > [email protected]
> > http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
> 
> Dear Willem,
> 
> now I've tried half of the night to get a running SubSurface
> again on my mobile - and failed. After updating to the
> latest git sources I was able to recreate your problem. I fixed
> 
>   * copying the correct qml files (no success) and then I tried
>   * with the [PATCH] WIP: use kirigami plugin instead of
>     embedding in qrc
>    
> <https://www.mail-archive.com/[email protected]&q
> =subject:%22Re%5C%3A+%5C%5BPATCH%5C%5D+WIP%5C%3A+use+kirigami+plugin+instea
> d+of+embedding+in+qrc%22&o=newest>. The problem here was the dependency
> from ECM which
>     caused problems to build (using Android.cmake).

the last version of the patch iirc used ecm to build the android apk as well, 
instead of the old macro, with that i did a working apk..

alternatively, i had done a different version of the patch, a bit less 
invasive that keeps the apk generation as it was, but builds kirigami in 
static mode, attached.

it still gets built with cmake, but as a static library and its qml files 
embedded in a qrc of said library.

can you thry this version as well? perhaps is more manageable (also for an 
eventual future resuming of iOS version)


-- 
Marco Martin
From 2a49e1e5fe7f4525bda6bf26326ea66a4cf3f3eb Mon Sep 17 00:00:00 2001
From: Marco Martin <[email protected]>
Date: Wed, 22 Jun 2016 18:17:25 +0200
Subject: [PATCH] use kirigami built in static mode

now kirigami needs to be built from a C++ plugin.
in cases of mobile operating systems such as iOS
(and in a lesser measuse, Android) having a proper plugin
loaded at runtime may be difficult, so statically link it
together with all of its qml files compiled as a qresource
inside the static library.

Signed-off-by: Marco Martin <[email protected]>
---
 CMakeLists.txt                          |  4 +++
 mobile-widgets/qml/mobile-resources.qrc | 58 ++++++++-------------------------
 packaging/android/build.sh              |  7 ++++
 scripts/build.sh                        | 10 ++++++
 scripts/mobilecomponents.sh             |  7 ++--
 subsurface-mobile-helper.cpp            |  5 +++
 6 files changed, 41 insertions(+), 50 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index cc7db13..36665f2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -235,12 +235,16 @@ if(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "MobileExecutable")
 	else()
 		add_executable(${SUBSURFACE_TARGET} MACOSX_BUNDLE WIN32 ${SUBSURFACE_PKG} ${MOBILE_SRC} ${SUBSURFACE_RESOURCES} ${MOBILE_RESOURCES})
 	endif()
+    ADD_LIBRARY(kirigami_static_library STATIC IMPORTED)
+    SET_TARGET_PROPERTIES(kirigami_static_library PROPERTIES
+        IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/mobile-widgets/qml/kirigami/build/src/libkirigamiplugin.a)
 	target_link_libraries(
 		${SUBSURFACE_TARGET}
 		subsurface_profile
 		subsurface_models
 		subsurface_corelib
 		${SUBSURFACE_LINK_LIBRARIES}
+		kirigami_static_library
 	)
 elseif(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "DesktopExecutable")
 	set(SUBSURFACE_APP
diff --git a/mobile-widgets/qml/mobile-resources.qrc b/mobile-widgets/qml/mobile-resources.qrc
index 6983533..b95ce41 100644
--- a/mobile-widgets/qml/mobile-resources.qrc
+++ b/mobile-widgets/qml/mobile-resources.qrc
@@ -23,50 +23,18 @@
 		<file alias="menu-back.png">icons/menu-back.png</file>
 		<file alias="nocloud.svg">icons/nocloud.svg</file>
 	</qresource>
-	<qresource prefix="/imports">
-		<file alias="org/kde/kirigami/qmldir">kirigami/qmldir</file>
-		<file alias="org/kde/kirigami/Action.qml">kirigami/Action.qml</file>
-		<file alias="org/kde/kirigami/ApplicationWindow.qml">kirigami/ApplicationWindow.qml</file>
-		<file alias="org/kde/kirigami/BasicListItem.qml">kirigami/BasicListItem.qml</file>
-		<file alias="org/kde/kirigami/GlobalDrawer.qml">kirigami/GlobalDrawer.qml</file>
-		<file alias="org/kde/kirigami/ContextDrawer.qml">kirigami/ContextDrawer.qml</file>
-		<file alias="org/kde/kirigami/Page.qml">kirigami/Page.qml</file>
-		<file alias="org/kde/kirigami/ScrollablePage.qml">kirigami/ScrollablePage.qml</file>
-		<file alias="org/kde/kirigami/Icon.qml">kirigami/Icon.qml</file>
-		<file alias="org/kde/kirigami/Heading.qml">kirigami/Heading.qml</file>
-		<file alias="org/kde/kirigami/OverlaySheet.qml">kirigami/OverlaySheet.qml</file>
-		<file alias="org/kde/kirigami/ApplicationHeader.qml">kirigami/ApplicationHeader.qml</file>
-		<file alias="org/kde/kirigami/AbstractApplicationHeader.qml">kirigami/AbstractApplicationHeader.qml</file>
-		<file alias="org/kde/kirigami/AbstractApplicationWindow.qml">kirigami/AbstractApplicationWindow.qml</file>
-		<file alias="org/kde/kirigami/private/PageRow.qml">kirigami/private/PageRow.qml</file>
-		<file alias="org/kde/kirigami/Label.qml">kirigami/Label.qml</file>
-		<file alias="org/kde/kirigami/AbstractListItem.qml">kirigami/AbstractListItem.qml</file>
-		<file alias="org/kde/kirigami/SwipeListItem.qml">kirigami/SwipeListItem.qml</file>
-		<file alias="org/kde/kirigami/OverlayDrawer.qml">kirigami/OverlayDrawer.qml</file>
-		<file alias="org/kde/kirigami/Theme.qml">kirigami/Theme.qml</file>
-		<file alias="org/kde/kirigami/Units.qml">kirigami/Units.qml</file>
-		<file alias="org/kde/kirigami/private/AbstractDrawer.qml">kirigami/private/AbstractDrawer.qml</file>
-		<file alias="org/kde/kirigami/private/ActionButton.qml">kirigami/private/ActionButton.qml</file>
-		<file alias="org/kde/kirigami/private/BackButton.qml">kirigami/private/BackButton.qml</file>
-		<file alias="org/kde/kirigami/private/ContextIcon.qml">kirigami/private/ContextIcon.qml</file>
-		<file alias="org/kde/kirigami/private/CornerShadow.qml">kirigami/private/CornerShadow.qml</file>
-		<file alias="org/kde/kirigami/private/DefaultListItemBackground.qml">kirigami/private/DefaultListItemBackground.qml</file>
-		<file alias="org/kde/kirigami/private/EdgeShadow.qml">kirigami/private/EdgeShadow.qml</file>
-		<file alias="org/kde/kirigami/private/MenuIcon.qml">kirigami/private/MenuIcon.qml</file>
-		<file alias="org/kde/kirigami/private/PageActionPropertyGroup.qml">kirigami/private/PageActionPropertyGroup.qml</file>
-		<file alias="org/kde/kirigami/private/PassiveNotification.qml">kirigami/private/PassiveNotification.qml</file>
-		<file alias="org/kde/kirigami/private/RefreshableScrollView.qml">kirigami/private/RefreshableScrollView.qml</file>
-		<file alias="org/kde/kirigami/icons/go-next.svg">kirigami/icons/go-next.svg</file>
-		<file alias="org/kde/kirigami/icons/go-previous.svg">kirigami/icons/go-previous.svg</file>
-		<file alias="org/kde/kirigami/icons/handle-left.svg">kirigami/icons/handle-left.svg</file>
-		<file alias="org/kde/kirigami/icons/distribute-horizontal-x.svg">kirigami/icons/distribute-horizontal-x.svg</file>
-		<file alias="org/kde/kirigami/icons/document-edit.svg">kirigami/icons/document-edit.svg</file>
-		<file alias="org/kde/kirigami/icons/document-save.svg">kirigami/icons/document-save.svg</file>
-		<file alias="org/kde/kirigami/icons/view-readermode.svg">kirigami/icons/view-readermode.svg</file>
-		<file alias="org/kde/kirigami/icons/dialog-cancel.svg">kirigami/icons/dialog-cancel.svg</file>
-		<file alias="org/kde/kirigami/icons/application-menu.svg">kirigami/icons/application-menu.svg</file>
-		<file alias="org/kde/kirigami/icons/gps.svg">kirigami/icons/gps.svg</file>
-		<file alias="org/kde/kirigami/icons/trash-empty.svg">kirigami/icons/trash-empty.svg</file>
-		<file alias="org/kde/kirigami/icons/list-add.svg">kirigami/icons/list-add.svg</file>
+	<qresource prefix="/">
+		<file alias="icons/go-next.svg">kirigami/icons/go-next.svg</file>
+		<file alias="icons/go-previous.svg">kirigami/icons/go-previous.svg</file>
+		<file alias="icons/handle-left.svg">kirigami/icons/handle-left.svg</file>
+		<file alias="icons/distribute-horizontal-x.svg">kirigami/icons/distribute-horizontal-x.svg</file>
+		<file alias="icons/document-edit.svg">kirigami/icons/document-edit.svg</file>
+		<file alias="icons/document-save.svg">kirigami/icons/document-save.svg</file>
+		<file alias="icons/view-readermode.svg">kirigami/icons/view-readermode.svg</file>
+		<file alias="icons/dialog-cancel.svg">kirigami/icons/dialog-cancel.svg</file>
+		<file alias="icons/application-menu.svg">kirigami/icons/application-menu.svg</file>
+		<file alias="icons/gps.svg">kirigami/icons/gps.svg</file>
+		<file alias="icons/trash-empty.svg">kirigami/icons/trash-empty.svg</file>
+		<file alias="icons/list-add.svg">kirigami/icons/list-add.svg</file>
 	</qresource>
 </RCC>
diff --git a/packaging/android/build.sh b/packaging/android/build.sh
index 3b796b8..bc727de 100644
--- a/packaging/android/build.sh
+++ b/packaging/android/build.sh
@@ -312,6 +312,13 @@ if [ "$SUBSURFACE_MOBILE" = "ON" ] ; then
 	pushd $SUBSURFACE_SOURCE
 	bash ./scripts/mobilecomponents.sh
 	popd
+
+	cd $SUBSURFACE_SOURCE/mobile-widgets/qml/kirigami/
+	mkdir -p build
+	cd build
+	cmake .. -DSTATIC_LIBRARY=ON
+	make -j4
+	make install
 fi
 
 if [ ! -z "$SUBSURFACE_MOBILE" ] ; then
diff --git a/scripts/build.sh b/scripts/build.sh
index 014d2d3..635f1b1 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -211,6 +211,9 @@ if [ "$BUILDGRANTLEE" = "1" ] ; then
 	make install
 fi
 
+
+
+
 # finally, build Subsurface
 
 if [ $PLATFORM = Darwin ] ; then
@@ -229,6 +232,13 @@ for (( i=0 ; i < ${#BUILDS[@]} ; i++ )) ; do
 	if [ "$SUBSURFACE_EXECUTABLE" = "MobileExecutable" ] ; then
 		cd $SRC/subsurface
 		bash ./scripts/mobilecomponents.sh
+
+		cd $SRC/subsurface/mobile-widgets/qml/kirigami/
+		mkdir -p build
+		cd build
+		cmake .. -DSTATIC_LIBRARY=ON
+		make -j4
+		make install
 	fi
 
 	mkdir -p $SRC/subsurface/$BUILDDIR
diff --git a/scripts/mobilecomponents.sh b/scripts/mobilecomponents.sh
index ec1e97f..25f1cc1 100755
--- a/scripts/mobilecomponents.sh
+++ b/scripts/mobilecomponents.sh
@@ -31,6 +31,7 @@ fi
 if [ "$NOPULL" = "" ] ; then
 	pushd kirigami
 	git pull
+	git checkout mart/runtimeTheme
 	popd
 fi
 if [ ! -d breeze-icons ] ; then
@@ -44,16 +45,12 @@ fi
 
 # now copy the components and a couple of icons into plae
 MC=$SRC/subsurface/mobile-widgets/qml/kirigami
-PMMC=kirigami/src/qml
+PMMC=kirigami
 BREEZE=breeze-icons
 
 rm -rf $MC
 mkdir -p $MC/icons
 cp -R $PMMC/* $MC/
-cp $PMMC/../fallbacktheme/*qml $MC/
-
-# fix plugin requirement
-sed -i -e 's/^plugin kirigamiplugin/# plugin kirigamiplugin/' $MC/qmldir
 
 cp $BREEZE/icons/actions/24/dialog-cancel.svg $MC/icons
 cp $BREEZE/icons/actions/24/distribute-horizontal-x.svg $MC/icons
diff --git a/subsurface-mobile-helper.cpp b/subsurface-mobile-helper.cpp
index 2093af9..d038336 100644
--- a/subsurface-mobile-helper.cpp
+++ b/subsurface-mobile-helper.cpp
@@ -21,6 +21,9 @@
 #include "qt-models/gpslistmodel.h"
 #include "mobile-widgets/qmlprofile.h"
 
+#define KIRIGAMI_BUILD_TYPE_STATIC
+#include "mobile-widgets/qml/kirigami/src/kirigamiplugin.h"
+
 QObject *qqWindowObject = NULL;
 
 void init_ui()
@@ -32,7 +35,9 @@ void run_ui()
 {
 	qmlRegisterType<QMLManager>("org.subsurfacedivelog.mobile", 1, 0, "QMLManager");
 	qmlRegisterType<QMLProfile>("org.subsurfacedivelog.mobile", 1, 0, "QMLProfile");
+
 	QQmlApplicationEngine engine;
+	KirigamiPlugin::getInstance().registerTypes();
 #if __APPLE__
 	// when running the QML UI on a Mac the deployment of the QML Components seems
 	// to fail and the search path for the components is rather odd - simply the
-- 
2.6.2

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to