2
0
mirror of https://github.com/koreader/koreader synced 2024-11-10 01:10:34 +00:00
koreader/kodev

776 lines
21 KiB
Plaintext
Raw Normal View History

#!/usr/bin/env bash
2016-02-01 06:43:46 +00:00
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-11 18:58:28 +00:00
set -eo pipefail
2024-08-11 18:58:27 +00:00
if [[ "${BASH_VERSINFO[0]}" -lt 4 ]]; then
echo "incompatible bash version: ${BASH_VERSION}, need >=4.0"
exit 1
fi
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-11 18:58:28 +00:00
# shellcheck disable=2155
declare -r CURDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
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-11 18:58:28 +00:00
unset ANDROID_ARCH CMD HELP KODEBUG TARGET NO_BUILD VERBOSE
# Helpers. {{{
# shellcheck disable=2034
declare -r ANSI_BLUE='\33[34;1m'
# shellcheck disable=2034
declare -r ANSI_RED='\33[31;1m'
declare -r ANSI_RESET='\33[0m'
opt_dry_run=0
opt_timings=0
function info() {
local color=ANSI_BLUE
if [[ "$1" = -c* ]]; then
color="ANSI_${1#-c}"
shift
fi
if [[ -t 2 ]]; then
printf '%b%s%b\n' "${!color}" "$*" "${ANSI_RESET}" 1>&2
else
printf '%s\n' "$*" 1>&2
fi
}
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-11 18:58:28 +00:00
function err() {
info -cRED "$@"
}
2019-08-29 19:59:00 +00:00
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-11 18:58:28 +00:00
function die() {
local code=$?
if [[ $# -ne 0 ]]; then
code="$1"
shift
fi
if [[ $# -ne 0 ]]; then
err "$@"
fi
exit "${code}"
}
2019-03-02 12:28:04 +00:00
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-11 18:58:28 +00:00
function print_quoted() {
if [[ $# -ne 0 ]]; then
printf '%q' "$1"
shift
fi
if [[ $# -ne 0 ]]; then
printf ' %q' "$@"
2016-02-04 07:37:00 +00:00
fi
}
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-11 18:58:28 +00:00
function run() {
info "$(print_quoted "$@")"
if [[ ${opt_dry_run} -ne 0 ]]; then
return
fi
local cmd=("$@")
local code=0
if [[ ${opt_timings} -ne 0 ]]; then
time "${cmd[@]}" || code=$?
else
"${cmd[@]}" || code=$?
fi
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-11 18:58:28 +00:00
return ${code}
}
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-11 18:58:28 +00:00
function run_make() {
local cmd=(make)
if [[ ${opt_dry_run} -ne 0 ]]; then
cmd+=(-n)
fi
if [[ "${CURDIR}" != "${PWD}" ]]; then
cmd+=(-C "${CURDIR}")
fi
if [[ "${TARGET}" == 'android' ]]; then
cmd+=("ANDROID_ARCH=${ANDROID_ARCH}")
fi
for param in TARGET KODEBUG VERBOSE; do
cmd+=("${param}=${!param}")
done
cmd+=("$@")
opt_dry_run=0 run "${cmd[@]}"
}
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-11 18:58:28 +00:00
is_system() {
if ! case "$1" in
Linux) [[ "${OSTYPE}" = linux* ]] ;;
macOS) [[ "${OSTYPE}" = darwin* ]] ;;
Windows) [[ "${OSTYPE}" == 'cygwin' || "${OSTYPE}" == 'msys' ]] ;;
*) false ;;
esac then
die 1 "You need a $1 system to build this package"
fi
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-11 18:58:28 +00:00
}
check_submodules() {
# NOTE: can't use a pipe, or the pipeline may fail
# due to `git submodule status` returning an error
# on `grep -q …` early exit (broken pipe).
if grep -qE '^-' <<<"$(git submodule status)"; then
run_make fetchthirdparty
fi
2016-02-01 06:43:46 +00:00
}
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-11 18:58:28 +00:00
show_help() {
local help="${HELP}"
help="${help#"${help%%[![:space:]]*}"}"
help="${help%"${help##*[![:space:]]}"}"
printf '\n%s\n\n' "${help}"
2016-02-01 06:43:46 +00:00
}
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-11 18:58:28 +00:00
# }}}
# Target setup. {{{.
declare -r TARGETS_HELP_MSG="\
TARGET:
android-arm
android-arm64
android-x86
android-x86_64
appimage
cervantes
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-11 18:58:28 +00:00
emulator Default if no TARGET is given
kindle Compatible with all Kindle models >= Kindle4
kindlehf Compatible with all Kindles with FW >= 5.16.3
kindlepw2 With compiler optimizations for Kindle models >= Paperwhite 2
kindle-legacy Needed only for Kindle2/3/DXG
kobo
linux
macos MacOS app bundle
pocketbook
remarkable
sony-prstux
2016-02-01 06:43:46 +00:00
ubuntu-touch
win32
"
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-11 18:58:28 +00:00
# shellcheck disable=2155
declare -r RELEASE_TARGETS_HELP_MSG="$(sed -e '/^ \(emulator\|win32\)/d' <<<"${TARGETS_HELP_MSG}")"
function setup_target() {
TARGET="$1"
shift 1
local valid=1
case "${TARGET}" in
# Emulator & native targets.
'' | emulator)
if [[ "${CMD}" == 'release' ]]; then
valid=0
fi
TARGET=''
;;
appimage | linux) is_system Linux ;;
macos) is_system macOS ;;
win32) is_system Windows ;;
# Devices.
android-arm | android-arm64 | android-x86 | android-x86_64)
ANDROID_ARCH="${TARGET#android-}"
TARGET='android'
;;
cervantes) ;;
kindle | kindlehf | kindlepw2 | kindle-legacy) ;;
kobo) ;;
pocketbook) ;;
remarkable) ;;
sony-prstux) ;;
ubuntu-touch) ;;
# Invalid.
*)
valid=0
;;
esac
if [[ "${valid}" -eq 0 ]]; then
err "ERROR: unsupported ${CMD} target \"${TARGET}\"."
show_help 1>&2
exit 1
fi
if [[ -z ${KODEBUG+x} && -z "${TARGET}" && "${CMD}" != 'release' ]]; then
# For the emulator, build a debug build by default.
KODEBUG=1
fi
}
2016-02-01 06:43:46 +00:00
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-11 18:58:28 +00:00
# }}}
2016-02-19 17:38:00 +00:00
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-11 18:58:28 +00:00
# Common options handling. {{{
2016-02-19 17:38:00 +00:00
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-11 18:58:28 +00:00
declare -r BUILD_GETOPT_SHORT='bdnv'
declare -r BUILD_GETOPT_LONG='no-build,debug,no-debug,verbose'
2016-02-01 06:43:46 +00:00
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-11 18:58:28 +00:00
declare -r E_OPTERR=85
function build_options_help_msg() {
local section="$1"
local no_build_details="$2"
local debug_details="$3"
local no_debug_details="$4"
printf '%s' "${section}${section:+ }OPTIONS:
2016-02-01 06:43:46 +00:00
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-11 18:58:28 +00:00
${no_build_details:+-b, --no-build do not build (}${no_build_details}${no_build_details:+)
}-d, --debug enable debugging symbols${debug_details:+ (}${debug_details}${debug_details:+)}
-n, --no-debug no debugging symbols${no_debug_details:+ (}${no_debug_details}${no_debug_details:+)}
-v, --verbose make the build system more verbose"
}
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-11 18:58:28 +00:00
function parse_options() {
local short_opts="$1"
local long_opts="$2"
local args_spec="$3"
shift 3
# First things first: check if getopt is a compatible (util-linux like) version.
if getopt -T >/dev/null 2>&1 || [[ $? -ne 4 ]]; then
die 1 "unsupported getopt version: $(getopt --version)"
fi
if ! opt=$(getopt -o "h${short_opts}" --long "help,${long_opts}" --name "kodev" -- "$@"); then
show_help 1>&2
exit ${E_OPTERR}
fi
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-11 18:58:28 +00:00
# echo "opt: $opt"
eval set -- "${opt}"
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-11 18:58:28 +00:00
OPTS=()
ARGS=()
while true; do
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-11 18:58:28 +00:00
case "$1" in
2016-02-19 17:38:00 +00:00
-h | --help)
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-11 18:58:28 +00:00
show_help
exit 0
;;
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-11 18:58:28 +00:00
-b | --no-build)
NO_BUILD=1
;;
-d | --debug)
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-11 18:58:28 +00:00
KODEBUG=1
;;
-n | --no-debug)
KODEBUG=
;;
-v | --verbose)
# shellcheck disable=SC2034
VERBOSE=1
;;
--)
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-11 18:58:28 +00:00
shift
break
;;
2016-02-19 17:38:00 +00:00
*)
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-11 18:58:28 +00:00
OPTS+=("$1")
;;
2016-02-19 17:38:00 +00:00
esac
shift
2016-02-19 17:38:00 +00:00
done
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-11 18:58:28 +00:00
local expected
local valid=0
case "${args_spec}" in
'*') ;;
'+')
expected='1 or more'
[[ $# -ge 1 ]] || valid=1
;;
'?')
expected='1 optional'
[[ $# -le 1 ]] || valid=1
;;
2016-02-01 06:43:46 +00:00
*)
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-11 18:58:28 +00:00
expected="${args_spec}"
[[ $# -eq "${args_spec}" ]] || valid=1
;;
2016-02-01 06:43:46 +00:00
esac
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-11 18:58:28 +00:00
if [[ ${valid} -ne 0 ]]; then
err "ERROR: invalid ${CMD} arguments; ${expected} expected but $# received"
show_help 1>&2
exit ${E_OPTERR}
fi
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-11 18:58:28 +00:00
ARGS=("$@")
# echo "OPTS: ${OPTS[@]} [${#OPTS[@]}]"
# echo "ARGS: ${ARGS[@]} [${#ARGS[@]}]"
}
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-11 18:58:28 +00:00
# }}}
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-11 18:58:28 +00:00
# Command: activate / check / fetch-thirdparty. {{{
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-11 18:58:28 +00:00
function kodev-activate() {
parse_options '' '' '0' "$@"
info "adding ${CURDIR} to \$PATH..."
export PATH="${PATH}:${CURDIR}"
eval "$(luarocks --lua-version=5.1 path --bin)"
exec "${SHELL}"
}
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-11 18:58:28 +00:00
function kodev-check() {
parse_options '' '' '0' "$@"
check_submodules
"${CURDIR}/.ci/check.sh"
2016-02-01 06:43:46 +00:00
}
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-11 18:58:28 +00:00
function kodev-fetch-thirdparty() {
HELP="
USAGE: $0 ${CMD} <OPTIONS>
OPTIONS:
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-11 18:58:28 +00:00
-v, --verbose make the build system more verbose
"
parse_options "v" "verbose" '0' "$@"
run_make fetchthirdparty
}
2016-02-01 06:43:46 +00:00
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-11 18:58:28 +00:00
# }}}
2016-02-01 06:43:46 +00:00
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-11 18:58:28 +00:00
# Command: build / clean / release. {{{
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-11 18:58:28 +00:00
function kodev-build() {
HELP="
USAGE: $0 ${CMD} <OPTIONS> <TARGET>
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-11 18:58:28 +00:00
$(build_options_help_msg '' 'stop after the setup phase' 'default for emulator' 'default for other targets')
${TARGETS_HELP_MSG}
"
parse_options "${BUILD_GETOPT_SHORT}" "${BUILD_GETOPT_LONG}" '?' "$@"
setup_target "${ARGS[0]}"
check_submodules
if [[ "${TARGET}" == 'android' && -z "${ANDROID_NDK_HOME}${ANDROID_NDK_ROOT}" ]]; then
TARGET='' run_make android-ndk
fi
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-11 18:58:28 +00:00
run_make ${NO_BUILD:+setup}
}
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-11 18:58:28 +00:00
function kodev-clean() {
HELP="
USAGE: $0 ${CMD} <OPTIONS> <TARGET>
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-11 18:58:28 +00:00
$(build_options_help_msg '' '' 'clean debug build' 'clean release build')
${TARGETS_HELP_MSG}
"
parse_options "${BUILD_GETOPT_SHORT/b/}" "${BUILD_GETOPT_LONG/no-build,/}" '?' "$@"
setup_target "${ARGS[0]}"
run_make clean
}
function kodev-release() {
HELP="
USAGE: $0 ${CMD} <OPTIONS> <TARGET>
OPTIONS:
-i, --ignore-translation do not fetch translation for release
$(build_options_help_msg 'BUILD' 'create update from existing build' '' 'default')
${RELEASE_TARGETS_HELP_MSG}
"
parse_options "i${BUILD_GETOPT_SHORT}" "ignore-translation,${BUILD_GETOPT_LONG}" '1' "$@"
local ignore_translation=0
for opt in "${OPTS[@]}"; do
case "${opt}" in
-i | --ignore-translation)
ignore_translation=1
;;
esac
done
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-11 18:58:28 +00:00
setup_target "${ARGS[0]}"
check_submodules
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-11 18:58:28 +00:00
if [[ "${ignore_translation}" -eq 0 ]]; then
if ! run_make po; then
err "ERROR: failed to fetch translation."
echo "Tip: Use --ignore-translation OPTION if you want to build a release without translation." 2>&1
2020-01-01 20:18:09 +00:00
exit 1
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-11 18:58:28 +00:00
fi
fi
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-11 18:58:28 +00:00
if [[ "${TARGET}" == 'android' ]] && [[ -z "${ANDROID_NDK_HOME}${ANDROID_NDK_ROOT}" || -z "${ANDROID_HOME}${ANDROID_SDK_ROOT}" ]]; then
TARGET='' run_make android-ndk android-sdk
fi
run_make ${NO_BUILD:+--assume-old=all} update
2016-02-01 06:43:46 +00:00
}
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-11 18:58:28 +00:00
# }}}
2016-02-01 06:43:46 +00:00
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-11 18:58:28 +00:00
# Command: prompt / run / wbuilder. {{{
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-11 18:58:28 +00:00
function kodev-prompt() {
HELP="
USAGE: $0 ${CMD} <OPTIONS>
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-11 18:58:28 +00:00
$(build_options_help_msg '' 'use existing build' 'default' '')
"
parse_options "${BUILD_GETOPT_SHORT}" "${BUILD_GETOPT_LONG}" '0' "$@"
setup_target 'emulator'
run_make ${NO_BUILD:+--assume-old=all} run-prompt
}
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-11 18:58:28 +00:00
function kodev-run() {
# Defaults.
KODEBUG=1
local screen_width=540
local screen_height=720
# NOTE: Speaking of Valgrind, if your libdrm/mesa isn't built w/ valgrind markings, there's a Valgrind suppression file for AMD cards in the tools folder.
# Just append --suppressions=${PWD/tools/valgrind_amd.supp to your valgrind command.
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-11 18:58:28 +00:00
local valgrind=(valgrind --tool=memcheck --keep-debuginfo=yes --leak-check=full --show-reachable=yes --trace-children=yes --track-origins=yes)
local callgrind=(valgrind --tool=callgrind --trace-children=yes)
local wrap=()
HELP="
USAGE: $0 ${CMD} <OPTIONS> <EMULATOR ARGS>
$0 ${CMD} <OPTIONS> <ANDROID TARGET> [ANDROID APK]
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-11 18:58:28 +00:00
$(build_options_help_msg '' 'use existing build' 'default' '')
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-11 18:58:28 +00:00
EMULATOR OPTIONS:
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-11 18:58:28 +00:00
-H X, --screen-height=X set height of the emulator screen (default: ${screen_height})
-W X, --screen-width=X set width of the emulator screen (default: ${screen_width})
-D X, --screen-dpi=X set DPI of the emulator screen (default: 160)
-t, --disable-touch use this if you want to simulate keyboard only devices
-s FOO --simulate=FOO simulate dimension and other specs for the given device:
hidpi, kobo-forma, kobo-aura-one, kobo-clara, kobo-h2o,
kindle-paperwhite, legacy-paperwhite, kindle
-g X, --gdb=X run with debugger (default: ddd, cgdb, or gdb)
--callgrind run with valgrind's callgrind
--valgrind[=X] run with valgrind
-w X, --wrap=X run with specified wrapper command
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-11 18:58:28 +00:00
Extra arguments are forwarded to the emulator.
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-11 18:58:28 +00:00
Default valgrind commands:
- callgrind: $(print_quoted "${callgrind[@]}")
- valgrind: $(print_quoted "${valgrind[@]}")
ANDROID TARGET:
Install and run KOReader on an Android device connected through ADB.
"
local short_opts="tg:::cW:H:D:s:w:"
local long_opts="disable-touch,gdb::,valgrind::,callgrind,screen-width:,screen-height:,screen-dpi:,simulate:,wrap:"
parse_options "${short_opts}${BUILD_GETOPT_SHORT}" "${long_opts},${BUILD_GETOPT_LONG}" '*' "$@"
# Handle custom options.
set -- "${OPTS[@]}"
while [[ $# -gt 0 ]]; do
PARAM="${1}"
# Support using an = assignment with short options (e.g., -f=blah instead of -f blah).
VALUE="${2/#=/}"
case "${PARAM}" in
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-11 18:58:28 +00:00
# Command wrapper.
--callgrind)
# Try to use sensible defaults for valgrind.
if ! command -v valgrind >/dev/null; then
die 1 "Couldn't find valgrind."
fi
wrap=("${callgrind[@]}")
;;
-g | --gdb)
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-11 18:58:28 +00:00
if [[ -n "${VALUE}" ]]; then
declare -a "wrap=(${VALUE})"
else
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-11 18:58:28 +00:00
# Try to use friendly defaults for GDB:
# - DDD is a slightly less nice GUI
# - cgdb is a nice curses-based GDB front
# - GDB standard CLI has a fallback
if ! wrap=("$(command -v ddd cgdb gdb | head -n1)"); then
die 1 "Couldn't find GDB."
fi
fi
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-11 18:58:28 +00:00
if [[ ${#wrap[@]} -eq 1 ]]; then
# The standard GDB CLI needs a little hand holding to
# properly pass arguments to the process it'll monitor.
local gdb_common_args=(--directory "${CURDIR}/base" --args)
case "${wrap[0]}" in
cgdb | */cgdb)
wrap+=(-- "${gdb_common_args[@]}")
;;
ddd | */ddd)
wrap+=(--gdb -- "${gdb_common_args[@]}")
;;
gdb | */gdb)
wrap+=("${gdb_common_args[@]}")
;;
esac
fi
shift
;;
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-11 18:58:28 +00:00
--valgrind)
if [[ -n "${VALUE}" ]]; then
declare -a "wrap=(${VALUE})"
else
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-11 18:58:28 +00:00
# Try to use sensible defaults for valgrind.
if ! command -v valgrind >/dev/null; then
die 1 "Couldn't find valgrind."
fi
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-11 18:58:28 +00:00
wrap=("${valgrind[@]}")
fi
shift
;;
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-11 18:58:28 +00:00
-w | --wrap)
declare -a "wrap=(${VALUE})"
shift
;;
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-11 18:58:28 +00:00
# Simulated device specification.
-W | --screen-width)
screen_width="${VALUE}"
shift
;;
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-11 18:58:28 +00:00
-H | --screen-height)
screen_height="${VALUE}"
shift
;;
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-11 18:58:28 +00:00
-D | --screen-dpi)
screen_dpi="${VALUE}"
shift
;;
-s | --simulate)
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-11 18:58:28 +00:00
case "${VALUE}" in
kindle)
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-11 18:58:28 +00:00
screen_width=600 screen_height=800 screen_dpi=167
;;
legacy-paperwhite)
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-11 18:58:28 +00:00
screen_width=758 screen_height=1024 screen_dpi=212
;;
kobo-forma)
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-11 18:58:28 +00:00
screen_width=1440 screen_height=1920 screen_dpi=300
;;
kobo-aura-one)
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-11 18:58:28 +00:00
screen_width=1404 screen_height=1872 screen_dpi=300
;;
kobo-clara | kindle-paperwhite)
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-11 18:58:28 +00:00
screen_width=1072 screen_height=1448 screen_dpi=300
;;
kobo-h2o)
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-11 18:58:28 +00:00
screen_width=1080 screen_height=1429 screen_dpi=265
;;
hidpi)
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-11 18:58:28 +00:00
screen_width=1500 screen_height=2000 screen_dpi=600
;;
*)
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-11 18:58:28 +00:00
die 1 "ERROR: spec unknown for ${VALUE}."
;;
esac
shift
;;
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-11 18:58:28 +00:00
-t | --disable-touch)
export DISABLE_TOUCH=1
;;
2016-02-01 06:43:46 +00:00
esac
shift
done
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-11 18:58:28 +00:00
set -- "${ARGS[@]}"
# Setup target.
local target=''
if [[ "$1" = android-* ]]; then
target="$1"
shift
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-11 18:58:28 +00:00
fi
setup_target "${target}"
# Build command prefix.
local rwrap=()
if [[ -z "${target}" ]]; then
rwrap+=(EMULATE_READER_W="${screen_width}" EMULATE_READER_H="${screen_height}" EMULATE_READER_DPI="${screen_dpi}")
fi
if [[ "${#wrap[@]}" -gt 0 ]]; then
rwrap+=("${wrap[@]}")
fi
# Build the final make command.
local margs=()
if [[ "${target}" = android-* ]]; then
if [[ "$1" = *.apk ]]; then
margs+=(ANDROID_APK="$1")
NO_BUILD=1
shift
fi
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-11 18:58:28 +00:00
if [[ ${#rwrap[@]} -gt 0 || $# -gt 0 ]]; then
show_help 1>&2
exit ${E_OPTERR}
fi
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-11 18:58:28 +00:00
else
# Enable debug traces by default.
set -- -d "$@"
fi
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-11 18:58:28 +00:00
if [[ ${#rwrap[@]} -gt 0 ]]; then
margs+=(RWRAP="$(print_quoted "${rwrap[@]}")")
fi
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-11 18:58:28 +00:00
if [[ $# -gt 0 ]]; then
margs+=(RARGS="$(print_quoted "$@")")
fi
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-11 18:58:28 +00:00
# Run it.
run_make "${margs[@]}" ${NO_BUILD:+--assume-old=all --assume-old=update} run
}
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-11 18:58:28 +00:00
function kodev-wbuilder() {
HELP="
USAGE: $0 ${CMD} <OPTIONS>
2017-02-02 11:13:39 +00:00
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-11 18:58:28 +00:00
$(build_options_help_msg '' '' '' '')
"
parse_options "${BUILD_GETOPT_SHORT}" "${BUILD_GETOPT_LONG}" '0' "$@"
setup_target 'emulator'
run_make run-wbuilder
}
2017-02-02 11:13:39 +00:00
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-11 18:58:28 +00:00
# }}}
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-11 18:58:28 +00:00
# Command: cov / test. {{{
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-11 18:58:28 +00:00
function kodev-cov() {
HELP="
USAGE: $0 ${CMD} <OPTIONS>
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-11 18:58:28 +00:00
OPTIONS:
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-11 18:58:28 +00:00
-f, --full show full coverage report (down to each line)
-s, --show-previous show coverage stats from previous run
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-11 18:58:28 +00:00
$(build_options_help_msg 'BUILD' 'use existing build' '' 'default')
"
parse_options "fs${BUILD_GETOPT_SHORT}" "full,show-previous,${BUILD_GETOPT_LONG}" '0' "$@"
# Handle custom options.
local show_full=''
local show_previous=''
for opt in "${OPTS[@]}"; do
case "${opt}" in
-f | --full)
show_full=1
;;
-s | --show-previous)
show_previous=1
;;
2017-02-02 11:13:39 +00:00
esac
done
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-11 18:58:28 +00:00
setup_target 'emulator'
check_submodules
run_make ${NO_BUILD:+--assume-old=all} ${show_previous:+--assume-old=coverage-run} coverage${show_full:+-full}
2017-02-02 11:13:39 +00:00
}
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-11 18:58:28 +00:00
function kodev-test() {
HELP="
USAGE: $0 ${CMD} <OPTIONS> <TEST_SUITE> <TEST_NAMES>
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-11 18:58:28 +00:00
TEST_SUITE: [all|base|front]. Optional: default to all.
TEST_NAMES: if no TEST_NAMES are given, the full testsuite is run.
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-11 18:58:28 +00:00
OPTIONS:
2016-02-28 20:16:32 +00:00
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-11 18:58:28 +00:00
-t, --tags=TAGS only run tests with given tags
2016-02-28 20:16:32 +00:00
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-11 18:58:28 +00:00
$(build_options_help_msg 'BUILD' 'use existing build' '' 'default')
2016-02-28 20:16:32 +00:00
"
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-11 18:58:28 +00:00
parse_options "t:${BUILD_GETOPT_SHORT}" "tags:,${BUILD_GETOPT_LONG}" '*' "$@"
# Handle first argument.
suite=''
set -- "${ARGS[@]}"
if [[ $# -ne 0 ]]; then
suite="$1"
shift
ARGS=("$@")
fi
# The rest (custom options included) is forwarded to busted.
setup_target 'emulator'
check_submodules
run_make ${NO_BUILD:+--assume-old=all} "test${suite}" BUSTED_OVERRIDES="$(print_quoted "${OPTS[@]}" "${ARGS[@]}")"
}
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-11 18:58:28 +00:00
# }}}
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-11 18:58:28 +00:00
# Command: log. {{{
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-11 18:58:28 +00:00
function kodev-log() {
HELP="
USAGE: $0 ${CMD} <OPTIONS>
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-11 18:58:28 +00:00
OPTIONS:
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-11 18:58:28 +00:00
-d, --debug more verbose logs (e.g., debug builds)
"
parse_options 'd' '--debug' '0' "$@"
if command -v pidcat >/dev/null; then
if [[ -n "${KODEBUG}" ]]; then
pidcat "org.koreader.launcher"
else
pidcat org.koreader.launcher --min-level=I
fi
else
if [[ -n "${KODEBUG}" ]]; then
adb logcat 'KOReader:V ApkUpdater:V Assets:V Device:V dlopen:V EPD:V EventReceiver:V Lights:V Surface:V LuaJIT:V MainActivity:V NativeGlue:V NativeThread:V Timeout:V ActivityManager:V AndroidRuntime:V DEBUG:* *:F'
else
adb logcat 'KOReader:I MainActivity:V NativeGlue:V NativeThread:V ActivityManager:W AndroidRuntime:E DEBUG:* *:F'
fi
fi
2016-02-28 20:16:32 +00:00
}
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-11 18:58:28 +00:00
# }}}
2016-02-01 06:43:46 +00:00
HELP_MSG="
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-11 18:58:28 +00:00
USAGE: $0 COMMAND <ARGS>
2016-02-01 06:43:46 +00:00
Supported commands:
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-11 18:58:28 +00:00
Building:
2016-02-11 06:27:41 +00:00
build Build KOReader
clean Clean KOReader build
release Build KOReader release package
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-11 18:58:28 +00:00
Emulator & Android:
2016-02-11 06:27:41 +00:00
run Run KOReader
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-11 18:58:28 +00:00
Emulator only:
cov Run busted tests for coverage
prompt Run a LuaJIT shell within KOReader's environment
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-11 18:58:28 +00:00
test Run busted tests
wbuilder Run wbuilder.lua script (useful for building new UI widget)
Android only:
log Tail log stream for a running KOReader app
Miscellaneous:
activate Bootstrap shell environment for kodev
fetch-thirdparty Fetch & synchronize thirdparty dependencies
check Run various linters
2016-02-01 06:43:46 +00:00
"
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-11 18:58:28 +00:00
if [[ $# -lt 1 ]]; then
err "Missing command."
echo "${HELP_MSG}" 1>&2
exit 1
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-11 18:58:28 +00:00
fi
2016-02-01 06:43:46 +00:00
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-11 18:58:28 +00:00
CMD="$1"
shift
case "${CMD}" in
# Commands.
activate) ;;
build) ;;
check) ;;
clean) ;;
cov) ;;
fetch-thirdparty) ;;
log) ;;
prompt) ;;
release) ;;
run) ;;
test) ;;
wbuilder) ;;
# Options.
-h | --help)
echo "${HELP_MSG}"
exit 0
;;
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-11 18:58:28 +00:00
# Invalid.
2016-02-01 06:43:46 +00:00
*)
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-11 18:58:28 +00:00
err "Unknown command: $1."
echo "${HELP_MSG}"
exit 8
;;
2016-02-01 06:43:46 +00:00
esac
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-11 18:58:28 +00:00
HELP="USAGE: $0 ${CMD}"
"kodev-${CMD}" "$@"
# vim: foldmethod=marker foldlevel=0 shiftwidth=4 softtabstop=4