From: Marcus Comstedt Date: Sat, 17 May 2014 10:56:29 +0000 (+0200) Subject: sigrok-cross-android: Adapt PulseView for Qt5 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=0c5c3b895f37d304d23345231b6f810a79fb525f;p=sigrok-util.git sigrok-cross-android: Adapt PulseView for Qt5 --- diff --git a/cross-compile/android/pulseview-cpp.patch b/cross-compile/android/pulseview-cpp.patch index 1405704..5acdf36 100644 --- a/cross-compile/android/pulseview-cpp.patch +++ b/cross-compile/android/pulseview-cpp.patch @@ -24,19 +24,6 @@ index 11767a6..b8eed96 100644 target_link_libraries(${PROJECT_NAME} ${PULSEVIEW_LINK_LIBS}) -diff --git a/pv/view/decodetrace.cpp b/pv/view/decodetrace.cpp -index e4f0276..861d25b 100644 ---- a/pv/view/decodetrace.cpp -+++ b/pv/view/decodetrace.cpp -@@ -373,7 +373,7 @@ void DecodeTrace::draw_instant(const pv::data::decode::Annotation &a, QPainter & - { - const QString text = a.annotations().empty() ? - QString() : a.annotations().back(); -- const double w = min(p.boundingRect(QRectF(), 0, text).width(), -+ const double w = min((double)p.boundingRect(QRectF(), 0, text).width(), - 0.0) + h; - const QRectF rect(x - w / 2, y - h / 2, w, h); - diff --git a/main.cpp b/main.cpp index 2c6a59e..79627db 100644 --- a/main.cpp 2014-04-26 23:40:24.253187700 +0200 diff --git a/cross-compile/android/pulseview-java.patch b/cross-compile/android/pulseview-java.patch index 5695614..1495985 100644 --- a/cross-compile/android/pulseview-java.patch +++ b/cross-compile/android/pulseview-java.patch @@ -4,20 +4,39 @@ index 0564a8d..0356f33 100644 +++ b/java/AndroidManifest.xml @@ -1,5 +1,5 @@ -- -+ - - - -@@ -8,7 +8,7 @@ +- ++ + + + +- ++ + + -- -+ + +- ++ + + + +- ++ + +- +- +- ++ ++ ++ - - + + diff --git a/java/res/values/strings.xml b/java/res/values/strings.xml index bd6928f..68f017e 100644 --- a/java/res/values/strings.xml @@ -25,19 +44,32 @@ index bd6928f..68f017e 100644 @@ -1,6 +1,6 @@ -- +- + PulseView + Can\'t find Ministro service.\nThe application can\'t start. This application requires Ministro service. Would you like to install it? - Your application encountered a fatal error and cannot continue. -diff --git a/java/src/org/kde/necessitas/origo/QtActivity.java b/java/src/org/kde/necessitas/origo/QtActivity.java +diff --git a/java/res/values/libs.xml b/java/res/values/libs.xml +--- a/java/res/values/libs.xml 2014-05-17 11:09:29.855631921 +0200 ++++ b/java/res/values/libs.xml 2014-05-17 11:13:04.380841784 +0200 +@@ -13,6 +13,9 @@ + + + ++ Qt5Core ++ Qt5Gui ++ Qt5Widgets + + + +diff --git a/java/src/org/qtproject/qt5/android/bindings/QtActivity.java b/java/src/org/qtproject/qt5/android/bindings/QtActivity.java index 4ebf1f6..f4e3598 100644 ---- a/java/src/org/kde/necessitas/origo/QtActivity.java -+++ b/java/src/org/kde/necessitas/origo/QtActivity.java -@@ -108,6 +108,14 @@ public class QtActivity extends Activity +--- a/java/src/org/qtproject/qt5/android/bindings/QtActivity.java ++++ b/java/src/org/qtproject/qt5/android/bindings/QtActivity.java +@@ -187,6 +187,14 @@ + private void loadApplication(Bundle loaderParams) { - try - { + try { + org.sigrok.androidutils.Environment.initEnvironment( + getApplicationInfo().sourceDir); + System.loadLibrary("gnustl_shared"); @@ -46,9 +78,9 @@ index 4ebf1f6..f4e3598 100644 + new File(getApplicationInfo().nativeLibraryDir), + new File(getFilesDir(), "lib")); + - if (loaderParams.getInt(ERROR_CODE_KEY) != 0) - { // fatal error, show the error and quit - AlertDialog errorDialog = new AlertDialog.Builder(QtActivity.this).create(); + final int errorCode = loaderParams.getInt(ERROR_CODE_KEY); + if (errorCode != 0) { + if (errorCode == INCOMPATIBLE_MINISTRO_VERSION) { diff --git a/java/src/org/sigrok/androidutils/LibWrangler.java b/java/src/org/sigrok/androidutils/LibWrangler.java new file mode 100644 index 0000000..0c9effe diff --git a/cross-compile/android/sigrok-cross-android b/cross-compile/android/sigrok-cross-android index 5e08bda..76e149b 100755 --- a/cross-compile/android/sigrok-cross-android +++ b/cross-compile/android/sigrok-cross-android @@ -316,12 +316,14 @@ cd .. $GIT_CLONE git://sigrok.org/pulseview cd pulseview patch -p1 < ../../pulseview-cpp.patch -cmake $CM -DQT_QMAKE_EXECUTABLE=${PREFIX}/bin/qmake -DANDROID_STL_PATH=${ANDROID_NDK}/sources/cxx-stl . +cmake $CM -DANDROID_STL_PATH=${ANDROID_NDK}/sources/cxx-stl . make $PARALLEL cp -r "$PREFIX"/src/android/java . cp -r libs java/ cd java patch -p2 < ../../../pulseview-java.patch +cp "$PREFIX"/jar/QtAndroid-bundled.jar libs/ +cp "$PREFIX"/jar/QtAndroidAccessibility-bundled.jar libs/ mkdir -p assets READELF=$TOOLCHAIN_TRIPLET-readelf ../../../fix-libraries.sh "$PREFIX/lib" libs/"$TARGET_ARCH" libpulseview.so > assets/liblist.txt cp -r "$PREFIX"/lib/python3.3 assets/