From d7f2ab0ed81db4ee2a111a613fd20907da1ddd74 Mon Sep 17 00:00:00 2001 From: talyz Date: Fri, 15 Nov 2019 18:36:08 +0100 Subject: [PATCH] slack: 4.0.2 -> 4.1.2 Also: - Add missing dependency on libpulseaudio - Extract the deb in the build folder and move only the files we're interested in to $out - Use the regular builder, but turn off the patchELF hook - Move dpkg from buildInputs to nativeBuildInputs, since it's only used at build time --- .../instant-messengers/slack/default.nix | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/slack/default.nix b/pkgs/applications/networking/instant-messengers/slack/default.nix index d3aa302d601a..a16023f307d5 100644 --- a/pkgs/applications/networking/instant-messengers/slack/default.nix +++ b/pkgs/applications/networking/instant-messengers/slack/default.nix @@ -1,16 +1,17 @@ { theme ? null, stdenv, fetchurl, dpkg, makeWrapper , alsaLib, atk, cairo, cups, curl, dbus, expat, fontconfig, freetype, glib , gnome2, gtk3, gdk-pixbuf, libappindicator-gtk3, libnotify, libxcb, nspr, nss, pango , systemd, xorg, -at-spi2-atk, libuuid, nodePackages +at-spi2-atk, at-spi2-core, libuuid, nodePackages, libpulseaudio }: let - version = "4.0.2"; + version = "4.1.2"; rpath = stdenv.lib.makeLibraryPath [ alsaLib at-spi2-atk + at-spi2-core atk cairo cups @@ -32,6 +33,7 @@ let stdenv.cc.cc systemd libuuid + libpulseaudio xorg.libxkbfile xorg.libX11 @@ -51,7 +53,7 @@ let if stdenv.hostPlatform.system == "x86_64-linux" then fetchurl { url = "https://downloads.slack-edge.com/linux_releases/slack-desktop-${version}-amd64.deb"; - sha256 = "053j5py16ilpwy868rhh5l2g93xj1fq4fwxrsi2bkfsnmq261hkm"; + sha256 = "0a1b2k81hm1lfrdb47gmd07jqb7hva9sxsiph7b3iwzpzw8pjrkh"; } else throw "Slack is not supported on ${stdenv.hostPlatform.system}"; @@ -63,18 +65,22 @@ in stdenv.mkDerivation { inherit src; buildInputs = [ - dpkg gtk3 # needed for GSETTINGS_SCHEMAS_PATH ]; - nativeBuildInputs = [ makeWrapper nodePackages.asar ]; + nativeBuildInputs = [ dpkg makeWrapper nodePackages.asar ]; dontUnpack = true; - buildCommand = '' + dontBuild = true; + dontPatchELF = true; + + installPhase = '' + # The deb file contains a setuid binary, so 'dpkg -x' doesn't work here + dpkg --fsys-tarfile $src | tar --extract + rm -rf usr/share/lintian + mkdir -p $out - dpkg -x $src $out - cp -av $out/usr/* $out - rm -rf $out/etc $out/usr $out/share/lintian + mv usr/* $out # Otherwise it looks "suspicious" chmod -R g-w $out