forked from mirrors/nixpkgs
teams: add darwin support (#157006)
This commit is contained in:
parent
2e2a63a0a1
commit
e8c6422be6
|
@ -14,11 +14,26 @@
|
|||
, xdg-utils
|
||||
, systemd
|
||||
, nodePackages
|
||||
, enableRectOverlay ? false }:
|
||||
, xar
|
||||
, cpio
|
||||
, makeWrapper
|
||||
, enableRectOverlay ? false
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
let
|
||||
pname = "teams";
|
||||
version = "1.4.00.26453";
|
||||
meta = with lib; {
|
||||
description = "Microsoft Teams";
|
||||
homepage = "https://teams.microsoft.com";
|
||||
downloadPage = "https://teams.microsoft.com/downloads";
|
||||
license = licenses.unfree;
|
||||
maintainers = with maintainers; [ liff tricktron ];
|
||||
platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
||||
};
|
||||
|
||||
linux = stdenv.mkDerivation rec {
|
||||
inherit pname version meta;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://packages.microsoft.com/repos/ms-teams/pool/main/t/teams/teams_${version}_amd64.deb";
|
||||
|
@ -110,13 +125,39 @@ stdenv.mkDerivation rec {
|
|||
# another option would be to introduce gappsWrapperAppendedArgs, to allow control of positioning
|
||||
substituteInPlace "$out/bin/teams" --replace '.teams-wrapped" --disable-namespace-sandbox --disable-setuid-sandbox "$@"' '.teams-wrapped" "$@" --disable-namespace-sandbox --disable-setuid-sandbox'
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Microsoft Teams";
|
||||
homepage = "https://teams.microsoft.com";
|
||||
downloadPage = "https://teams.microsoft.com/downloads";
|
||||
license = licenses.unfree;
|
||||
maintainers = [ maintainers.liff ];
|
||||
platforms = [ "x86_64-linux" ];
|
||||
};
|
||||
}
|
||||
|
||||
appName = "Teams.app";
|
||||
|
||||
darwin = stdenv.mkDerivation {
|
||||
inherit pname version meta;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://statics.teams.cdn.office.net/production-osx/${version}/Teams_osx.pkg";
|
||||
sha256 = "1mg6a3b3954w4xy5rlcrwxczymygl61dv2rxqp45sjcsh3hp39q0";
|
||||
};
|
||||
|
||||
buildInputs = [ 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
|
||||
'';
|
||||
};
|
||||
in
|
||||
if stdenv.isDarwin
|
||||
then darwin
|
||||
else linux
|
||||
|
|
Loading…
Reference in a new issue