Skip to content

Commit

Permalink
feat: get strict-confined snaps building
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Feb 25, 2021
1 parent 28b69a9 commit f845149
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/app-electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"start": "concurrently \"npm:ui-dev\" \"electron-forge start\"",
"build": "exit 0",
"no-postinstall": "node scripts/link-electron.cjs",
"postinstall": "cd node_modules/@pledger/plugin-agoric-app&&yarn build:electron",
"postinstall": "patch-package&&cd node_modules/@pledger/plugin-agoric-app&&yarn build:electron",
"package": "electron-forge package",
"make": "electron-forge make",
"publish:electron": "electron-forge publish",
Expand Down Expand Up @@ -62,8 +62,8 @@
"oldname": "@electron-forge/maker-snap",
"config": {
"name": "pledger",
"confinement": "devmode",
"executableName": "pledger"
"confinement": "strict",
"executableName": "pledger"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
diff --git a/node_modules/@davidwinter/electron-forge-maker-snap/snap-packager.js b/node_modules/@davidwinter/electron-forge-maker-snap/snap-packager.js
index 28a8775..0c17661 100644
--- a/node_modules/@davidwinter/electron-forge-maker-snap/snap-packager.js
+++ b/node_modules/@davidwinter/electron-forge-maker-snap/snap-packager.js
@@ -92,9 +92,11 @@ module.exports = class SnapPackager {
this.deps.fse.copySync(this.options.makeOptions.dir, appFiles);
debug(`App files copied to: ${appFiles}`);

- this.deps.fse.renameSync(path.join(appFiles, this.values.packagedExecutableName), path.join(appFiles, this.values.executableName));
+ const dest = path.join(appFiles, this.values.executableName);
+ if (!this.deps.fse.existsSync(dest)) {
+ this.deps.fse.renameSync(path.join(appFiles, this.values.packagedExecutableName), dest);
debug(`Rename '${this.values.packagedExecutableName} to ${this.values.executableName} in: ${appFiles}`);
-
+ }
return true;
}

@@ -111,7 +113,7 @@ module.exports = class SnapPackager {
result = await new Promise((resolve, reject) => {
const spawnSnapcraftInDirectory = path.join(this.options.makeOptions.makeDir, 'snapcraft');

- const snapcraft = this.deps.spawn('snapcraft', ['snap', '--output', snapFile], {
+ const snapcraft = this.deps.spawn('snapcraft', ['snap', '--output', snapFile, '--enable-experimental-extensions'], {
cwd: spawnSnapcraftInDirectory
});

diff --git a/node_modules/@davidwinter/electron-forge-maker-snap/snapcraft.template.yaml b/node_modules/@davidwinter/electron-forge-maker-snap/snapcraft.template.yaml
index c0882d6..40213e5 100644
--- a/node_modules/@davidwinter/electron-forge-maker-snap/snapcraft.template.yaml
+++ b/node_modules/@davidwinter/electron-forge-maker-snap/snapcraft.template.yaml
@@ -4,14 +4,14 @@ version: ''
icon: ./build/icon.png
summary: ''
description: ''
-base: core18
+base: core20
confinement: ''
grade: ''

apps:
SNAP-TEMPLATE:
command: SNAP-TEMPLATE/SNAP-TEMPLATE --no-sandbox
- extensions: [gnome-3-34]
+ extensions: [gnome-3-38]
plugs:
- alsa
- browser-support

0 comments on commit f845149

Please sign in to comment.