Commit Graph

124 Commits

Author SHA1 Message Date
Benoit Pierre
97cdacecba kodev: fix run -g (#14257)
Close #14256.
2025-08-30 20:37:32 +02:00
Benoit Pierre
ac03e9cf06 kodev: use LLDB for debugging on macOS (#14072) 2025-07-20 16:09:24 +02:00
Benoit Pierre
ce8d338d94 kodev: update activate command
There's no need for messing with the LUA environment using luarocks
anymore, since all testing requirements are already provided by the
build system, and luacheck can be run with a different LUA version
than the one being checked.
2025-06-14 21:18:19 +02:00
Noa Himesaka
15995650e9 Add reMarkable Paper Pro support (#13620) 2025-04-21 13:39:44 +02:00
Benoit Pierre
604e5f3019 kodev: tweak test command (#12864)
Support `./kodev test TESTNAME`, as syntactic sugar for `./kodev test all TESTNAME`.
2024-12-07 13:27:02 +01:00
Benoit Pierre
ea5d424868 tests: use new runner 2024-11-25 22:55:57 +01:00
NiLuJe
a6584e312d Add kobov4 & kobov5 targets
kobov4 exists solely because there's a dedicated TC for it,
but we don't distribute binaries for it (it doesn't differ enough from
kobo, and experience has taught us that this kind of split was not a
great idea (e.g., kindle5 vs. kindlepw2)).

kobov5 targets a massively updated userland, and requires further
changes, including to the delivery mechanism, so it very much warrants a
dedicated package (re: #12401)
2024-10-01 23:26:03 +02:00
Benoit Pierre
6e7b09cd3c kodev: fix ./kodev run android… (#12407)
Need to install the NDK / SDK when not configured.

Close #12404.
2024-08-26 15:35:39 +02:00
Benoit Pierre
070d591483 kodev: improve kodev prompt
Automatically use rlwrap if available.
2024-08-26 13:06:46 +02:00
Benoit Pierre
6e7ccf2320 android: add custom adb logcat formatter (#12385)
- standalone: no other dependencies than Python (>= 3.7) and adb
  (Android >= 4.3 [Jelly Bean])
- filter KOReader's traces, and other processes chatter about KOReader
  (e.g. mentions of its application ID or PID)
- show time, PID, TID (when different), tag, priority, and message
- only parse the log (don't rely on `adb shell` commands)
- can be used as a filter, including on its own (uncolored) output
- we can simplify instructions to users when asking for detailed logs

Why not use pidcat?
- project is unmaintained
- does not support Python 3 (need at least one extra patch)
- mangle long lines by wrapping them, even when not outputting to a terminal,
  which is a big no-no, IMHO (as it break searching, copy pasting, etc…)
2024-08-25 23:41:25 +02:00
Benoit Pierre
f586613f94 kodev: rewrite most of it
Factorize (options handling, target setup, …), add explicit
Android targets (`android-arm`, `android-arm64`, etc…).

build:
- support `--no-build` / `-b`: only run setup phase

check: simplify implementation (re-use `.ci/check.sh`)

cov & test:
- forward to makefile rules (no need to guess install directory)
- support `--no-build` / `-b`: use existing build

log:
- drop the target argument (since only Android is supported anyway)

prompt & wbuilder:
- forward to makefile rules (no need to guess install directory)
- support `--no-build` / `-b`: use existing build

release:
- support `--no-build` / `-b`: use existing build

run:
- forward to makefile rules (no need to guess install directory)
- correctly support relative arguments, and whitespace in arguments
- drop support for catchsegv: Glibc 2.35 (2022) dropped catchsegv and
  associated `libSegFault.so` shared library
- drop support for nemiver debugger: project is dead, last release
  was 8 years ago, repo is archived, and package has been dropped
  from newer Debian / Ubuntu releases
- support running an APK passed as argument when using `android` target
- rename short `-d`, `-h`, and `-w` options to `-D`, `-H` and `-W`
  respectively (to avoid conflicts with standard options)
- drop support for `-p` / `--graph` argument: code moved to a dedicated
  wrapper script (`tools/graph_memory.sh`) that can be used with the new
  `-w` / `--wrap` argument: `./kodev run -w tools/graph_memory.sh …`
- drop `--tui` argument when using GDB: said TUI does not cohabit well
  with KOReader console outputs (and cgdb is better fancy TUI anyway)
2024-08-15 09:37:49 +02:00
Benoit Pierre
9c70a3d6a9 kodev: error out if bash is too old 2024-08-15 09:37:49 +02:00
Benoit Pierre
bd4a651fbf make: improve android update
- out-of-tree luajit-launcher build: no leftovers after `make clean`
- use the luajit library compiled by base: no point wasting time
  building a second (different, possibly incompatible) version
2024-08-10 23:34:17 +02:00
Benoit Pierre
088ae7d4ee lint: fix issues reported by newer shellcheck / shfmt 2024-06-15 23:02:52 +02:00
Marek Veselý
ab2f545075 Add kindlehf target (#11986)
for kindles after fw 5.16.3

* Add kindlehf mk file
* Update kodev to support kindlehf
* Update OTAManager logic to support kindlehf
2024-06-11 18:34:03 +02:00
Benoit Pierre
4c6919ac2a bump base: update tesseract, leptonica and libk2pdfopt
- update leptonica to 1.84.1
- update tesseract to 5.3.4
- update libk2pdfopt to 2.55
2024-06-01 09:56:36 +02:00
Benoit Pierre
5a465f413b tweaks for new build system
- forward unknown make targets to base
- add `cmake` and `staging` directories to ignored output artifacts
- drop `package.path` and `package.cpath` luarocks specific entries
2024-05-29 22:02:06 +02:00
Martín Fernández
2c6808ba78 Add generic Linux package (#9351)
Relates to https://github.com/koreader/koreader/issues/9268
Requires https://github.com/koreader/koreader-base/pull/1504

Usage: 
- `kodev release linux` for native package (same arch as host)
- `LINUX_ARCH=arm release linux` for armhf on a x86_64 host.
- `LINUX_ARCH=arm64 release linux` for arm64 on a x86_64 host.

It produces a `koreader-linux-$ARCH-$VERSION.tar.xz` archive, where $ARCH follows `uname -m` convention {x86_64, armv7l, aarch64}

To generate the debian package from the generic archive the following command is required

`./platform/linux/do_debian_package.sh path_to.tar.xz`
2024-05-13 12:11:11 +02:00
NiLuJe
17bdd56e02 Never export LD_LIBRARY_PATH
It's been made redundant by the RPATH changes

The only platform that gets the dubious honor of actually needing an
LD_LIBRARY_PATH is PocketBook, because of InkView.

Co-authored-by: Benoit Pierre <benoit.pierre@gmail.com>

Bump base to pull in the aforementioned RPATH changes ;).

https://github.com/koreader/koreader-base/pull/1638
2023-07-18 02:11:25 +02:00
Benoit Pierre
3ac8a67c6d android: update to use NDK 23c 2023-07-10 22:46:53 +02:00
Benoit Pierre
7e98241b7e kodev: add dlopen traces to android logcat 2023-07-10 22:46:53 +02:00
NiLuJe
38727d882b kodev: Catch TAG_SURFACE in the debug logcat filter (#10431) 2023-05-13 20:39:11 +02:00
yparitcher
a52a4158a9 Android: improve kodev run (#10418)
launch & uninstall the correct version

do not rely on setup_env

When paired with wireless debugging, this makes android debugging not such a pain.
2023-05-10 23:56:57 +02:00
yparitcher
b5fda00a8b kodev check: enforce default submodule.recurse=false for shellcheck & shfmt on submodules (#10362)
Otherwise results might be unexpected for people who set submodule.recurse to true

Regression of sorts since #10344
2023-04-27 15:45:28 +02:00
zwim
60849aed12 kodev: don't check shfm, same as in #8636 (#10344) 2023-04-19 21:08:06 +02:00
yparitcher
3452462fa7 Make kodev check feature complete (#8682) 2023-04-02 21:00:45 +02:00
yparitcher
731b802a0e kodev: fix grep: warning: stray \ before - (#10071)
New warning in 3.8.
2023-02-03 13:45:23 +01:00
NiLuJe
54fae2987e Support Android AArch64 (#9645)
c.f., https://github.com/koreader/koreader-base/pull/1540 & https://github.com/koreader/android-luajit-launcher/pull/390
2022-10-25 01:54:18 +02:00
Martín Fernández
9f097da4f0 Bump android backend (#7813)
* Bumps the target Sdk to Android 11 (API30)
* Add a crash handler
2021-06-07 17:13:34 +02:00
yparitcher
dc964f3941 reader.lua: rework file/directory argument handling. (#7053)
platform: do not pass a directory on the command line.
The home directory will be properly set by Device.home_dir.

It was sometimes crashing when opened with no args.

Fixes: #7049
2021-01-07 20:38:10 +01:00
NiLuJe
5756f1f43e LuaJIT on Android fixes (#7094)
* Don't flag Android as should_restrict_JIT

And allow disabling the C blitter, to put the workaround to the test...

* Add a -d, --debug flag to the log function

Catches KOReader's debug, as well as (our) dlopen & luajit logging

* Bump android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/283
https://github.com/koreader/android-luajit-launcher/pull/282

* Bump base

(https://github.com/koreader/koreader-base/pull/1279)
2021-01-02 03:00:39 +01:00
NiLuJe
7bc8ed87d0 kodev: Avoid catchsegv via -S, --no-catchsegv (#7044)
This works around #7036 on my end (so far).

* Turns out we can actually ask os.exit to close the Lua state, wheee!
Thanks @Frenzie ;).
2020-12-25 00:38:31 +01:00
NiLuJe
04a980649f kodev: Use getopt instead of a hand-rolled hack (#6980)
* Update log android to match the current issue template
* Fix GUI gdb frontends getting wrecked by the older glib library we ship w/
KOReader
* Slightly more aggressive valgrind defaults
  It's slower, but interpreting results without leak-check=full ends up
  costing more time than just running with it.
* Add a callgrind shortcut
* Use getopt instead of a hand-rolled hack for option parsing
* Make it clearer that complex args should be quoted
* Document prompt
* Add a Valgrind suppression file for libdrm/mesa on AMD hardware
  Because mesa/libdrm isn't built w/ -D valgrind=enabled on Gentoo,
  and Valgrind is very much not happy with mesa ;p.
* Allow toggling reader.lua's sane return mode
  (Enabled automatically under gdb/valgrind).
  Should hopefully weed out some noise from valgrind reports.
* Propagate reader.lua's return code
* Sim a few other common devices
* Handle assigning values to short options with an equal instead of a space, like the previous solution
  (This is purely for backward compatibility purposes, this is a syntax that'd fail with the C getopt, too).
* Add gnu-getopt to the build requirement on macOS, because of course everything is terrible.
2020-12-18 18:26:32 +01:00
Martín Fernández
3142f98e20 add target: debian-arm64 (#6909) 2020-12-11 23:22:00 +01:00
NiLuJe
77314e48c4 kodev: Make the directory finding code work as intended (probably?) (#6935)
It was blowing up when it found multiple matches.

* Pick the most recent one in case of multiples
2020-12-02 17:44:59 +01:00
Martín Fernández
1adea4a497 Add macOS target
Co-authored-by: Jason Benwell <jbenwell@hotmail.com>
2020-07-11 01:29:49 +02:00
Frans de Jonge
8a61e70fad [fix] Bring kodev cov command in line with kodev test (#6341) 2020-07-02 11:45:12 +02:00
NiLuJe
12e54a17b3 Get rid of the old PB TC (#5860) 2020-02-15 23:49:04 +01:00
Martín Fernández
67627ce2d9 Remarkable port (#5828)
Touchscreen is mirrored in X & Y and has a different resolution from the eink panel.

Uses systemd for time/date/suspend/poweroff/reboot
Two systemd units for platform integration. button-listen is a very
simple launcher.
to-do: add support for wifi by implementing  a wpa supplicant dbus client.

Authored-by: Thomas Spurden <tcrs@users.noreply.github.com>
2020-02-08 01:58:10 +01:00
Frans de Jonge
668eee97fa [CI] Add curly braces check (#5809)
Update shellcheck and shfmt to the latest version.

Fixes <https://github.com/koreader/koreader/issues/5152>.

Btw, you can apply shellcheck suggestions with a command like:

```
shellcheck --include=SC2250 -f diff *.sh | git apply
```
2020-02-02 20:35:21 +01:00
yparitcher
0f896765c3 transifex -> weblate fixes (#5722) 2020-01-01 21:18:09 +01:00
Frans de Jonge
afd277901a [fix] Prevent double library loads (#5607)
As per @NiLuJe's suggestions from <https://github.com/koreader/koreader/pull/5598#issuecomment-554767891>.

I'm not super happy with this but being able to easily run the emulator is the most important thing.
2019-11-18 15:24:44 +01:00
Frans de Jonge
c7079c80be [fix] kodev: Allow nightly build to succeed (#5507)
Translations live in a submodule since <https://github.com/koreader/koreader/pull/5506>,
and without initialized submodules `kodev release` will therefore fail.

The specifics need a fair bit more attention once Weblate has been set up, but this should
suffice for the nightly/stable build to succeed.
2019-10-19 17:45:49 +02:00
Martín Fernández
4910dbc6d2 android: migrate from lzma to zip file 2019-08-30 16:42:57 +02:00
B YI
53b77e3ae4 [shell] Avoid hard-coded path (#5197)
Although the current hard-coded paths work on debian, they may fail on many other distros. Other distros may pack koreader based on the released deb file. I personally have problem using current script on nixos, as it does not use the paths `/bin/bash` and `/usr/lib/`.
2019-08-11 21:30:35 +02:00
Martín Fernández
64cc7e0827 [Android] update ndk/sdk paths on demand, bump sdk tools.. (#5103) 2019-07-01 09:01:15 +02:00
Frans de Jonge
5690998124 kodev: pass correct --lpath for base test (#4973) 2019-04-27 12:24:42 +02:00
Frans de Jonge
27ddd6f313 [spec] Better insulation (#4972)
Some combination of Travis and/or older Busted necessitated insufficient insulation.

Follow-up to https://github.com/koreader/koreader/pull/4970

Space condensing carried over; reset at the start of readertoc.
2019-04-25 23:33:47 +02:00
Frans de Jonge
e869041632 [chore] kodev: make kodev test consistent with build & run (#4969) 2019-04-25 17:40:42 +02:00
Qingping Hou
11a38b33f1 kodev: stop test command if build failed 2019-04-24 21:09:23 +02:00