teams: Don't use root-level throw for unsupported platforms

Unsupported platforms are handled with `meta.platforms`, there's no need
to have an extra `throw` for this.

This makes the top-level attribute `teams` attribute evaluate
This commit is contained in:
Silvan Mosberger 2023-12-22 19:24:52 +01:00
parent 66bda599f4
commit 7d926d19d3

View File

@ -26,37 +26,33 @@ let
};
appName = "Teams.app";
darwin = 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
'';
};
in
if stdenv.isDarwin
then darwin
else throw "Teams app for Linux has been removed as it is unmaintained by upstream. (2023-09-29)"
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
'';
}