nixpkgs/pkgs/applications/networking/instant-messengers/teams/default.nix
ajs124 a0430d5fa9
Merge pull request #277881 from liff/teams/drop-liff
teams: remove liff from maintainers
2024-01-11 15:02:45 +01:00

59 lines
1.3 KiB
Nix

{ lib
, stdenv
, fetchurl
, xar
, cpio
, makeWrapper
}:
let
pname = "teams";
versions = {
darwin = "1.6.00.4464";
};
hashes = {
darwin = "sha256-DvXMrXotKWUqFCb7rZj8wU7mmZJKuTLGyx8qOB/aQtg=";
};
meta = with lib; {
description = "Microsoft Teams";
homepage = "https://teams.microsoft.com";
downloadPage = "https://teams.microsoft.com/downloads";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
maintainers = with maintainers; [ tricktron ];
platforms = [ "x86_64-darwin" "aarch64-darwin" ];
mainProgram = "teams";
};
appName = "Teams.app";
in
stdenv.mkDerivation {
inherit pname meta;
version = versions.darwin;
src = fetchurl {
url = "https://statics.teams.cdn.office.net/production-osx/${versions.darwin}/Teams_osx.pkg";
hash = hashes.darwin;
};
nativeBuildInputs = [ xar cpio makeWrapper ];
unpackPhase = ''
xar -xf $src
zcat < Teams_osx_app.pkg/Payload | cpio -i
'';
sourceRoot = "Microsoft\ Teams.app";
dontPatch = true;
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/{Applications/${appName},bin}
cp -R . $out/Applications/${appName}
makeWrapper $out/Applications/${appName}/Contents/MacOS/Teams $out/bin/teams
runHook postInstall
'';
}