about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/graphics/mangohud/hardcode-dependencies.patch
blob: 2ee5e2dd54776b7cd124d4960cd44cc6fa635899 (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
48
49
50
51
52
53
54
55
56
57
diff --git a/src/dbus.cpp b/src/dbus.cpp
index 44ffafc..9baf57b 100644
--- a/src/dbus.cpp
+++ b/src/dbus.cpp
@@ -162,7 +162,7 @@ bool dbus_manager::init(const std::string& requested_player) {
         return true;
     }
 
-    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")) {
         std::cerr << "MANGOHUD: Could not load libdbus-1.so.3\n";
         return false;
     }
diff --git a/src/loaders/loader_x11.cpp b/src/loaders/loader_x11.cpp
index 25c65bf..87488d5 100644
--- a/src/loaders/loader_x11.cpp
+++ b/src/loaders/loader_x11.cpp
@@ -88,4 +88,4 @@ void libx11_loader::CleanUp(bool unload) {
 
 }
 
-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
index ee8600b..c7c91a0 100644
--- a/src/logging.cpp
+++ b/src/logging.cpp
@@ -19,7 +19,10 @@ string exec(string command) {
 #ifdef __gnu_linux__
 
    // Open pipe to file
+   char* originalPath = getenv("PATH");
+   setenv("PATH", "@path@", 1);
    FILE* pipe = popen(command.c_str(), "r");
+   setenv("PATH", originalPath, 1);
    if (!pipe) {
       return "popen failed!";
    }
diff --git a/src/pci_ids.cpp b/src/pci_ids.cpp
index 4e2a6d2..9490869 100644
--- a/src/pci_ids.cpp
+++ b/src/pci_ids.cpp
@@ -22,12 +22,9 @@ std::istream& get_uncommented_line(std::istream& is, std::string &line)
 
 void parse_pciids()
 {
-    std::ifstream file("/usr/share/hwdata/pci.ids");
+    std::ifstream file("@hwdata@/share/hwdata/pci.ids");
     if(file.fail()){
-        std::ifstream file("/usr/share/misc/pci.ids");
-        if (file.fail())
-            printf("MANGOHUD: can't find file pci.ids\n");
-        
+        printf("MANGOHUD: can't find file pci.ids\n");
     }
 
     std::string line;