mirror of
https://github.com/encounter/linuxdeploy.git
synced 2026-07-10 12:18:44 -07:00
Add $LINUXDEPLOY for input plugins
The input plugins can use this environment variable to call linuxdeploy themselves. This can be very handy to have it deploy additional dependencies on libraries they copy themselves. An alternative approach is to simply use liblinuxdeploy inside the plugin, like the Qt plugin does.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
|
||||
// local headers
|
||||
#include "linuxdeploy/core/log.h"
|
||||
#include "linuxdeploy/util/util.h"
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -136,8 +137,21 @@ namespace linuxdeploy {
|
||||
}
|
||||
log << std::endl;
|
||||
|
||||
auto process = subprocess::Popen(args, subprocess::output{subprocess::PIPE}, subprocess::error{subprocess::PIPE});
|
||||
std::map<std::string, std::string> environmentVariables{};
|
||||
|
||||
if (this->pluginType() == PLUGIN_TYPE::INPUT_TYPE) {
|
||||
// add $LINUXDEPLOY, which points to the current binary
|
||||
// we do not need to pass $APPIMAGE or alike, since while linuxdeploy is running, the path in the
|
||||
// temporary mountpoint of its AppImage will be valid anyway
|
||||
environmentVariables["LINUXDEPLOY"] = linuxdeploy::util::getOwnExecutablePath();
|
||||
}
|
||||
|
||||
auto process = subprocess::Popen(
|
||||
args,
|
||||
subprocess::output{subprocess::PIPE},
|
||||
subprocess::error{subprocess::PIPE},
|
||||
subprocess::environment{environmentVariables}
|
||||
);
|
||||
|
||||
std::vector<pollfd> pfds(2);
|
||||
auto* opfd = &pfds[0];
|
||||
|
||||
Reference in New Issue
Block a user