revisions

This commit is contained in:
pls.153 2024-10-26 12:58:15 +02:00
parent dc29ac9084
commit e8866954c0
9 changed files with 120 additions and 44 deletions

View file

@ -47,12 +47,18 @@ win32 {
} }
android { android {
QT += androidextras
DEFINES -= DESKTOP_APP DEFINES -= DESKTOP_APP
INCLUDEPATH = $$ECL/include INCLUDEPATH = $$ECL/include
LIBS = -L$$ECL/lib -lecl LIBS = -L$$ECL/lib -lecl
LIBS += -L../../../platforms/android/lib LIBS += -L../../../platforms/android/lib
equals(QT_MAJOR_VERSION, 6) {
QT += core-private
}
lessThan(QT_MAJOR_VERSION, 6) {
QT += androidextras
}
ANDROID_EXTRA_LIBS += $$ECL/lib/libecl.so ANDROID_EXTRA_LIBS += $$ECL/lib/libecl.so
#ANDROID_PACKAGE_SOURCE_DIR = ../platforms/android #ANDROID_PACKAGE_SOURCE_DIR = ../platforms/android
@ -72,9 +78,31 @@ ios {
} }
32bit { 32bit {
LIBS += -llqml32 -llisp32 android {
equals(QT_MAJOR_VERSION, 6) {
LIBS += -llqml32_armeabi-v7a
}
lessThan(QT_MAJOR_VERSION, 6) {
LIBS += -llqml32
}
}
!android {
LIBS += -llqml32
}
LIBS += -llisp32
} else { } else {
LIBS += -llqml -llisp android {
equals(QT_MAJOR_VERSION, 6) {
LIBS += -llqml_arm64-v8a
}
lessThan(QT_MAJOR_VERSION, 6) {
LIBS += -llqml
}
}
!android {
LIBS += -llqml
}
LIBS += -llisp
} }
LIBS += -Ltmp -lapp LIBS += -Ltmp -lapp

View file

@ -1,3 +1,6 @@
# install/update (keeps app data) # install/update (keeps app data)
adb install -r android-build/*.apk adb install -r android-build/*.apk
# try both
adb shell am start -n org.qtproject.example.app/org.qtproject.qt5.android.bindings.QtActivity # Qt5 adb shell am start -n org.qtproject.example.app/org.qtproject.qt5.android.bindings.QtActivity # Qt5
adb shell am start -n org.qtproject.example.app/org.qtproject.qt.android.bindings.QtActivity # Qt6

View file

@ -54,7 +54,6 @@ win32 {
} }
android { android {
QT += androidextras
DEFINES += NO_TEXT_HANDLES NO_USB DEFINES += NO_TEXT_HANDLES NO_USB
DEFINES -= DESKTOP_APP DEFINES -= DESKTOP_APP
INCLUDEPATH = $$ECL/include INCLUDEPATH = $$ECL/include
@ -65,6 +64,13 @@ android {
LIBS += -lasdf -lecl-help -ldeflate -lecl-cdb -lecl-curl -lql-minitar -lsockets LIBS += -lasdf -lecl-help -ldeflate -lecl-cdb -lecl-curl -lql-minitar -lsockets
LIBS += -L../../../platforms/android/lib LIBS += -L../../../platforms/android/lib
equals(QT_MAJOR_VERSION, 6) {
QT += core-private
}
lessThan(QT_MAJOR_VERSION, 6) {
QT += androidextras
}
ANDROID_MIN_SDK_VERSION = 21 ANDROID_MIN_SDK_VERSION = 21
ANDROID_TARGET_SDK_VERSION = 34 ANDROID_TARGET_SDK_VERSION = 34
ANDROID_EXTRA_LIBS += $$ECL/lib/libecl.so ANDROID_EXTRA_LIBS += $$ECL/lib/libecl.so
@ -108,9 +114,31 @@ ios {
} }
32bit { 32bit {
LIBS += -llqml32 -llisp32 android {
equals(QT_MAJOR_VERSION, 6) {
LIBS += -llqml32_armeabi-v7a
}
lessThan(QT_MAJOR_VERSION, 6) {
LIBS += -llqml32
}
}
!android {
LIBS += -llqml32
}
LIBS += -llisp32
} else { } else {
LIBS += -llqml -llisp android {
equals(QT_MAJOR_VERSION, 6) {
LIBS += -llqml_arm64-v8a
}
lessThan(QT_MAJOR_VERSION, 6) {
LIBS += -llqml
}
}
!android {
LIBS += -llqml
}
LIBS += -llisp
} }
LIBS += -Ltmp -lapp LIBS += -Ltmp -lapp

View file

@ -8,6 +8,7 @@
(defvar *max-x* (* (1- *width*) +w+)) (defvar *max-x* (* (1- *width*) +w+))
(defun move (x-rotation y-rotation) ; called from QML (defun move (x-rotation y-rotation) ; called from QML
(when *ready*
(labels ((add (x) (labels ((add (x)
(truncate (signum x))) (truncate (signum x)))
(to-pos (x) (to-pos (x)
@ -23,21 +24,21 @@
(add-y (add dy))) (add-y (add dy)))
(setf *x* (min *x* *max-x*)) ; don't lose ball (initial x) (setf *x* (min *x* *max-x*)) ; don't lose ball (initial x)
(if (aref *maze* (if (aref *maze*
(+ add-x (to-pos *x*)) (min (1- *width*) (+ add-x (to-pos *x*)))
(to-pos *y*)) (max 0 (to-pos *y*)))
(setf *x* (normalize *x*)) (setf *x* (normalize *x*))
(incf *x* dx)) (incf *x* dx))
(if (aref *maze* (if (aref *maze*
(to-pos *x*) (min (1- *width*) (to-pos *x*))
(+ add-y (to-pos *y*))) (max 0 (+ add-y (to-pos *y*))))
(setf *y* (normalize *y*)) (setf *y* (normalize *y*))
(incf *y* dy)))) (incf *y* dy))))
(move-ball) (move-ball))
(values)) ; no return value to QML (values)) ; no return value to QML
(defun move-ball () (defun move-ball ()
(if (and (= *x* +w+) (if (and (= *x* +w+)
(= *y* 0)) (<= *y* 0))
(new-game) (new-game)
(let ((ball (find-quick-item ui:*ball*))) (let ((ball (find-quick-item ui:*ball*)))
;; 'qset' is faster than 'q>', but can't trigger animations ;; 'qset' is faster than 'q>', but can't trigger animations

View file

@ -8,7 +8,8 @@
(defconstant *width* 25) (defconstant *width* 25)
(defconstant *height* 39) (defconstant *height* 39)
(defvar *maze*) (defvar *maze* nil)
(defvar *ready* t)
(defun carve-maze (x y) (defun carve-maze (x y)
(let ((d (random 4))) (let ((d (random 4)))
@ -33,10 +34,11 @@
(carve-maze x2 y2)))))) (carve-maze x2 y2))))))
(defun generate-maze () (defun generate-maze ()
(let ((*ready* nil))
(set-visible 1 1 nil) (set-visible 1 1 nil)
(carve-maze 1 1) (carve-maze 1 1)
(set-visible 1 0 nil) (set-visible 1 0 nil)
(set-visible (- *width* 1) (- *height* 2) nil)) (set-visible (- *width* 1) (- *height* 2) nil)))
(defun set-visible (x y visible) (defun set-visible (x y visible)
(setf (aref *maze* x y) visible) (setf (aref *maze* x y) visible)

View file

@ -22,15 +22,14 @@ $ devel-su zypper install opt-qt5-qtmultimedia-devel
$ devel-su zypper install opt-qt5-qtquickcontrols2-devel $ devel-su zypper install opt-qt5-qtquickcontrols2-devel
$ devel-su zypper install opt-qt5-qtsensors-devel $ devel-su zypper install opt-qt5-qtsensors-devel
``` ```
In one occasion (opt-qtdeclarative-devel) it will say: If it says:
``` ```
Problem: This request will break your system! Problem: This request will break your system!
nothing provides 'pkgconfig(android-headers)' needed by the to be installed libhybris-devel
``` ```
You can safely ignore this warning, nothing will really break (see below), You can safely ignore those warnings, nothing will really break (see below),
so just choose: so just choose:
``` ```
Solution 3: break libhybris-devel by ignoring some of its dependencies Solution 3: break <name>-devel by ignoring some of its dependencies
``` ```
Now you should be able to build/install the `lqml` executable and library. Now you should be able to build/install the `lqml` executable and library.

View file

@ -33,6 +33,21 @@ $ sshfs defaultuser@192.168.2.15: ~/phone
First try to compile/install ECL (tab 1) just like you would do on the desktop. First try to compile/install ECL (tab 1) just like you would do on the desktop.
You may need to run the following commands before compiling (ensure to be
logged in to your free Jolla account):
```
$ devel-su pkcon refresh
$ devel-su pkcon install zypper
$ devel-su zypper install gcc make
```
You may also needed to edit `ecl-23.9.9/src/gmp/configure`, and replace all
occurrences of `linux*android*)` with `linux-android*)`.
After compiling and installing ECL, add this soft link:
```
$ devel-su ln -s /usr/local/lib/libecl.so.23.9 /usr/lib/libecl.so.23.9
```
Then follow the description Then follow the description
[qt5.15-rpm-installation](platforms/sailfish/qt5.15-installation.md). [qt5.15-rpm-installation](platforms/sailfish/qt5.15-installation.md).

View file

@ -8,7 +8,7 @@ Item {
AnimatedImage { AnimatedImage {
objectName: "busy" objectName: "busy"
anchors.centerIn: parent anchors.centerIn: parent
width: 64 width: 32
height: width height: width
z: 10 z: 10
source: "img/busy.gif" source: "img/busy.gif"