Skip to content

Commit

Permalink
linux: Add Snap support for Linux.
Browse files Browse the repository at this point in the history
This adds a new build configs in package.json for electron-builder
to be able to generate a snap package for zulip. 

Fixes #443.
  • Loading branch information
robgev authored and akashnimare committed Mar 26, 2018
1 parent a13558f commit 4f96df4
Show file tree
Hide file tree
Showing 5 changed files with 205 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ node_modules/
# Compiled binary build directory
dist/

#snap generated files
snap/parts
snap/prime
snap/snap
snap/stage
snap/*.snap

# Logs
logs
*.log
Expand Down
5 changes: 3 additions & 2 deletions development.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ To build and run the app from source, you'll need the following:
* [Python](https://www.python.org/downloads/release/python-2713/)
(v2.7.x recommended)
* A C++ compiler compatible with C++11
* Linux users also need [Snapcraft](https://snapcraft.io/)
* Development headers for the libXext, libXtst, and libxkbfile libraries

### Debian/Ubuntu and friends
Expand All @@ -25,7 +26,7 @@ manager (see [here][nodesource-install] for more on the first command):

```sh
$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
$ sudo apt install git nodejs python build-essential libxext-dev libxtst-dev libxkbfile-dev libgconf-2-4
$ sudo apt install git nodejs python build-essential snapcraft libxext-dev libxtst-dev libxkbfile-dev libgconf-2-4
```

[nodesource-install]: https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
Expand Down Expand Up @@ -76,7 +77,7 @@ This command will produce distributable packages or installers for the
operating system you're running on:
* on Windows, a Windows installer file
* on macOS, a `.dmg` file
* on Linux, a plain `.zip` file as well as a `.deb` file and an
* on Linux, a plain `.zip` file as well as a `.deb` file, `.snap` file and an
`AppImage` file.
To generate all three types, you will need all three operating
systems.
Expand Down
154 changes: 153 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
"target": [
"deb",
"zip",
"AppImage"
"AppImage",
"snap"
],
"maintainer": "Akash Nimare <[email protected]>"
},
Expand All @@ -64,6 +65,9 @@
"afterInstall": "./scripts/debian-add-repo.sh",
"afterRemove": "./scripts/debian-uninstaller.sh"
},
"snap": {
"synopsis": "Zulip Desktop App"
},
"dmg": {
"background": "build/appdmg.png",
"icon": "build/icon.icns",
Expand Down
37 changes: 37 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: zulip
version: 1.8.2
summary: Zulip
description: Zulip Desktop Client for Linux
confinement: strict
grade: stable
icon: ../build/icon.png
apps:
zulip:
command: env TMPDIR=$XDG_RUNTIME_DIR desktop-launch $SNAP/zulip
plugs:
- desktop
- desktop-legacy
- home
- x11
- unity7
- browser-support
- network
- gsettings
- pulseaudio
- opengl
parts:
app:
plugin: dump
stage-packages:
- libasound2
- libgconf2-4
- libnotify4
- libnspr4
- libnss3
- libpcre3
- libpulse0
- libxss1
- libxtst6
source: ../dist/linux-unpacked
after:
- desktop-gtk2

0 comments on commit 4f96df4

Please sign in to comment.