From 565379d7d6afc2d808854084b2d25aff808a8e7b Mon Sep 17 00:00:00 2001 From: Leonid Pliushch Date: Thu, 14 Sep 2017 14:40:48 +0300 Subject: [PATCH] megatools: fix hardcoded paths --- packages/megatools/build.sh | 3 ++- packages/megatools/fix-hardcoded-paths.patch | 21 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 packages/megatools/fix-hardcoded-paths.patch diff --git a/packages/megatools/build.sh b/packages/megatools/build.sh index 705a33687..f5903c8fb 100644 --- a/packages/megatools/build.sh +++ b/packages/megatools/build.sh @@ -1,6 +1,7 @@ TERMUX_PKG_HOMEPAGE=https://github.com/megous/megatools TERMUX_PKG_DESCRIPTION="Open-source command line tools and C library (libmega) for accessing Mega.co.nz cloud storage" TERMUX_PKG_VERSION=1.9.98 +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/megous/megatools/archive/$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_FOLDERNAME=megatools-$TERMUX_PKG_VERSION TERMUX_PKG_DEPENDS="glib, libandroid-support, libcurl, libgmp, openssl" @@ -13,4 +14,4 @@ termux_step_pre_configure() { sed -i -e 's/-V -qversion//' configure sed -i -e 's/GOBJECT_INTROSPECTION_CHECK/#GOBJECT_INTROSPECTION_CHECK/' configure -} \ No newline at end of file +} diff --git a/packages/megatools/fix-hardcoded-paths.patch b/packages/megatools/fix-hardcoded-paths.patch new file mode 100644 index 000000000..2c167dc93 --- /dev/null +++ b/packages/megatools/fix-hardcoded-paths.patch @@ -0,0 +1,21 @@ +diff -uNr megatools-1.9.98/lib/mega.c megatools-1.9.98.mod/lib/mega.c +--- megatools-1.9.98/lib/mega.c 2016-11-03 15:47:43.000000000 +0200 ++++ megatools-1.9.98.mod/lib/mega.c 2017-09-14 14:39:19.422860139 +0300 +@@ -2859,7 +2859,7 @@ + + if (has_ffmpegthumbnailer && g_regex_match_simple("\\.(mpg|mpeg|avi|mkv|flv|rm|mp4|wmv|asf|ram|mov)$", local_path, G_REGEX_CASELESS, 0)) + { +- gchar buf[50] = "/tmp/megatools.XXXXXX"; ++ gchar buf[50] = "@TERMUX_PREFIX@/tmp/megatools.XXXXXX"; + gchar* dir = g_mkdtemp(buf); + if (dir) + { +@@ -2895,7 +2895,7 @@ + } + else if (has_convert && g_regex_match_simple("\\.(jpe?g|png|gif|bmp|tiff|svg|pnm|eps|ico|pdf)$", local_path, G_REGEX_CASELESS, 0)) + { +- gchar buf[50] = "/tmp/megatools.XXXXXX"; ++ gchar buf[50] = "@TERMUX_PREFIX@/tmp/megatools.XXXXXX"; + gchar* dir = g_mkdtemp(buf); + if (dir) + {