From be71daf83e0f22a871e9b4ff87180f5d38c024d7 Mon Sep 17 00:00:00 2001 From: Simeon Huang Date: Wed, 12 May 2021 17:57:49 +0100 Subject: [PATCH] fix the fallback directories paths --- x11-packages/libqtxdg/build.sh | 2 +- .../libqtxdg/xdgdirs_termux_prefix.patch | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 x11-packages/libqtxdg/xdgdirs_termux_prefix.patch diff --git a/x11-packages/libqtxdg/build.sh b/x11-packages/libqtxdg/build.sh index e06ee8e27..ae2e5b0d5 100644 --- a/x11-packages/libqtxdg/build.sh +++ b/x11-packages/libqtxdg/build.sh @@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="Qt 5 implementation of freedesktop.org XDG specification TERMUX_PKG_LICENSE="LGPL-2.1" TERMUX_PKG_MAINTAINER="Simeon Huang " TERMUX_PKG_VERSION=3.7.1 -TERMUX_PKG_REVISION=1 +TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL="https://github.com/lxqt/${TERMUX_PKG_NAME}/releases/download/${TERMUX_PKG_VERSION}/${TERMUX_PKG_NAME}-${TERMUX_PKG_VERSION}.tar.xz" TERMUX_PKG_SHA256=477cbe76b3305071ff5f5bfa31dbcddcc51f3434b9ed75d91988219296d88a9b TERMUX_PKG_DEPENDS="qt5-qtbase, qt5-qtsvg, glib" diff --git a/x11-packages/libqtxdg/xdgdirs_termux_prefix.patch b/x11-packages/libqtxdg/xdgdirs_termux_prefix.patch new file mode 100644 index 000000000..817745a14 --- /dev/null +++ b/x11-packages/libqtxdg/xdgdirs_termux_prefix.patch @@ -0,0 +1,40 @@ +--- src/src/qtxdg/xdgdirs.cpp 2021-04-16 09:29:21.000000000 +0000 ++++ src.mod/src/qtxdg/xdgdirs.cpp 2021-05-12 16:50:56.461844000 +0000 +@@ -46,6 +46,8 @@ + QLatin1String("Videos") + }; + ++static const char* TERMUX_PREFIX = "/data/data/com.termux/files/usr"; ++ + // Helper functions prototypes + void fixBashShortcuts(QString &s); + void removeEndingSlash(QString &s); +@@ -108,7 +110,7 @@ + const QString home = QFile::decodeName(qgetenv("HOME")); + + if (home.isEmpty()) +- return QString::fromLatin1("/tmp"); ++ return QString::fromLatin1(TERMUX_PREFIX) + QString::fromLatin1("/tmp"); + else if (dir == XdgDirs::Desktop) + fallback = QString::fromLatin1("%1/%2").arg(home, QLatin1String("Desktop")); + else +@@ -270,8 +272,8 @@ + #endif + + if (dirs.isEmpty()) { +- dirs.append(QString::fromLatin1("/usr/local/share")); +- dirs.append(QString::fromLatin1("/usr/share")); ++ dirs.append(QString::fromLatin1(TERMUX_PREFIX) + QString::fromLatin1("/usr/local/share")); ++ dirs.append(QString::fromLatin1(TERMUX_PREFIX) + QString::fromLatin1("/usr/share")); + } else { + QMutableListIterator it(dirs); + while (it.hasNext()) { +@@ -293,7 +295,7 @@ + QStringList dirs; + const QString env = QFile::decodeName(qgetenv("XDG_CONFIG_DIRS")); + if (env.isEmpty()) +- dirs.append(QString::fromLatin1("/etc/xdg")); ++ dirs.append(QString::fromLatin1(TERMUX_PREFIX) + QString::fromLatin1("/etc/xdg")); + else + #if (QT_VERSION >= QT_VERSION_CHECK(5,15,0)) + dirs = env.split(QLatin1Char(':'), Qt::SkipEmptyParts);