From bdee3715f70e121f52914550292d881991338813 Mon Sep 17 00:00:00 2001 From: Ansh Dadwal <68729523+T-Dynamos@users.noreply.github.com> Date: Sun, 27 Nov 2022 23:49:24 +0530 Subject: [PATCH] add(x11): new package spotify-qt Co-authored-by: Tee KOBAYASHI --- x11-packages/spotify-qt/CMakeLists.txt.patch | 11 +++++ x11-packages/spotify-qt/build.sh | 9 ++++ .../spotify-qt/fix-hardcoded-paths.patch | 49 +++++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 x11-packages/spotify-qt/CMakeLists.txt.patch create mode 100644 x11-packages/spotify-qt/build.sh create mode 100644 x11-packages/spotify-qt/fix-hardcoded-paths.patch diff --git a/x11-packages/spotify-qt/CMakeLists.txt.patch b/x11-packages/spotify-qt/CMakeLists.txt.patch new file mode 100644 index 0000000000..3456ac632e --- /dev/null +++ b/x11-packages/spotify-qt/CMakeLists.txt.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -76,7 +76,7 @@ + endif () + + # Create main executable +-if (ANDROID) ++if (FALSE) + add_library(spotify-qt SHARED ${SRC_FILES} res.qrc) + elseif (MSVC) + add_executable(spotify-qt WIN32 ${SRC_FILES} ${LIB_SRC} res.qrc diff --git a/x11-packages/spotify-qt/build.sh b/x11-packages/spotify-qt/build.sh new file mode 100644 index 0000000000..d642256570 --- /dev/null +++ b/x11-packages/spotify-qt/build.sh @@ -0,0 +1,9 @@ +TERMUX_PKG_HOMEPAGE=https://github.com/kraxarn/spotify-qt +TERMUX_PKG_DESCRIPTION="Lightweight Spotify client using Qt" +TERMUX_PKG_LICENSE="GPL-3.0" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION=3.9 +TERMUX_PKG_SRCURL=https://github.com/kraxarn/spotify-qt/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_SHA256=db1bc50fe4f31fc021db722eb85e59db543a104255a0a07f2e923d7a69195e42 +TERMUX_PKG_DEPENDS="libc++, qt5-qtbase, qt5-qtsvg" +TERMUX_PKG_BUILD_DEPENDS="qt5-qtbase-cross-tools" diff --git a/x11-packages/spotify-qt/fix-hardcoded-paths.patch b/x11-packages/spotify-qt/fix-hardcoded-paths.patch new file mode 100644 index 0000000000..0c11080989 --- /dev/null +++ b/x11-packages/spotify-qt/fix-hardcoded-paths.patch @@ -0,0 +1,49 @@ +diff '--color=auto' -uNr spotify-qt-3.9/lib/thirdparty/include/thirdparty/filesystem.hpp spotify-qt-3.9.mod/lib/thirdparty/include/thirdparty/filesystem.hpp +--- spotify-qt-3.9/lib/thirdparty/include/thirdparty/filesystem.hpp 2022-07-13 01:07:50.000000000 +0530 ++++ spotify-qt-3.9.mod/lib/thirdparty/include/thirdparty/filesystem.hpp 2022-11-27 23:47:28.774600094 +0530 +@@ -5069,7 +5069,7 @@ + return path(temp_path); + } + } +- return path("/tmp"); ++ return path("@TERMUX_PREFIX@/tmp"); + #endif + } + +diff '--color=auto' -uNr spotify-qt-3.9/src/spotifyclient/helper.cpp spotify-qt-3.9.mod/src/spotifyclient/helper.cpp +--- spotify-qt-3.9/src/spotifyclient/helper.cpp 2022-07-13 01:07:50.000000000 +0530 ++++ spotify-qt-3.9.mod/src/spotifyclient/helper.cpp 2022-11-27 23:42:38.296679095 +0530 +@@ -131,13 +131,13 @@ + + auto SpotifyClient::Helper::running(const QString &path) -> bool + { +- if (path.isEmpty() || !QFile("/usr/bin/ps").exists()) ++ if (path.isEmpty() || !QFile("@TERMUX_PREFIX@/bin/ps").exists()) + { + return false; + } + + QProcess ps; +- ps.start("/usr/bin/ps", {"aux"}); ++ ps.start("@TERMUX_PREFIX@/bin/ps", {"aux"}); + ps.waitForFinished(); + auto out = ps.readAllStandardOutput(); + return QString(out).contains(path); +diff '--color=auto' -uNr spotify-qt-3.9/src/util/appinstalltype.cpp spotify-qt-3.9.mod/src/util/appinstalltype.cpp +--- spotify-qt-3.9/src/util/appinstalltype.cpp 2022-07-13 01:07:50.000000000 +0530 ++++ spotify-qt-3.9.mod/src/util/appinstalltype.cpp 2022-11-27 23:43:59.700634507 +0530 +@@ -30,12 +30,12 @@ + + auto AppInstallType::getInstallType(const QString &path) -> InstallType + { +- if (path.startsWith(QStringLiteral("/home/"))) ++ if (path.startsWith(QStringLiteral("@TERMUX_HOME@/"))) + { + return InstallType::User; + } + +- if (path.startsWith(QStringLiteral("/usr/"))) ++ if (path.startsWith(QStringLiteral("@TERMUX_PREFIX@/"))) + { + return InstallType::System; + }