forked from jitsi/jitsi-meet-electron
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linux: Fix running AppImage on Debian 10+ (jitsi#231)
Modeled after electron-userland/electron-builder#5371 (comment) but written with promised-based fs nodejs API. This allows to drop the app-builder-lib .desktop patch, as --no-sandbox is now part of all linux targets via the additional launcher script, so the arg can be dropped from the .desktop file Exec line. Manual workaround is removed from the README as well.
- Loading branch information
Showing
4 changed files
with
24 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const fs = require('fs').promises; | ||
const path = require('path'); | ||
|
||
/** | ||
* Workaround for https://github.com/electron-userland/electron-builder/issues/5371 | ||
* | ||
* use as "afterPack": "./linux-sandbox-fix.js" in build section of package.json | ||
*/ | ||
async function afterPack({ appOutDir, electronPlatformName, packager }) { | ||
if (electronPlatformName !== 'linux') { | ||
return; | ||
} | ||
|
||
const appName = packager.appInfo.productFilename; | ||
const script = `#!/bin/bash\n"\${BASH_SOURCE%/*}"/${appName}.bin "$@" --no-sandbox`; | ||
const scriptPath = path.join(appOutDir, appName); | ||
|
||
await fs.rename(scriptPath, `${scriptPath}.bin`); | ||
await fs.writeFile(scriptPath, script); | ||
await fs.chmod(scriptPath, 0o755); | ||
} | ||
|
||
module.exports = afterPack; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.