megacmd: Fix hardcoded paths

This commit is contained in:
Tee KOBAYASHI 2022-12-25 13:58:06 +09:00 committed by xtkoba
parent 9a25355f69
commit 1a1f776c2d
2 changed files with 20 additions and 1 deletions

View File

@ -3,9 +3,11 @@ TERMUX_PKG_DESCRIPTION="Provides non UI access to MEGA services"
TERMUX_PKG_LICENSE="BSD 2-Clause"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=1.5.1
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://github.com/meganz/MEGAcmd.git
TERMUX_PKG_GIT_BRANCH=${TERMUX_PKG_VERSION}_Linux
TERMUX_PKG_DEPENDS="c-ares, cryptopp, ffmpeg, freeimage, libc++, libcurl, libsodium, libsqlite, libuv, mediainfo, openssl, pcre, readline, zlib"
# dbus is required for $PREFIX/var/lib/dbus/machine-id
TERMUX_PKG_DEPENDS="c-ares, cryptopp, dbus, ffmpeg, freeimage, libc++, libcurl, libsodium, libsqlite, libuv, mediainfo, openssl, pcre, readline, zlib"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
--disable-static
@ -34,3 +36,7 @@ termux_step_post_make_install() {
rm -f $_LIBPTHREAD_A
fi
}
termux_step_post_massage() {
find lib -name '*.la' -delete
}

View File

@ -18,3 +18,16 @@
if (!MEGAjvm)
{
LOG_err << "No JVM found";
@@ -1787,10 +1787,10 @@
uuid_unparse(uuid, uuid_str);
id->append(uuid_str);
#else
- int fd = open("/etc/machine-id", O_RDONLY);
+ int fd = open("@TERMUX_PREFIX@/etc/machine-id", O_RDONLY);
if (fd < 0)
{
- fd = open("/var/lib/dbus/machine-id", O_RDONLY);
+ fd = open("@TERMUX_PREFIX@/var/lib/dbus/machine-id", O_RDONLY);
if (fd < 0)
{
return;