2019-11-28 11:05:17 +00:00
|
|
|
{ atomEnv
|
|
|
|
, autoPatchelfHook
|
|
|
|
, dpkg
|
|
|
|
, fetchurl
|
|
|
|
, makeDesktopItem
|
|
|
|
, makeWrapper
|
|
|
|
, stdenv
|
2020-08-12 19:23:07 +01:00
|
|
|
, lib
|
2019-11-28 11:05:17 +00:00
|
|
|
, udev
|
|
|
|
, wrapGAppsHook
|
|
|
|
, cpio
|
|
|
|
, xar
|
2020-08-25 22:43:29 +01:00
|
|
|
, libdbusmenu
|
2018-04-11 19:46:23 +01:00
|
|
|
}:
|
2019-03-21 02:24:04 +00:00
|
|
|
|
2018-04-11 19:46:23 +01:00
|
|
|
let
|
2019-03-21 02:24:04 +00:00
|
|
|
|
2019-07-16 23:09:29 +01:00
|
|
|
inherit (stdenv.hostPlatform) system;
|
2018-04-11 19:46:23 +01:00
|
|
|
|
2019-08-04 10:08:33 +01:00
|
|
|
throwSystem = throw "Unsupported system: ${system}";
|
|
|
|
|
2019-03-21 02:24:04 +00:00
|
|
|
pname = "wire-desktop";
|
|
|
|
|
2019-07-16 23:09:29 +01:00
|
|
|
version = {
|
2020-10-30 07:54:19 +00:00
|
|
|
x86_64-darwin = "3.21.3959";
|
2020-10-30 07:52:57 +00:00
|
|
|
x86_64-linux = "3.21.2936";
|
2019-08-04 10:08:33 +01:00
|
|
|
}.${system} or throwSystem;
|
2018-04-11 19:46:23 +01:00
|
|
|
|
2019-07-16 23:09:29 +01:00
|
|
|
sha256 = {
|
2020-10-30 07:54:19 +00:00
|
|
|
x86_64-darwin = "0fgzzqf1wnkjbcr0j0vjn6sggkz0z1kx6w4gi7gk4c4markdicm1";
|
2020-10-30 07:52:57 +00:00
|
|
|
x86_64-linux = "033804nkz1fdmq3p8iplrlx708x1fjlr09bmrpy36lqg5h7m3yd6";
|
2019-08-04 10:08:33 +01:00
|
|
|
}.${system} or throwSystem;
|
2018-07-09 23:34:32 +01:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-07-16 23:09:19 +01:00
|
|
|
description = "A modern, secure messenger for everyone";
|
|
|
|
longDescription = ''
|
|
|
|
Wire Personal is a secure, privacy-friendly messenger. It combines useful
|
|
|
|
and fun features, audited security, and a beautiful, distinct user
|
|
|
|
interface. It does not require a phone number to register and chat.
|
|
|
|
|
|
|
|
* End-to-end encrypted chats, calls, and files
|
|
|
|
* Crystal clear voice and video calling
|
|
|
|
* File and screen sharing
|
|
|
|
* Timed messages and chats
|
|
|
|
* Synced across your phone, desktop and tablet
|
|
|
|
'';
|
2019-11-28 11:05:17 +00:00
|
|
|
homepage = "https://wire.com/";
|
|
|
|
downloadPage = "https://wire.com/download/";
|
2019-07-16 23:09:19 +01:00
|
|
|
license = licenses.gpl3Plus;
|
2019-11-28 11:05:17 +00:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
arianvp
|
|
|
|
kiwi
|
|
|
|
toonn
|
|
|
|
worldofpeace
|
|
|
|
];
|
|
|
|
platforms = [
|
|
|
|
"x86_64-darwin"
|
|
|
|
"x86_64-linux"
|
|
|
|
];
|
2019-03-21 02:24:04 +00:00
|
|
|
};
|
2018-04-11 19:46:23 +01:00
|
|
|
|
2019-07-16 23:09:29 +01:00
|
|
|
linux = stdenv.mkDerivation rec {
|
|
|
|
inherit pname version meta;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://wire-app.wire.com/linux/debian/pool/main/"
|
2019-11-28 11:05:17 +00:00
|
|
|
+ "Wire-${version}_amd64.deb";
|
2019-07-16 23:09:29 +01:00
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
2019-11-28 11:05:17 +00:00
|
|
|
categories = "Network;InstantMessaging;Chat;VideoConference";
|
2019-07-16 23:09:29 +01:00
|
|
|
comment = "Secure messenger for everyone";
|
2019-12-15 06:46:24 +00:00
|
|
|
desktopName = "Wire";
|
2019-11-28 11:05:17 +00:00
|
|
|
exec = "wire-desktop %U";
|
2019-07-16 23:09:29 +01:00
|
|
|
genericName = "Secure messenger";
|
2019-11-28 11:05:17 +00:00
|
|
|
icon = "wire-desktop";
|
|
|
|
name = "wire-desktop";
|
2019-12-15 06:46:24 +00:00
|
|
|
extraEntries = ''
|
2020-03-24 10:22:03 +00:00
|
|
|
StartupWMClass=Wire
|
2019-12-15 06:46:24 +00:00
|
|
|
'';
|
2019-07-16 23:09:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
dontConfigure = true;
|
2019-11-28 11:05:17 +00:00
|
|
|
dontPatchELF = true;
|
|
|
|
dontWrapGApps = true;
|
2019-07-16 23:09:29 +01:00
|
|
|
|
2019-11-28 11:05:17 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoPatchelfHook
|
|
|
|
dpkg
|
|
|
|
makeWrapper
|
|
|
|
wrapGAppsHook
|
2019-07-16 23:09:29 +01:00
|
|
|
];
|
|
|
|
|
2019-11-28 11:05:17 +00:00
|
|
|
buildInputs = atomEnv.packages;
|
|
|
|
|
2019-07-16 23:09:29 +01:00
|
|
|
unpackPhase = "dpkg-deb -x $src .";
|
|
|
|
|
|
|
|
installPhase = ''
|
2019-11-28 11:05:17 +00:00
|
|
|
mkdir -p "$out/bin"
|
2019-07-16 23:09:29 +01:00
|
|
|
cp -R "opt" "$out"
|
|
|
|
cp -R "usr/share" "$out/share"
|
|
|
|
chmod -R g-w "$out"
|
|
|
|
|
|
|
|
# Desktop file
|
|
|
|
mkdir -p "$out/share/applications"
|
|
|
|
cp "${desktopItem}/share/applications/"* "$out/share/applications"
|
|
|
|
'';
|
2019-11-28 11:05:17 +00:00
|
|
|
|
|
|
|
runtimeDependencies = [
|
2020-08-12 19:23:07 +01:00
|
|
|
(lib.getLib udev)
|
2020-08-25 22:43:29 +01:00
|
|
|
libdbusmenu
|
2019-11-28 11:05:17 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
makeWrapper $out/opt/Wire/wire-desktop $out/bin/wire-desktop \
|
|
|
|
"''${gappsWrapperArgs[@]}"
|
|
|
|
'';
|
2019-03-21 02:24:04 +00:00
|
|
|
};
|
2018-04-11 19:46:23 +01:00
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
darwin = stdenv.mkDerivation {
|
2019-07-16 23:09:29 +01:00
|
|
|
inherit pname version meta;
|
2018-11-11 03:01:44 +00:00
|
|
|
|
2019-07-16 23:09:29 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/wireapp/wire-desktop/releases/download/"
|
2020-04-06 17:25:29 +01:00
|
|
|
+ "macos%2F${version}/Wire.pkg";
|
2019-07-16 23:09:29 +01:00
|
|
|
inherit sha256;
|
|
|
|
};
|
2018-04-11 19:46:23 +01:00
|
|
|
|
2019-11-28 11:05:17 +00:00
|
|
|
buildInputs = [
|
|
|
|
cpio
|
|
|
|
xar
|
|
|
|
];
|
2018-04-11 19:46:23 +01:00
|
|
|
|
2019-07-16 23:09:29 +01:00
|
|
|
unpackPhase = ''
|
|
|
|
xar -xf $src
|
|
|
|
cd com.wearezeta.zclient.mac.pkg
|
|
|
|
'';
|
2018-04-11 19:46:23 +01:00
|
|
|
|
2019-07-16 23:09:29 +01:00
|
|
|
buildPhase = ''
|
|
|
|
cat Payload | gunzip -dc | cpio -i
|
|
|
|
'';
|
2018-07-09 23:34:32 +01:00
|
|
|
|
2019-07-16 23:09:29 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/Applications
|
|
|
|
cp -r Wire.app $out/Applications
|
|
|
|
'';
|
2019-03-21 02:24:04 +00:00
|
|
|
};
|
2019-07-16 23:09:29 +01:00
|
|
|
|
2019-11-28 11:05:17 +00:00
|
|
|
in
|
|
|
|
if stdenv.isDarwin
|
|
|
|
then darwin
|
|
|
|
else linux
|