Skip to content

Commit

Permalink
slack: 4.4.3 -> 4.7.0 (linux), 4.6.0 -> 4.8.0 (darwin)
Browse files Browse the repository at this point in the history
  • Loading branch information
sikmir committed Jul 31, 2020
1 parent c31de49 commit 60be954
Showing 1 changed file with 27 additions and 26 deletions.
53 changes: 27 additions & 26 deletions pkgs/applications/networking/instant-messengers/slack/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ stdenv
, fetchurl
, dpkg
, undmg
, makeWrapper
, nodePackages
, alsaLib
Expand All @@ -19,10 +20,12 @@
, gnome2
, gtk3
, libappindicator-gtk3
, libdrm
, libnotify
, libpulseaudio
, libuuid
, libxcb
, mesa
, nspr
, nss
, pango
Expand All @@ -32,21 +35,26 @@
}:

let

pname = "slack";

inherit (stdenv.hostPlatform) system;

throwSystem = throw "Unsupported system: ${system}";

sha256 = {
x86_64-darwin = "09daxnqxyccshkrmr7ysgjvgvgmlgd590ym68fz0l8n6ayfpkgw0";
x86_64-linux = "00ihhsgxm441nsmav7pq4n4y9s7p2r4x5dqld160658xyqi836cq";
pname = "slack";
version = {
x86_64-darwin = "4.8.0";
x86_64-linux = "4.7.0";
}.${system} or throwSystem;

version = {
x86_64-darwin = "4.6.0";
x86_64-linux = "4.4.3";
src = let
base = "https://downloads.slack-edge.com";
in {
x86_64-darwin = fetchurl {
url = "${base}/releases/macos/${version}/prod/x64/Slack-${version}-macOS.dmg";
sha256 = "0k22w3c3brbc7ivmc5npqy8h7zxfgnbs7bqwii03psymm6sw53j2";
};
x86_64-linux = fetchurl {
url = "${base}/linux_releases/slack-desktop-${version}-amd64.deb";
sha256 = "1nwyl70caaz9k0hccfpkjli0jjc6m9zbjb3nf4bwmykpbxbzr9w3";
};
}.${system} or throwSystem;

meta = with stdenv.lib; {
Expand All @@ -58,11 +66,7 @@ let
};

linux = stdenv.mkDerivation rec {
inherit pname meta version;
src = fetchurl {
url = "https://downloads.slack-edge.com/linux_releases/slack-desktop-${version}-amd64.deb";
inherit sha256;
};
inherit pname version src meta;

rpath = stdenv.lib.makeLibraryPath [
alsaLib
Expand All @@ -81,10 +85,12 @@ let
gnome2.GConf
gtk3
libappindicator-gtk3
libdrm
libnotify
libpulseaudio
libuuid
libxcb
mesa
nspr
nss
pango
Expand Down Expand Up @@ -143,21 +149,16 @@ let
'';
};

darwin = stdenv.mkDerivation rec {
inherit pname meta version;
darwin = stdenv.mkDerivation {
inherit pname version src meta;

phases = [ "installPhase" ];
nativeBuildInputs = [ undmg ];

src = fetchurl {
url = "https://downloads.slack-edge.com/mac_releases/Slack-${version}-macOS.dmg";
inherit sha256;
};
sourceRoot = "Slack.app";

installPhase = ''
/usr/bin/hdiutil mount -nobrowse -mountpoint slack-mnt $src
mkdir -p $out/Applications
cp -r ./slack-mnt/Slack.app $out/Applications
/usr/bin/hdiutil unmount slack-mnt
mkdir -p $out/Applications/Slack.app
cp -R . $out/Applications/Slack.app
/usr/bin/defaults write com.tinyspeck.slackmacgap SlackNoAutoUpdates -bool YES
'';
};
Expand Down

0 comments on commit 60be954

Please sign in to comment.