Today let's try to make your own Linux build of Signal Desktop, in .deb and .AppImage format.



Signal is a mobile app developed by Open Whisper Systems.
The app provides instant messaging, voice and video calling, and all communications are end-to-end encrypted.

Signal is free and open source, and also provides a desktop application developed using Electron: all sourcecode is available on GitHub.

So, if you want to try the last version of the desktop app, or if you don't want relying on the pre-builded releases, you can simply build the app on your workstation.

Here the steps (in my case performed on a Debian 9).

First, install build-essential and nvm:

$ sudo apt install build-essential
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash

Then, clone the Signal Desktop git repository...

$ git clone https://github.com/signalapp/Signal-Desktop.git

Install and configure the correct NodeJs version:

$ cd Signal-Desktop

$ nvm use
Found '~/Signal-Desktop/.nvmrc' with version <10.13.0>
N/A: version "v10.13.0" is not yet installed

$ nvm install 10.13.0
Downloading https://nodejs.org/dist/v10.13.0/node-v10.13.0-linux-x64.tar.xz...
######################################################################## 100,0%
WARNING: checksums are currently disabled for node.js v4.0 and later
Now using node v10.13.0 (npm v6.4.1)

$ nvm use
Found '~/Signal-Desktop/.nvmrc' with version <10.13.0>
Now using node v10.13.0 (npm v6.4.1)

Install some dependencies and start building process:

$ npm install --global yarn

$ yarn install --frozen-lockfile

$ yarn grunt

$ yarn icon-gen

$ yarn generate

$ yarn build-release

Now, in the release directory you will find both .deb package and unpacked version:

$ ~/Signal-Desktop$ cd release/
$ ~/Signal-Desktop/release$ ls
builder-effective-config.yaml  linux-unpacked  signal-desktop_1.23.0-beta.4_amd64.deb

Finally, you can create a desktop file in ~/.local/share/applications/signal-desktop.desktop to get a launcher icon:

[Desktop Entry]
Version=1.23.0-beta.4
Terminal=false
Type=Application
Name=Signal Desktop
Exec=env LANGUAGE=tlh /home/andrea/Signal-Desktop/release/linux-unpacked/signal-desktop
Icon=/home/andrea/Signal-Desktop/build/icons/png/128x128.png
StartupWMClass=signal


Bonus: build an AppImage release

If you prefer the, more portable, AppImage format, you can build it with a small change on package.json file, in top source directory.

Search the "Linux" build section:

    "linux": {
      "category": "Network",
      "desktop": {
        "StartupWMClass": "Signal"
      },
      "asarUnpack": "node_modules/spellchecker/vendor/hunspell_dictionaries",
      "target": [
        "deb"        
      ],
      "icon": "build/icons/png"
    },

and add the "AppImage" target:

    "linux": {
      "category": "Network",
      "desktop": {
        "StartupWMClass": "Signal"
      },
      "asarUnpack": "node_modules/spellchecker/vendor/hunspell_dictionaries",
      "target": [
        "deb",
        "AppImage"
      ],
      "icon": "build/icons/png"
    },

then execute

$ yarn build-release

And here the result in release directory:

$ ~/Signal-Desktop$ cd release/
$ ~/Signal-Desktop/release$ ls
builder-effective-config.yaml  latest-linux.yml  linux-unpacked  signal-desktop_1.23.0-beta.4_amd64.deb  signal-desktop-1.23.0-beta.4-x86_64.AppImage

P.S. The builds created during the making of this article are available here.


References