Skip to content

Commit

Permalink
treewide: refactor to use darwin.installBinaryPackage (wire-desktop)
Browse files Browse the repository at this point in the history
  • Loading branch information
afh committed Mar 7, 2024
1 parent 9777f91 commit 23e142a
Showing 1 changed file with 8 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,22 @@
, fetchurl
, makeDesktopItem
, makeWrapper
, stdenv
, stdenvNoCC
, lib
, udev
, wrapGAppsHook
, cpio
, xar
, libdbusmenu
, alsa-lib
, mesa
, nss
, nspr
, systemd
, darwin
}:

let

inherit (stdenv.hostPlatform) system;
inherit (stdenvNoCC.hostPlatform) system;

throwSystem = throw "Unsupported system: ${system}";

Expand Down Expand Up @@ -69,7 +68,7 @@ let
hydraPlatforms = [];
};

linux = stdenv.mkDerivation rec {
linux = stdenvNoCC.mkDerivation rec {
inherit pname version meta;

src = fetchurl {
Expand Down Expand Up @@ -143,47 +142,18 @@ let
'';
};

darwin = stdenv.mkDerivation {
darwin' = darwin.installBinaryPackage {
inherit pname version meta;

src = fetchurl {
url = "https://github.com/wireapp/wire-desktop/releases/download/macos%2F${version}/Wire.pkg";
inherit hash;
};

buildInputs = [
cpio
xar
];

unpackPhase = ''
runHook preUnpack
xar -xf $src
cd com.wearezeta.zclient.mac.pkg
runHook postUnpack
'';

buildPhase = ''
runHook preBuild
cat Payload | gunzip -dc | cpio -i
runHook postBuild
'';

installPhase = ''
runHook preInstall
mkdir -p $out/Applications
cp -r Wire.app $out/Applications
runHook postInstall
'';
appName = "Wire.app";
};

in
if stdenv.isDarwin
then darwin
if stdenvNoCC.isDarwin
then darwin'
else linux

0 comments on commit 23e142a

Please sign in to comment.