Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 65 lines 2.5 kB view raw
1diff --git a/common/SC_Filesystem_unix.cpp b/common/SC_Filesystem_unix.cpp 2index 52dc1fd2d..aae09ed9c 100644 3--- a/common/SC_Filesystem_unix.cpp 4+++ b/common/SC_Filesystem_unix.cpp 5@@ -94,6 +94,10 @@ bool SC_Filesystem::isNonHostPlatformDirectoryName(const std::string& s) { 6 } 7 8 Path SC_Filesystem::defaultSystemAppSupportDirectory() { 9+ const char* sc_data_dir = getenv("SC_DATA_DIR"); 10+ if (sc_data_dir) 11+ return Path(sc_data_dir); 12+ 13 # ifdef SC_DATA_DIR 14 return Path(SC_DATA_DIR); 15 # else 16@@ -125,6 +129,10 @@ Path SC_Filesystem::defaultUserConfigDirectory() { 17 } 18 19 Path SC_Filesystem::defaultResourceDirectory() { 20+ const char* sc_data_dir = getenv("SC_DATA_DIR"); 21+ if (sc_data_dir) 22+ return Path(sc_data_dir); 23+ 24 # ifdef SC_DATA_DIR 25 return Path(SC_DATA_DIR); 26 # else 27diff --git a/server/scsynth/SC_Lib_Cintf.cpp b/server/scsynth/SC_Lib_Cintf.cpp 28index f6219307e..28e13eb98 100644 29--- a/server/scsynth/SC_Lib_Cintf.cpp 30+++ b/server/scsynth/SC_Lib_Cintf.cpp 31@@ -178,9 +178,13 @@ void initialize_library(const char* uGensPluginPath) { 32 using DirName = SC_Filesystem::DirName; 33 34 if (loadUGensExtDirs) { 35+ const char* sc_plugin_dir = getenv("SC_PLUGIN_DIR"); 36+ if (sc_plugin_dir) { 37+ PlugIn_LoadDir(sc_plugin_dir, true); 38+ } 39 #ifdef SC_PLUGIN_DIR 40 // load globally installed plugins 41- if (bfs::is_directory(SC_PLUGIN_DIR)) { 42+ else if (bfs::is_directory(SC_PLUGIN_DIR)) { 43 PlugIn_LoadDir(SC_PLUGIN_DIR, true); 44 } 45 #endif // SC_PLUGIN_DIR 46diff --git a/server/supernova/server/main.cpp b/server/supernova/server/main.cpp 47index b2b5adf4e..6cb8c411c 100644 48--- a/server/supernova/server/main.cpp 49+++ b/server/supernova/server/main.cpp 50@@ -224,8 +224,14 @@ void set_plugin_paths(server_arguments const& args, nova::sc_ugen_factory* facto 51 } 52 } 53 } else { 54+ const char* sc_plugin_dir = getenv("SC_PLUGIN_DIR"); 55+ if (sc_plugin_dir) { 56+ factory->load_plugin_folder(sc_plugin_dir); 57+ } 58 #ifdef SC_PLUGIN_DIR 59- factory->load_plugin_folder(SC_PLUGIN_DIR); 60+ else { 61+ factory->load_plugin_folder(SC_PLUGIN_DIR); 62+ } 63 #endif 64 factory->load_plugin_folder(SC_Filesystem::instance().getDirectory(DirName::Resource) / SC_PLUGIN_DIR_NAME); 65 factory->load_plugin_folder(SC_Filesystem::instance().getDirectory(DirName::SystemExtension));