nixpkgs/pkgs/tools/graphics/mangohud/hardcode-dependencies.patch

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
1.9 KiB
Diff
Raw Normal View History

2021-05-01 19:34:28 +00:00
diff --git a/src/dbus.cpp b/src/dbus.cpp
2021-06-19 14:54:43 +00:00
index 44ffafc..9baf57b 100644
2021-05-01 19:34:28 +00:00
--- a/src/dbus.cpp
+++ b/src/dbus.cpp
2021-06-19 14:54:43 +00:00
@@ -162,7 +162,7 @@ bool dbus_manager::init(const std::string& requested_player) {
return true;
2021-05-01 19:34:28 +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")) {
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
2021-06-19 14:54:43 +00:00
index ee8600b..c7c91a0 100644
2021-05-01 19:34:28 +00:00
--- a/src/logging.cpp
+++ b/src/logging.cpp
2021-06-19 14:54:43 +00:00
@@ -19,7 +19,10 @@ string exec(string command) {
#ifdef __gnu_linux__
2021-05-01 19:34:28 +00:00
// 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;