2022-06-16 17:23:12 +00:00
|
|
|
From 56a191f6db6d530c2bc89d9d3395b4c9768d108f Mon Sep 17 00:00:00 2001
|
|
|
|
From: Atemu <atemu.main@gmail.com>
|
|
|
|
Date: Tue, 17 May 2022 16:58:08 +0200
|
|
|
|
Subject: [PATCH 1/2] hardcode dependencies
|
|
|
|
|
|
|
|
---
|
|
|
|
src/dbus.cpp | 2 +-
|
|
|
|
src/loaders/loader_x11.cpp | 2 +-
|
|
|
|
src/logging.cpp | 7 +++++++
|
|
|
|
src/pci_ids.cpp | 6 ++----
|
|
|
|
4 files changed, 11 insertions(+), 6 deletions(-)
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
diff --git a/src/dbus.cpp b/src/dbus.cpp
|
2022-06-16 17:23:12 +00:00
|
|
|
index 3b3cccb..1405725 100644
|
2021-05-20 23:08:51 +00:00
|
|
|
--- a/src/dbus.cpp
|
|
|
|
+++ b/src/dbus.cpp
|
2022-06-16 17:23:12 +00:00
|
|
|
@@ -152,7 +152,7 @@ bool dbus_manager::get_media_player_metadata(metadata& meta, std::string name) {
|
|
|
|
}
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
bool dbus_manager::init_internal() {
|
2021-05-20 23:08:51 +00:00
|
|
|
- if (!m_dbus_ldr.IsLoaded() && !m_dbus_ldr.Load("libdbus-1.so.3")) {
|
|
|
|
+ if (!m_dbus_ldr.IsLoaded() && !m_dbus_ldr.Load("@libdbus@/lib/libdbus-1.so.3")) {
|
2022-06-16 17:23:12 +00:00
|
|
|
SPDLOG_ERROR("Could not load libdbus-1.so.3");
|
2021-05-20 23:08:51 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
diff --git a/src/loaders/loader_x11.cpp b/src/loaders/loader_x11.cpp
|
2022-06-16 17:23:12 +00:00
|
|
|
index 4db6f78..c60d08c 100644
|
2021-05-20 23:08:51 +00:00
|
|
|
--- a/src/loaders/loader_x11.cpp
|
|
|
|
+++ b/src/loaders/loader_x11.cpp
|
2022-06-16 17:23:12 +00:00
|
|
|
@@ -89,4 +89,4 @@ void libx11_loader::CleanUp(bool unload) {
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
-std::shared_ptr<libx11_loader> g_x11(new libx11_loader("libX11.so.6"));
|
|
|
|
+std::shared_ptr<libx11_loader> g_x11(new libx11_loader("@libX11@/lib/libX11.so.6"));
|
|
|
|
diff --git a/src/logging.cpp b/src/logging.cpp
|
2022-06-16 17:23:12 +00:00
|
|
|
index b27f21e..48f5e03 100644
|
2021-05-20 23:08:51 +00:00
|
|
|
--- a/src/logging.cpp
|
|
|
|
+++ b/src/logging.cpp
|
2022-06-16 17:23:12 +00:00
|
|
|
@@ -22,7 +22,14 @@ string exec(string command) {
|
|
|
|
#endif
|
|
|
|
std::array<char, 128> buffer;
|
|
|
|
std::string result;
|
|
|
|
+
|
|
|
|
+ char* originalPath = getenv("PATH");
|
|
|
|
+ setenv("PATH", "@path@", 1);
|
|
|
|
+
|
|
|
|
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(command.c_str(), "r"), pclose);
|
|
|
|
+
|
|
|
|
+ setenv("PATH", originalPath, 1);
|
|
|
|
+
|
|
|
|
if (!pipe) {
|
2021-05-20 23:08:51 +00:00
|
|
|
return "popen failed!";
|
2022-06-16 17:23:12 +00:00
|
|
|
}
|
2021-05-20 23:08:51 +00:00
|
|
|
diff --git a/src/pci_ids.cpp b/src/pci_ids.cpp
|
2022-06-16 17:23:12 +00:00
|
|
|
index feec222..6baa707 100644
|
2021-05-20 23:08:51 +00:00
|
|
|
--- a/src/pci_ids.cpp
|
|
|
|
+++ b/src/pci_ids.cpp
|
2022-06-16 17:23:12 +00:00
|
|
|
@@ -24,11 +24,9 @@ std::istream& get_uncommented_line(std::istream& is, std::string &line)
|
2021-05-20 23:08:51 +00:00
|
|
|
void parse_pciids()
|
|
|
|
{
|
2022-06-16 17:23:12 +00:00
|
|
|
std::ifstream file;
|
|
|
|
- file.open("/usr/share/hwdata/pci.ids");
|
|
|
|
+ file.open("@hwdata@/share/hwdata/pci.ids");
|
|
|
|
if (file.fail()){
|
|
|
|
- file.open("/usr/share/misc/pci.ids");
|
2021-05-20 23:08:51 +00:00
|
|
|
- if (file.fail())
|
2022-06-16 17:23:12 +00:00
|
|
|
- SPDLOG_ERROR("can't find file pci.ids");
|
|
|
|
+ SPDLOG_ERROR("can't find file pci.ids");
|
2021-05-20 23:08:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
std::string line;
|
2022-06-16 17:23:12 +00:00
|
|
|
--
|
|
|
|
2.36.0
|
|
|
|
|