Browse Source

k2pdfopt: fix hardcoded paths

build-on-device
Leonid Plyushch 5 years ago
parent
commit
0e1bfe6ec8
No known key found for this signature in database GPG Key ID: 45F2964132545795
  1. 2
      packages/k2pdfopt/build.sh
  2. 45
      packages/k2pdfopt/fix-hardcoded-paths.patch

2
packages/k2pdfopt/build.sh

@ -2,7 +2,7 @@ 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_REVISION=2
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"

45
packages/k2pdfopt/fix-hardcoded-paths.patch

@ -0,0 +1,45 @@
diff -uNr k2pdfopt_v2.51/willuslib/linux.c k2pdfopt_v2.51.mod/willuslib/linux.c
--- k2pdfopt_v2.51/willuslib/linux.c 2018-12-07 06:04:19.000000000 +0200
+++ k2pdfopt_v2.51.mod/willuslib/linux.c 2020-01-01 22:57:54.060671849 +0200
@@ -51,14 +51,8 @@
static char file[4096];
int index,j;
int used[16];
- static char *stddirs[] = {"/usr/sbin",
- "/sbin",
- "/bin",
- "/usr/bin",
- "/usr/local/bin",
- "/usr/kerberos/sbin",
- "/usr/kerberos/bin",
- "/usr/X11R6/bin",
+ static char *stddirs[] = {"@TERMUX_PREFIX@/bin",
+ "@TERMUX_PREFIX@/bin/applets",
".",
""};
diff -uNr k2pdfopt_v2.51/willuslib/wfile.c k2pdfopt_v2.51.mod/willuslib/wfile.c
--- k2pdfopt_v2.51/willuslib/wfile.c 2018-07-27 20:47:22.000000000 +0300
+++ k2pdfopt_v2.51.mod/willuslib/wfile.c 2020-01-01 22:59:22.030332744 +0200
@@ -2003,7 +2003,7 @@
strcpy(dir,".");
}
#else
- strcpy(dir,"/tmp");
+ strcpy(dir,"@TERMUX_PREFIX@/tmp");
#endif
}
diff -uNr k2pdfopt_v2.51/willuslib/wgs.c k2pdfopt_v2.51.mod/willuslib/wgs.c
--- k2pdfopt_v2.51/willuslib/wgs.c 2018-12-30 19:31:32.000000000 +0200
+++ k2pdfopt_v2.51.mod/willuslib/wgs.c 2020-01-01 22:58:58.573156564 +0200
@@ -223,8 +223,7 @@
"+\\gs","+\\ghostgum","\\gs*","\\ghostgum*",""};
#else
static char *gsnames[]={"gs",""};
- static char *folders[]={"/usr/bin","/usr/share/gs","/usr/local/gs","/opt/gs",
- "/usr/share/gs*","/usr/local/gs*","/opt/gs*",""};
+ static char *folders[]={"@TERMUX_PREFIX@/bin",""};
#endif
Loading…
Cancel
Save