Skip to content

Commit

Permalink
Linux: Fix running AppImage on Debian 10+ (jitsi#231)
Browse files Browse the repository at this point in the history
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
csett86 committed Mar 28, 2021
1 parent 4c0a96d commit 662f976
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 17 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,8 @@ Builtin auto-updates are not yet handled in macOS due to unsigned build.

### GNU/Linux

There is a known issue which prevents the app from starting on some Linux distributions: [#231](https://github.com/jitsi/jitsi-meet-electron/issues/231)

If after downloading it, you can't execute the file directly, try running `chmod u+x ./jitsi-meet-x86_64.AppImage`

The workaround for now is to launch the app like so: `./jitsi-meet-x86_64.AppImage --no-sandbox`

<details><summary>NOTE for old GNU/Linux distributions</summary>

You might get the following error:
Expand Down
23 changes: 23 additions & 0 deletions linux-sandbox-fix.js
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;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"appId": "org.jitsi.jitsi-meet",
"productName": "Jitsi Meet",
"generateUpdatesFilesForAllChannels": true,
"afterPack": "./linux-sandbox-fix.js",
"files": [
"**/*",
"resources",
Expand Down
13 changes: 0 additions & 13 deletions patches/app-builder-lib+22.10.5.patch

This file was deleted.

0 comments on commit 662f976

Please sign in to comment.