From 7d24aaaceeeba9790a4c405e7456f95de5c5abd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Fern=C3=A1ndez?= Date: Wed, 11 Dec 2024 16:00:07 +0100 Subject: [PATCH 1/4] simplify build instructions, add disclaimer --- Makefile | 8 -------- README.md | 31 ++++++++++++++++--------------- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index 67d3ff7ad..a1ecc9b47 100644 --- a/Makefile +++ b/Makefile @@ -74,14 +74,6 @@ build-luajit: cd jni/luajit && \ ./mk-luajit.sh "$(ANDROID_FULL_ARCH)" -prepare: update - @echo "Building LuaJIT for all supported ABIs" - cd jni/luajit && \ - ./mk-luajit.sh clean && \ - ./mk-luajit.sh x86 && \ - ./mk-luajit.sh clean && \ - ./mk-luajit.sh armeabi-v7a - debug: update build-luajit-debug @echo "Building $(APPNAME) debug APK: Version $(NAME), release $(VERSION), flavor $(FLAVOR)" ./gradlew -q -PversName=$(NAME) -PversCode=$(VERSION) -PprojectName=$(APPNAME) \ diff --git a/README.md b/README.md index fcf7d83d7..d83e39c5e 100644 --- a/README.md +++ b/README.md @@ -19,36 +19,37 @@ Have a look at KOReader's [llapp_main.lua](https://github.com/koreader/koreader/ The real starting point, called from JNI/C, is the run() function in android.lua. It sets up a few things, namely FFI definitions for the Android native API (since it uses that itself for a few things) and some wrapper functions for logging. Also, it registers the "android" module in package.loaded, so you can access it in your own code via require("android"). It also registers a new package loader which can load Lua code from the activity's asset store, so you can use require() for Lua code stored there. -## Starting +## Disclaimer -### Init and update the submodules +This repo is used as glue code to run KOReader on android. -```sh -make update -``` +Usage on its own doesn't make much sense since you're expected to write your own drawing routines in lua! +A standalone example is attached (with no drawing routines!) in case you're curious what you'll get. -### Compile LuaJIT for all target architecture(s) -```sh -make prepare -``` +## Building the example app +### Export `ANDROID_NDK_HOME` -### Compile native code and package APK with gradle +```sh +export ANDROID_NDK_HOME=/path/to/your/ndk/folder +``` -You can see available tasks with +### Build example APK for arm 32 bits ```sh -./gradlew tasks +make example ``` -For example, you can build the debug variant for all supported ABIs with + +### Build example APK for any other arch ```sh -./gradlew assembleDebug +ANDROID_ARCH=MY_ARCH make example ``` -For more examples please look at the Makefile. +where `MY_ARCH` is either `x86`, `x86_64` or `arm64` + ## To-do From 3ebb0a87d152ecb53517a7d9311e186ca0f9315b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Fern=C3=A1ndez?= Date: Wed, 11 Dec 2024 16:00:43 +0100 Subject: [PATCH 2/4] remove TODO list that we won't plan to do --- README.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/README.md b/README.md index d83e39c5e..93cdbec81 100644 --- a/README.md +++ b/README.md @@ -49,11 +49,3 @@ ANDROID_ARCH=MY_ARCH make example ``` where `MY_ARCH` is either `x86`, `x86_64` or `arm64` - - -## To-do - -* a concept to deal with native Lua modules. -* a loader for native modules that have been put into the activity's library directory? -* a loader for obb storage, maybe? We could put native Lua modules there, for example. -* example code for framebuffer access and more From 310d1a65c45651e58ee732ff322f6fa948c2167d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Fern=C3=A1ndez?= <975883+pazos@users.noreply.github.com> Date: Wed, 11 Dec 2024 17:24:21 +0100 Subject: [PATCH 3/4] Update README.md Co-authored-by: Frans de Jonge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 93cdbec81..2d5bfb840 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ The real starting point, called from JNI/C, is the run() function in android.lua ## Disclaimer -This repo is used as glue code to run KOReader on android. +This repo is used as glue code to run KOReader on Android. Usage on its own doesn't make much sense since you're expected to write your own drawing routines in lua! A standalone example is attached (with no drawing routines!) in case you're curious what you'll get. From e1ca1d150d64b14cbb630665033fbd33577c182b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Fern=C3=A1ndez?= <975883+pazos@users.noreply.github.com> Date: Wed, 11 Dec 2024 17:24:28 +0100 Subject: [PATCH 4/4] Update README.md Co-authored-by: Frans de Jonge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2d5bfb840..1156eface 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ The real starting point, called from JNI/C, is the run() function in android.lua This repo is used as glue code to run KOReader on Android. -Usage on its own doesn't make much sense since you're expected to write your own drawing routines in lua! +Usage on its own doesn't make much sense since you're expected to write your own drawing routines in Lua! A standalone example is attached (with no drawing routines!) in case you're curious what you'll get.