Skip to content

Commit

Permalink
Merge commit '2ee441781b6756c9b0071dc92efddf144c71ef9f' into macos-tray
Browse files Browse the repository at this point in the history
* commit '2ee441781b6756c9b0071dc92efddf144c71ef9f': (34 commits)
  publish amplify event when deleting conversation
  Use libsodium-neon (wireapp#610)
  Release 2.13.2742
  Bump electron to version '1.6.8' (wireapp#618)
  Preceed offline check when starting the app (wireapp#608)
  Prevent duplicate tray icon on update (wireapp#599)
  Release 2.13.2741
  Fix debian pre/post-install scripts (wireapp#603)
  Release 2.13.2740
  End app with exit on makeSingleInstance check (WEBAPP-3848) (wireapp#593)
  Bump electron version to 1.6.7 (wireapp#592)
  Remove testing URLs (wireapp#589)
  chore(package): update grunt-contrib-clean to version 1.1.0 (wireapp#570)
  check for XDG_CURRENT_DESKTOP (wireapp#587)
  Workaround Ubuntu 17.04 tray bug (wireapp#576)
  Make "unofficial" build options modular and dynamic (wireapp#568)
  Update release notes link (wireapp#573)
  Add repository for Debian/Ubuntu (wireapp#566)
  Release 2.13.2739
  Rename package to wire-desktop (wireapp#550)
  ...

# Conflicts:
#	package.json
  • Loading branch information
sidneys committed May 5, 2017
2 parents b62259b + 2ee4417 commit 7aee150
Show file tree
Hide file tree
Showing 63 changed files with 670 additions and 140 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ cache:
- node_modules
- electron/node_modules

before_install:
- curl https://sh.rustup.rs -sSf | sh -s -- -y
- source "$HOME/.cargo/env"

install:
- npm install

Expand Down
78 changes: 62 additions & 16 deletions Gruntfile.coffee
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Wire
# Copyright (C) 2016 Wire Swiss GmbH
# Copyright (C) 2017 Wire Swiss GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -18,6 +18,7 @@

electron_packager = require 'electron-packager'
createWindowsInstaller = require('electron-winstaller').createWindowsInstaller
electron_builder = require 'electron-builder'

ELECTRON_PACKAGE_JSON = 'electron/package.json'
PACKAGE_JSON = 'package.json'
Expand All @@ -37,7 +38,7 @@ module.exports = (grunt) ->
dist: 'wrap/dist'
win: 'wrap/**/<%= info.name %>-win*'
macos: 'wrap/**/<%= info.name %>-darwin*'
linux: ['wrap/**/<%= info.name %>-linux*', 'wrap/dist']
linux: ['wrap/**/linux*', 'wrap/**/wire*']
pkg: '*.pkg'

'update-keys':
Expand Down Expand Up @@ -111,6 +112,41 @@ module.exports = (grunt) ->
ProductName: '<%= info.name %>'
InternalName: '<%= info.name %>.exe'

electronbuilder:
options:
asar: false
arch: 'all'
linux_prod:
options:
productName: 'wire-desktop'
targets: ['deb', 'AppImage']
linux:
fpm: ['--name', 'wire-desktop']
executableName: 'wire-desktop'
afterInstall: 'bin/deb/after-install.tpl'
afterRemove: 'bin/deb/after-remove.tpl'
category: 'Network'
depends: ['libappindicator1', 'libasound2', 'libgconf-2-4', 'libnotify-bin', 'libnss3', 'libxss1']
linux_internal:
options:
productName: 'wire-desktop-internal'
targets: ['deb', 'AppImage']
linux:
fpm: ['--name', 'wire-desktop-internal']
executableName: 'wire-desktop-internal'
afterInstall: 'bin/deb/after-install.tpl'
afterRemove: 'bin/deb/after-remove.tpl'
category: 'Network'
depends: ['libappindicator1', 'libasound2', 'libgconf-2-4', 'libnotify-bin', 'libnss3', 'libxss1']
linux_other:
options:
arch: "#{grunt.option('arch') || process.arch}"
productName: 'wire-desktop'
targets: ["#{grunt.option('target') || 'dir'}"]
linux:
fpm: ['--name', 'wire-desktop']
executableName: 'wire-desktop'

'create-windows-installer':
internal:
title: '<%= info.nameInternal %>'
Expand Down Expand Up @@ -165,25 +201,18 @@ module.exports = (grunt) ->
owner : 'wireapp'
repository : 'wire-desktop'

shell:
linux64:
command: 'build --linux --x64'
linux32:
command: 'build --linux --ia32'


###############################################################################
# Tasks
###############################################################################
grunt.registerTask 'build-inc', ->
info = grunt.config.get 'info'
info.build = "#{parseInt(info.build, 10) + 1 }"
info.build = "#{parseInt(info.build, 10) + 1}"
grunt.config.set 'info', info
grunt.file.write INFO_JSON, JSON.stringify(info, null, 2) + '\n'
grunt.file.write INFO_JSON, "#{JSON.stringify info, null, 2}\n"

electron_pkg = grunt.file.readJSON ELECTRON_PACKAGE_JSON
electron_pkg.version = "#{info.version}.#{info.build}"
grunt.file.write ELECTRON_PACKAGE_JSON, JSON.stringify(electron_pkg, null, 2) + '\n'
grunt.file.write ELECTRON_PACKAGE_JSON, "#{JSON.stringify electron_pkg, null, 2}\n"

grunt.log.write("Build number increased to #{info.build} ").ok();

Expand All @@ -194,7 +223,7 @@ module.exports = (grunt) ->
electron_pkg.environment = 'internal'
electron_pkg.name = info.nameInternal.toLowerCase()
electron_pkg.productName = info.nameInternal
grunt.file.write ELECTRON_PACKAGE_JSON, JSON.stringify(electron_pkg, null, 2) + '\n'
grunt.file.write ELECTRON_PACKAGE_JSON, "#{JSON.stringify electron_pkg, null, 2}\n"
grunt.log.write("Releases URL points to #{electron_pkg.updateWinUrl} ").ok();

grunt.registerTask 'release-prod', ->
Expand All @@ -204,7 +233,7 @@ module.exports = (grunt) ->
electron_pkg.environment = 'production'
electron_pkg.name = info.name.toLowerCase()
electron_pkg.productName = info.name
grunt.file.write ELECTRON_PACKAGE_JSON, JSON.stringify(electron_pkg, null, 2) + '\n'
grunt.file.write ELECTRON_PACKAGE_JSON, "#{JSON.stringify electron_pkg, null, 2}\n"
grunt.log.write("Releases URL points to #{electron_pkg.updateWinUrl} ").ok();

grunt.registerMultiTask 'electron', 'Package Electron apps', ->
Expand All @@ -215,6 +244,23 @@ module.exports = (grunt) ->
else
done()

grunt.registerMultiTask 'electronbuilder', 'Build Electron apps', ->
done = @async()
options = @options()
targets = options.targets
delete options.targets
arch = options.arch
delete options.arch

if arch == 'all'
electron_builder.build
targets: electron_builder.Platform.LINUX.createTarget targets, electron_builder.Arch.ia32, electron_builder.Arch.x64
config: options
else
electron_builder.build
targets: electron_builder.Platform.LINUX.createTarget targets, electron_builder.archFromString arch
config: options

grunt.registerTask 'update-keys', ->
options = @options()

Expand Down Expand Up @@ -266,5 +312,5 @@ module.exports = (grunt) ->
grunt.registerTask 'win', ['clean:win', 'update-keys', 'release-internal', 'electron:win_internal', 'create-windows-installer:internal']
grunt.registerTask 'win-prod', ['clean:win', 'update-keys', 'release-prod', 'electron:win_prod', 'create-windows-installer:prod']

grunt.registerTask 'linux', ['clean:linux', 'update-keys', 'release-internal', 'shell']
grunt.registerTask 'linux-prod', ['clean:linux', 'update-keys', 'release-prod', 'shell']
grunt.registerTask 'linux', ['clean:linux', 'update-keys', 'release-internal', 'electronbuilder:linux_internal']
grunt.registerTask 'linux-prod', ['clean:linux', 'update-keys', 'release-prod', 'electronbuilder:linux_prod']
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ npm run build:win
npm run build:linux
```

### Other Linux targets or architectures

If you would like to build for another Linux target or architecture, run the following commands:

```bash
grunt 'clean:linux' 'update-keys' 'release-prod'
grunt --arch=<arch> --target=<target> 'electronbuilder:linux_other'
```

Replace `<arch>` and `<target>` with your desired architecture (e.g. `"ia32"`) and target (e.g. `"rpm"`). Have a look at the [documentation for `electron-builder`](https://github.com/electron-userland/electron-builder/wiki/Options) for the available options. Note that we cannot offer support for uncommon architectures or targets.

### Troubleshooting

If you are having troubles building Wire for Desktop, then [our troubleshooting page](https://github.com/wireapp/wire-desktop/wiki/Troubleshooting) might be of help.
Expand Down
20 changes: 19 additions & 1 deletion bin/deb/after-install.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
#!/bin/bash

old_exec="/opt/Wire/wire";

# Warn if old package is still installed
if test -e "${old_exec}"; then
echo "WARNING: It seems that there are files from the old Wire package on"
echo "your machine. We highly recommend that you remove the old version"
echo "and then reinstall this package. You can remove the old package with"
echo "the following command:"
echo "sudo apt-get remove wire"
fi

# Clean up old invalid links
if [ -L '/usr/local/bin/wire' ] || [ -L '/usr/local/bin/<%= executable %>' ]; then
echo "Removing old invalid symlinks"
if [ -L '/usr/local/bin/wire' ] && [ "$(readlink '/usr/local/bin/wire')" = "${old_exec}" ]; then rm -f /usr/local/bin/wire; fi
if [ -L '/usr/local/bin/<%= executable %>' ] && [ "$(readlink '/usr/local/bin/<%= executable %>')" = '/opt/<% productFilename %>/<%= executable %>' ]; then rm -f '/usr/local/bin/<%= executable %>'; fi
fi

# Link to the binary
ln -sf '/opt/<%= productFilename %>/<%= executable %>' '/usr/local/bin/<%= executable %>'
ln -sf '/opt/${productFilename}/${executable}' '/usr/bin/${executable}'
2 changes: 1 addition & 1 deletion bin/deb/after-remove.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

# Delete the link to the binary
rm -f '/usr/bin/<%= executable %>'
rm -f '/usr/bin/${executable}'
28 changes: 25 additions & 3 deletions bin/linux-prod-s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#
# Wire
# Copyright (C) 2016 Wire Swiss GmbH
# Copyright (C) 2017 Wire Swiss GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -48,10 +48,32 @@ def upload_file(source, dest):
version = '%s.%s' % (info['version'], info['build'])

files = [
'wire_%s_i386.deb' % version,
'wire_%s_amd64.deb' % version,
'wire-%s-ia32.AppImage' % version,
'wire-%s-x86_64.AppImage' % version,
'wire_%s_amd64.deb' % version,
'wire_%s_i386.deb' % version,
'debian/pool/main/wire_%s_amd64.deb' % version,
'debian/pool/main/wire_%s_i386.deb' % version,
'debian/dists/stable/Contents-all',
'debian/dists/stable/Contents-all.bz2',
'debian/dists/stable/Contents-all.gz',
'debian/dists/stable/Contents-amd64',
'debian/dists/stable/Contents-amd64.bz2',
'debian/dists/stable/Contents-amd64.gz',
'debian/dists/stable/Contents-i386',
'debian/dists/stable/Contents-i386.bz2',
'debian/dists/stable/Contents-i386.gz',
'debian/dists/stable/Release',
'debian/dists/stable/Release.gpg',
'debian/dists/stable/main/binary-all/Packages',
'debian/dists/stable/main/binary-all/Packages.bz2',
'debian/dists/stable/main/binary-all/Packages.gz',
'debian/dists/stable/main/binary-amd64/Packages',
'debian/dists/stable/main/binary-amd64/Packages.bz2',
'debian/dists/stable/main/binary-amd64/Packages.gz',
'debian/dists/stable/main/binary-i386/Packages',
'debian/dists/stable/main/binary-i386/Packages.bz2',
'debian/dists/stable/main/binary-i386/Packages.gz',
]

for filename in files:
Expand Down
2 changes: 1 addition & 1 deletion bin/macos-hockey.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#
# Wire
# Copyright (C) 2016 Wire Swiss GmbH
# Copyright (C) 2017 Wire Swiss GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion bin/macos-mas-hockey.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#
# Wire
# Copyright (C) 2016 Wire Swiss GmbH
# Copyright (C) 2017 Wire Swiss GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
20 changes: 20 additions & 0 deletions bin/repo/conf/apt-ftparchive.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Dir {
ArchiveDir "./debian";
CacheDir "./cache";
};
Default {
Packages::Compress ". gzip bzip2";
Sources::Compress ". gzip bzip2";
Contents::Compress ". gzip bzip2";
};
TreeDefault {
BinCacheDB "packages-$(SECTION)-$(ARCH).db";
Directory "pool/$(SECTION)";
Packages "$(DIST)/$(SECTION)/binary-$(ARCH)/Packages";
SrcDirectory "pool/$(SECTION)";
Contents "$(DIST)/Contents-$(ARCH)";
};
Tree "dists/stable" {
Sections "main";
Architectures "i386 amd64 all";
}
7 changes: 7 additions & 0 deletions bin/repo/conf/stable.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
APT::FTPArchive::Release::Architectures "i386 amd64 all";
APT::FTPArchive::Release::Codename "stable";
APT::FTPArchive::Release::Components "main";
APT::FTPArchive::Release::Description "Cross platform desktop app, wrapping the Wire Webapp. Based on Electron.";
APT::FTPArchive::Release::Label "Wire Desktop";
APT::FTPArchive::Release::Origin "https://github.com/wireapp/wire-desktop";
APT::FTPArchive::Release::Suite "stable";
Loading

0 comments on commit 7aee150

Please sign in to comment.