Skip to content

Commit 679904c

Browse files
committed
Add $LINUXDEPLOY_PLUGIN_MODE
This enables a special mode used for plugins that intend to call linuxdeploy via $LINUXDEPLOY. It skips the finishing steps to make sure they are not run prematurely. Consider this a workaround to a bug in the AppDir root dir deployment.
1 parent 6b96159 commit 679904c

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/main.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,21 @@ int main(int argc, char** argv) {
311311
return 1;
312312
}
313313
}
314+
315+
// linuxdeploy offers a special "plugin mode" where plugins can run linuxdeploy again to deploy dependencies
316+
// this way, they don't have to use liblinuxdeploy (like, e.g., the Qt plugin), but can just be, e.g., shell scripts
317+
// copying .so files into the AppDir
318+
// as linuxdeploy aims to be idempotent, so this just costs some time/performance/file I/O, but should not change
319+
// the outcome
320+
// the AppDir root deployment, however, does make some assumptions that are only valid when not being run from a
321+
// plugin
322+
// therefore, we let plugins signalize that they are calling linuxdeploy, and skip those steps
323+
// TODO: eliminate the need for this mode in the AppDir root deployment
324+
if (getenv("LINUXDEPLOY_PLUGIN_MODE") != nullptr) {
325+
ldLog() << LD_WARNING << "Running in plugin mode, exiting" << std::endl;
326+
return 0;
327+
}
328+
314329
if (!linuxdeploy::deployAppDirRootFiles(desktopFilePaths.Get(), customAppRunPath.Get(), appDir))
315330
return 1;
316331

0 commit comments

Comments
 (0)