aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorilya-fedin <[email protected]>2022-05-14 00:55:17 +0400
committerGitHub <[email protected]>2022-05-13 13:55:17 -0700
commite0d26ba25ab84f5a04a6ad2ef497cd0e93684a40 (patch)
tree19e651bb502b06aadd51836ee65e80043e495a4a /core
parentaf8e756dcb65b5a1744037808d0cfd5d7e574d39 (diff)
Search the installation data directory (#693)
That allows the logic to work on non-FHS distros like NixOS
Diffstat (limited to 'core')
-rw-r--r--core/helpers.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/helpers.cpp b/core/helpers.cpp
index c7e45a8b..6d0863ca 100644
--- a/core/helpers.cpp
+++ b/core/helpers.cpp
@@ -408,6 +408,20 @@ al::vector<std::string> SearchDataFiles(const char *ext, const char *subdir)
DirectorySearch(path.c_str(), ext, &results);
}
+#ifdef ALSOFT_INSTALL_DATADIR
+ // Search the installation data directory
+ {
+ std::string path{ALSOFT_INSTALL_DATADIR};
+ if(!path.empty())
+ {
+ if(path.back() != '/')
+ path += '/';
+ path += subdir;
+ DirectorySearch(path.c_str(), ext, &results);
+ }
+ }
+#endif
+
return results;
}