@@ -13,6 +13,7 @@
1313, gawk
1414, xdg-utils
1515, systemd
16+, nodePackages
1617, enableRectOverlay ? false }:
1718
1819stdenv.mkDerivation rec {
@@ -24,7 +25,7 @@ stdenv.mkDerivation rec {
2425 sha256 = "1kx4j837fd344zy90nl0j3r8cdvihy6i6gf56wd5n56zngx1fhjv";
2526 };
2627
27− nativeBuildInputs = [ dpkg autoPatchelfHook wrapGAppsHook ];
28+ nativeBuildInputs = [ dpkg autoPatchelfHook wrapGAppsHook nodePackages.asar ];
2829
2930 unpackCmd = "dpkg -x $curSrc .";
3031
@@ -40,11 +41,27 @@ stdenv.mkDerivation rec {
4041 ];
4142
4243 preFixup = ''
43− gappsWrapperArgs+=(--prefix PATH : "${coreutils}/bin:${gawk}/bin:${xdg-utils}/bin")
44+ gappsWrapperArgs+=(--prefix PATH : "${coreutils}/bin:${gawk}/bin")
4445 gappsWrapperArgs+=(--add-flags --disable-namespace-sandbox)
4546 gappsWrapperArgs+=(--add-flags --disable-setuid-sandbox)
4647 '';
4748
49+
50+ buildPhase = ''
51+ runHook preBuild
52+
53+ asar extract share/teams/resources/app.asar "$TMP/work"
54+ substituteInPlace $TMP/work/main.bundle.js \
55+ --replace "/usr/share/pixmaps/" "$out/share/pixmaps" \
56+ --replace "/usr/bin/xdg-mime" "${xdg-utils}/bin/xdg-mime" \
57+ --replace "Exec=/usr/bin/" "Exec=" # Remove usage of absolute path in autostart.
58+ asar pack --unpack='{*.node,*.ftz,rect-overlay}' "$TMP/work" share/teams/resources/app.asar
59+
60+ runHook postBuild
61+ '';
62+
63+ preferLocalBuild = true;
64+
4865 installPhase = ''
4966 runHook preInstall
5067