Commit Graph
66 Commits
Author SHA1 Message Date
Benoit Pierre d9d5d92234 tools/mkrelease: ensure reproducible modification times 2026-09-20 12:10:45 +02:00
Benoit Pierre fddc52bd38 tools/mkrelease: support an archive as input
If the first pattern is an archive, use its contents as input
(with left-over patterns interpreted relative to said contents).

Useful to convert an archive to another format (complete with support
for filtering-out some files, adding a manifest, or ensuring consistent
modification times).
2026-09-20 12:10:45 +02:00
Benoit Pierre 60eeb416bf tools/mkrelease: supported creating an uncompressed TAR
Real fast, useful for testing.
2026-09-20 12:10:45 +02:00
Benoit Pierre b8a792f011 tools/mkrelease: expand recognized TAR extensions 2026-09-20 12:10:45 +02:00
okaykoaandFrans de Jonge 0f4836ecad Add layout framework for external keyboard text input (#16024)
Fixes #13278.

* Add correct external keyboard punctuation key names
* Compose physical-keyboard text via a layout and TextInput
* Expand to multiple possible layers
* Add XKB conversion script
* Give ourselves some dead key support
* Add license identifier
* Improve AltGr
* Group the layouts together
* And add the common layouts
* Expand with regular US international (with regular non-AltGr dead keys)
* Add some other scripts (that should do it)
* [fix] Avoid rotating up/down in external keyboards along with the device orientation
* Log keyboard layout in case of issues
* Also listen to PrintScr 'cause that's what the thing is for, isn't it

---------

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
2026-09-16 20:33:07 +02:00
Frans de Jonge 21632061d2 Add tools/expand-bump-prs.sh to help with release notes (#15742) 2026-08-01 21:52:38 +02:00
Benoit Pierre bd89284d59 tools/mkrelease: tweak TAR.XZ output for new OTA mechanism
Create one XZ block per TAR entry.
2026-05-28 17:45:14 +02:00
RoadRoller01 ac6d2d3747 Add python to shell.nix (#15296) 2026-04-21 13:53:02 +02:00
Benoit Pierre 9eb45af16e tools/mkrelease: prefer type -P command over which command (#15190)
The former is a bash builtin, the later is an external executable that
may not be installed (e.g. in openSUZE Tumbleweed Docker image).
2026-03-26 19:57:31 +01:00
Benoit Pierre 99619452e8 doc: update optional build requirements (#15141) 2026-03-20 22:00:51 +01:00
Jon Volkmar b23bec3c68 Fix sdl3 lib path in nix shell (#15142) 2026-03-20 21:58:40 +01:00
Benoit Pierre 3f5cd7f77d tools: fix update-metadata (#15132)
Save appstream metadata to new location (Cf. #15116).
2026-03-19 23:08:56 +01:00
Benoit Pierre 6b6ecb5b05 linux: fix metadata to match our flatpak package (#15126)
We're stuck with `rocks.koreader.KOReader` (cf. flathub/rocks.koreader.KOReader#65).
2026-03-18 07:53:04 +01:00
Benoit Pierre a2a9dfe2f7 tools/mkrelease: tweak xz compression parameters
For a generally faster multi-threading compression speed, with only a very minor size increase.
2026-03-15 23:00:26 +01:00
Benoit Pierre 7879e05245 tools/mkrelease: add option to keep links 2026-03-15 23:00:26 +01:00
Benoit Pierre 2f9c0c9009 tools: fix some permissions
Fix lintian warnings: executable-not-elf-or-script.
2026-03-15 23:00:26 +01:00
Benoit Pierre 37cf09b12d sdl: switch to SDL3 (3.4.0) (#14983) 2026-02-15 16:43:29 +01:00
Benoit Pierre d18736fcc4 fix appstream metadata warnings
```
P: rocks.koreader.KOReader:4: cid-contains-uppercase-letter rocks.koreader.KOReader
P: rocks.koreader.KOReader:376: screenshot-no-caption
P: rocks.koreader.KOReader:379: screenshot-no-caption
P: rocks.koreader.KOReader:382: screenshot-no-caption
```
2026-02-10 08:04:24 +01:00
Benoit Pierre 5c3dfb2d88 doc: fix and improve build requirements (#14713)
- gettext is required since the switch to binary translations catalogs
- add shellcheck and shfmt to the optional dependencies for linting
- clarify minimum required and recommended versions
2025-12-12 22:58:05 +01:00
Benoit Pierre dad71c5ca4 tools/logcat: improve handling of input encoding (#14629)
For example, avoid a decoding exception on this line:
```
20:58:28.534 14160            reader.launche  F  thread.cc:1326] Check failed: FindStackTop() > reinterpret_cast<void*>(tlsPtr_.stack_end) (FindStackTop()=X���`���X���, reinterpret_cast<void*>(tlsPtr_.stack_end)=0xbe10c000)
```
2025-11-15 22:56:56 +01:00
Benoit Pierre b86f21ac03 tools/mkrelease: tweak default compression levels
Use maximum compression levels (while avoiding ZSTD ultra levels).
2025-10-26 16:14:17 +01:00
Benoit Pierre 5a598c5712 tools/mkrelease: minor optimization
Reduce the size of terminating empty blocks when creating a TAR.
2025-10-26 16:14:17 +01:00
Benoit Pierre e18ea6c821 tools/mkrelease: don't include directories themselves
They are no case of empty directory we would need to keep.
2025-10-26 16:14:17 +01:00
Benoit Pierre e39db36954 tools/mkrelease: handle corner case (#14369)
7z shows an empty CRC for empty files when generating an archive manifest:
```
▸ mkdir dir
▸ touch dir/empty
▸ echo foobar >dir/foobar
▸ 7z a test.7z dir
[…]

▸ 7z -ba h dir
                        dir
B22C9747             7  dir/foobar
00000000             0  dir/empty

▸ 7z -ba -slt l test.7z
Path = dir
Size = 0
Packed Size = 0
Modified = 2025-09-27 22:55:25.7947183
Attributes = D drwxr-xr-x
CRC =
Encrypted = -
Method =
Block =

Path = dir/empty
Size = 0
Packed Size = 0
Modified = 2025-09-27 22:43:34.0722990
Attributes = A -rw-r--r--
CRC =
Encrypted = -
Method =
Block =

Path = dir/foobar
Size = 7
Packed Size = 11
Modified = 2025-09-27 22:55:25.7947183
Attributes = A -rw-r--r--
CRC = B22C9747
Encrypted = -
Method = LZMA2:12
Block = 0
```
2025-09-28 00:30:18 +02:00
Frans de Jonge 14fa4bf43f Add DjVu getPageTextBoxes bench 2025-09-27 12:48:02 +02:00
MartV0 af50d71113 Added shell.nix and updated Building.md (#14019) 2025-09-14 17:13:02 +02:00
Benoit Pierre 9017bccaba tools/mkrelease: fix shellcheck 0.11.0 false positive (#14169) 2025-08-15 10:25:37 +02:00
Benoit Pierre 9b3cf826cc tools/mkrelease: tweak tar command
Add `--numeric-owner` for a very minor size reduction.
2025-06-24 20:22:23 +02:00
Benoit Pierre 2f8f95a2d6 tools/mkrelease: fix ZSTD compressed TAR format extension (#13887) 2025-05-30 12:23:26 +02:00
Benoit Pierre 14ddbbfcd3 tools/mkrelease: fix bug in AWK helpers (#13847)
macos / macOS 13 x86-64 🔨15.2 🎯10.15 (push) Has been cancelled
macos / macOS 14 ARM64 🔨15.4 🎯11.0 (push) Has been cancelled
The manifest entry for `koreader/frontend/socketutil.lua` is wrong:
```
koreader/frontend/socketutil.lua/
```
That's because the CRC for that file (0E376639) compare as a false value
when used conditionally with `if (0E376639)`. The correct way to check
for an empty string is to use: `if (0E376639 != "")`.

NOTE: no impact that I could see on the actual generated archive, e.g.
for kindlepw2: the file is still included.
2025-05-24 00:35:09 +02:00
Benoit Pierre ea5d424868 tests: use new runner 2024-11-25 22:55:57 +01:00
Benoit Pierre c04023f1d1 make: factorize code for generating release updates (#12655)
Instead of splitting remove / exclusion of unwanted files in 2-3 places
(`all` rule, `update` rule, and update script in some cases), install
the same files in debug & release builds, and exclude unwanted stuff
when generating the update.

This should finally fix the CI issue with OCR tests (since we don't
remove the `data/dict` & `data/tessdata` directories on release build
anymore).
2024-11-23 20:48:37 +01:00
mergen3107 f8446538c0 Fix KOReader spelling in the code (#12670) 2024-10-24 10:46:46 +02:00
Benoit Pierre 238f0c0896 wbuilder: fix environment (#12665)
Use `setupkoenv` to setup LUA paths and ensure `ffi.loadlib` is loaded.
2024-10-21 08:44:14 +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
hius07 f0c9a642d1 ReaderStatus, Book status widget: cleanup (#12343) 2024-08-19 08:05:19 +03: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
Frans de Jonge 75d3e4c2dc [minor] Fix lowercase typo in "Google Translate" (#12157) 2024-07-11 22:53:23 +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 3fb2f18041 update tool to generate metadata translations (#11869)
* updated:

    - strings to translate
    - english metadata

* added:

    - appstream: metadata generator
    - appstream: translation of screenshot captions, if they're present.
    - appstream: link to gh release notes
2024-05-26 20:10:12 +02:00
Benoit Pierre a4400b3ccb tools/mk7z: support debian unstable / ubuntu 22.04
The version of `7z` provided by `p7zip-full` is now the same as `7zip`:

- symlinks are dereferenced by default (no support for `-l`)
- `7z -ba h` appends a trailing `/` to directories
  (not present in the output of `7z -slt l`)
2024-05-12 09:47:44 +02:00
Benoit Pierre 2d4b12c99c tools/mk7z: tweak manifest handling code
To support mawk (default awk on debian unstable).
2024-05-12 09:47:44 +02:00
Benoit Pierre e921ed1bc7 tools/mk7z: fix subtle bug in manifest handling
A string like `1E2` is interpreted as `100` (`1×10²`):

```bash
▹ echo 0E036904 | awk '{ if ($1) print $1 }'
▹ echo 0E036904 | awk '{ if ($1!="") print $1 }'
0E036904
```
2024-05-12 09:47:44 +02:00
NiLuJe 90ae4acca6 Chore: Review FrameContainer constructors for shared dimen objects
Nothing else seems problematic, this is mostly just cosmetic sanitization
around Geom objects.
2024-01-19 00:08:10 +01:00
hius07 1ef7821b66 getProps: centralize 2 (#10837)
Centralize and optimize handling document properties.
2023-08-30 07:53:59 +03:00
Benoit Pierre ded5558b88 android: speed up development cycle
Don't recreate `assets.7z` from scratch every time, and also
ensure it's reproducible to avoid busting gradle's cache.
2023-07-10 22:46:53 +02:00
Alexander Schlemmer 849687f2d0 [fix] kodev wbuilder crashes with "attempt to index global 'G_defaults' (a nil value)" (#10088)
Fixes #10084.
2023-02-07 09:08:28 +01:00
NiLuJe b523c2e8b9 InputContainer: Fall cleanup ;).
Get rid of the doc & seqtext fields, as they are not actually used (nor
are they particularly useful, the event handler's name should be pretty
self-explanatory).

Also, tweak the key_events documentation to highlight the quirks of the
API, especially as far as array nesting is involved...

Random drive-by cleanup of the declarations of key_events & ges_events
to re-use the existing instance object (now that we know they're sane
;p) for tables with a single member (less GC pressure).
2022-10-29 22:55:20 +02:00
Martín Fdez 17246f0534 fix update-metadata script 2022-10-23 10:26:20 +02:00
NiLuJe fadee1f5dc Clarify our OOP semantics across the codebase (#9586)
Basically:

* Use `extend` for class definitions
* Use `new` for object instantiations

That includes some minor code cleanups along the way:

* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
  * ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 02:14:48 +02:00