about summary refs log tree commit diff
path: root/pkgs/tools/graphics/mangohud/hardcode-dependencies.patch
blob: 1c0f3a497fe6fd6eab70f6b3cb1a32c5ffb54a8e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
diff --git a/src/dbus.cpp b/src/dbus.cpp
index 7379af1..4eef3fe 100644
--- a/src/dbus.cpp
+++ b/src/dbus.cpp
@@ -152,7 +152,7 @@ bool dbus_manager::get_media_player_metadata(metadata& meta, std::string name) {
 }
 
 bool dbus_manager::init_internal() {
-    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")) {
         SPDLOG_ERROR("Could not load libdbus-1.so.3");
         return false;
     }
diff --git a/src/logging.cpp b/src/logging.cpp
index ca33ee3..90d3638 100644
--- a/src/logging.cpp
+++ b/src/logging.cpp
@@ -26,7 +26,11 @@ 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) {
       return "popen failed!";
     }
diff --git a/src/pci_ids.cpp b/src/pci_ids.cpp
index 002a843..5a6262b 100644
--- a/src/pci_ids.cpp
+++ b/src/pci_ids.cpp
@@ -24,11 +24,9 @@ static std::istream& get_uncommented_line(std::istream& is, std::string &line)
 void parse_pciids()
 {
     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");
-        if (file.fail())
-            SPDLOG_ERROR("can't find file pci.ids");
+        SPDLOG_ERROR("can't find file pci.ids");
     }
 
     std::string line;