diff --git a/user/koreader/APKBUILD b/user/koreader/APKBUILD new file mode 100644 index 0000000..73d1a63 --- /dev/null +++ b/user/koreader/APKBUILD @@ -0,0 +1,82 @@ +# Maintainer: Antoine Martin (ayakael) +pkgname=koreader +pkgver=2025.10 +pkgrel=0 +pkgdesc="An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats" +# s390x|riscv64|ppc64le|loongarch64: FTBFS +# armhf|armv7|x86: Tests fail, segmentation fault +arch="x86_64 aarch64" +url="https://github.com/koreader/koreader/" +license="AGPL-3.0-only" +depends=" + bash + sdl2 + procps-ng + " +makedepends=" + autoconf + automake + cmake + coreutils + curl + diffutils + findutils + gettext + grep + libtool + linux-headers + meson + nasm + ninja-build + perl + pkgconf + wget + " +source=" + https://ayakael.net/api/packages/mirrors/generic/koreader/v$pkgver/koreader-v$pkgver.tar.gz + reader-lua-use-absolute-path-to-luajit.patch + " +subpackages="$pkgname-doc" +builddir="$srcdir"/$pkgname-v$pkgver + +# has vendored copies of system libraries +sonameprefix="$pkgname:" + +prepare() { + default_prepare + + # no need to test manually set version + rm "$builddir"/spec/unit/version_spec.lua +} + +build() { + # add ninja bin to path + export PATH="$PATH":/usr/lib/ninja-build/bin + + # default target is emulator build + make TARGET= KODEBUG= VERBOSE= +} + +check() { + KODEBUG= TARGET= VERBOSE= ./base/utils/fake_tty.py make --assume-old=base testfront +} + +package() { + install -Dm755 "$builddir"/platform/linux/koreader.sh "$pkgdir"/usr/bin/koreader + install -Dm644 "$builddir"/platform/linux/koreader.desktop -t "$pkgdir"/usr/share/applications/ + install -Dm644 "$builddir"/resources/koreader.png -t "$pkgdir"/usr/share/pixmaps/ + install -Dm644 "$builddir"/platform/linux/koreader.1 -t "$pkgdir"/usr/share/man/man1/ + + mkdir -p "$pkgdir"/usr/lib + cp -RL "$builddir"/koreader-emulator-*/koreader "$pkgdir"/usr/lib/koreader + + # delete debug files + find "$pkgdir" -name '*.dbg' -delete + + # version information + echo "v$pkgver" > "$pkgdir"/usr/lib/koreader/git-rev +} +sha512sums=" +3fbbe49ae6134abd810d9932cfb650d031100c95570c8eaa6d6e5d4c6a9a86916961b989696a7d97c149920d63853108905eea34f75f987e58f89e3a49d63948 koreader-v2025.10.tar.gz +76dd6f2ea6416b135b76d95f3c8150378f577ddd68d48312eabd6e12adaa111253dc83fc02add3ded07d3e6174fd5f4bd6c9f7b635ef27e3d760d5acced9e6fe reader-lua-use-absolute-path-to-luajit.patch +" diff --git a/user/koreader/reader-lua-use-absolute-path-to-luajit.patch b/user/koreader/reader-lua-use-absolute-path-to-luajit.patch new file mode 100644 index 0000000..3d25e3f --- /dev/null +++ b/user/koreader/reader-lua-use-absolute-path-to-luajit.patch @@ -0,0 +1,10 @@ +diff --git a/reader.lua.orig b/reader.lua +index 6fe9489..c4cbb2b 100755 +--- a/reader.lua.orig ++++ b/reader.lua +@@ -1,4 +1,4 @@ +-#!./luajit ++#!/usr/lib/koreader/luajit + + -- Enforce line-buffering for stdout (this is the default if it points to a tty, but we redirect to a file on most platforms). + io.stdout:setvbuf("line")