Automated reviews and snapcraft < 2.38

For the benefit of @jdstrand this is how I’m building it.

I setup a lxc container and in it, installed node:

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
apt install nodejs=8.11.1-1nodesource1

Install other bits to build:

apt install make g++ snapcraft
npm install --global yarn

Building the thing.

Here’s a patch I use to enable snap builds. In it we also nudge the version of electron-builder, and disable all other builds because I only need a snap. It’s snap_package_json.patch referred to below.

--- Signal-Desktop/package.json 2018-04-19 21:37:05.136973946 +0000
+++ Signal-Desktop-snap/package.json    2018-04-19 21:39:42.759831008 +0000
@@ -105,7 +105,7 @@
     "bower": "^1.8.2",
     "chai": "^4.1.2",
     "electron": "1.8.4",
-    "electron-builder": "^20.2.0",
+    "electron-builder": "^20.9.2",
     "electron-icon-maker": "0.0.3",
     "electron-publisher-s3": "^20.2.0",
     "eslint": "^4.14.0",
@@ -203,11 +203,13 @@
       },
       "asarUnpack": "node_modules/spellchecker/vendor/hunspell_dictionaries",
       "target": [
-        "deb",
-        "zip"
+        "snap"
       ],
       "icon": "build/icons/png"
     },
+    "snap": {
+      "plugs": ["default", "desktop"]
+    },
     "deb": {
       "depends": [
         "gconf2",

Building it.

#!/bin/bash

rm -rf ~/.cache/snapcraft

SIGNAL_ENV=production
workdir=$(mktemp -d -p ~)

echo "Build tip of master"
cd $workdir
git clone https://github.com/signalapp/Signal-Desktop.git latest
cd latest
patch < ~/snap_package_json.patch
npm install
# Normally we use --frozen-lockfile, but as we nudge e-b version we can't do that
#yarn install --frozen-lockfile
yarn install
yarn grunt
yarn icon-gen
npm run build-release -- -l
ls $workdir/latest/release/*.snap

That should get you a working snap.