k2pdfopt: fix some issues

Program already has Android support but not in way
expected by Termux and that introduced problems like
menu entries printed to Android log instead of stdout.
This commit is contained in:
Leonid Pliushch 2020-01-01 22:21:54 +02:00
parent d75c3c1493
commit 68353b59c8
2 changed files with 34 additions and 4 deletions

View File

@ -2,11 +2,8 @@ TERMUX_PKG_HOMEPAGE=http://www.willus.com/k2pdfopt/
TERMUX_PKG_DESCRIPTION="A tool that optimizes PDF files for viewing on mobile readers"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_VERSION=2.51
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=http://www.willus.com/k2pdfopt/src/k2pdfopt_v${TERMUX_PKG_VERSION}_src.zip
TERMUX_PKG_SHA256=3e6e4d7aac9c9bed4c7854888a6a91213be10121be76e17f83e080e829ac5fde
TERMUX_PKG_DEPENDS="leptonica, libjasper, libjpeg-turbo, libpng, mupdf, netpbm, zlib"
TERMUX_PKG_BUILD_IN_SRC=true
termux_step_pre_configure() {
LDFLAGS+=" -llog"
}

View File

@ -0,0 +1,33 @@
diff -uNr k2pdfopt_v2.51/k2pdfoptlib/k2sys.c k2pdfopt_v2.51.mod/k2pdfoptlib/k2sys.c
--- k2pdfopt_v2.51/k2pdfoptlib/k2sys.c 2019-01-04 20:41:52.000000000 +0200
+++ k2pdfopt_v2.51.mod/k2pdfoptlib/k2sys.c 2020-01-01 22:20:34.606541436 +0200
@@ -21,7 +21,7 @@
#include "k2pdfopt.h"
#include <stdarg.h>
-#ifdef __ANDROID__
+#if defined(__ANDROID__) && !defined(__TERMUX__)
#include <android/log.h>
#endif
@@ -179,7 +179,7 @@
}
else
#endif
-#ifdef __ANDROID__
+#if defined(__ANDROID__) && !defined(__TERMUX__)
{
char buf[1024];
status=vsnprintf(buf,sizeof(buf),fmt,args);
diff -uNr k2pdfopt_v2.51/k2pdfoptlib/wrapbmp.c k2pdfopt_v2.51.mod/k2pdfoptlib/wrapbmp.c
--- k2pdfopt_v2.51/k2pdfoptlib/wrapbmp.c 2019-01-04 20:41:40.000000000 +0200
+++ k2pdfopt_v2.51.mod/k2pdfoptlib/wrapbmp.c 2020-01-01 22:16:03.613556631 +0200
@@ -480,7 +480,7 @@
** but when I ask for back coordinates (original coordinates on source image)
** I got wrong results. It happens because 'wrmap' malformed during parsing.
*/
-#if (defined(__ANDROID__) && defined(K2PDFOPT_KINDLEPDFVIEWER))
+#if (defined(__ANDROID__) && defined(K2PDFOPT_KINDLEPDFVIEWER) && !defined(__TERMUX__))
{
int dstmar_pixels[4];
int i,w;