diff options
Diffstat (limited to 'pkgs/development/compilers/yosys/plugin-search-dirs.patch')
-rw-r--r-- | pkgs/development/compilers/yosys/plugin-search-dirs.patch | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/pkgs/development/compilers/yosys/plugin-search-dirs.patch b/pkgs/development/compilers/yosys/plugin-search-dirs.patch deleted file mode 100644 index 354eeddbc2e1..000000000000 --- a/pkgs/development/compilers/yosys/plugin-search-dirs.patch +++ /dev/null @@ -1,45 +0,0 @@ -diff --git i/passes/cmds/plugin.cc w/passes/cmds/plugin.cc -index 08b4aa8c4..f00f540e9 100644 ---- i/passes/cmds/plugin.cc -+++ w/passes/cmds/plugin.cc -@@ -87,15 +87,33 @@ void load_plugin(std::string filename, std::vector<std::string> aliases) - - // We were unable to open the file, try to do so from the plugin directory - if (hdl == NULL && orig_filename.find('/') == std::string::npos) { -- hdl = dlopen([orig_filename]() { -- std::string new_path = proc_share_dirname() + "plugins/" + orig_filename; -+ std::string install_dir = proc_share_dirname() + "plugins"; - -- // Check if we need to append .so -- if (new_path.find(".so") == std::string::npos) -- new_path.append(".so"); -+ vector<string> all_dirs; -+ all_dirs.push_back(install_dir); - -- return new_path; -- }().c_str(), RTLD_LAZY|RTLD_LOCAL); -+ char* plugin_dirs = getenv("NIX_YOSYS_PLUGIN_DIRS"); -+ if (plugin_dirs != NULL) { -+ std::string p(plugin_dirs), t; -+ std::stringstream ss(p); -+ -+ while(std::getline(ss, t, ':')) { -+ all_dirs.push_back(t); -+ } -+ } -+ -+ for (auto dir : all_dirs) { -+ hdl = dlopen([dir, orig_filename]() { -+ std::string new_path = dir + "/" + orig_filename; -+ -+ // Check if we need to append .so -+ if (new_path.find(".so") == std::string::npos) -+ new_path.append(".so"); -+ -+ return new_path; -+ }().c_str(), RTLD_LAZY|RTLD_LOCAL); -+ if (hdl != NULL) break; -+ } - } - - if (hdl == NULL) |