2022-04-03 18:54:34 +00:00
|
|
|
{ stdenvNoCC
|
|
|
|
, fetchurl
|
|
|
|
, unzip
|
|
|
|
, pname
|
|
|
|
, version
|
|
|
|
, meta
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
appName = "Postman.app";
|
|
|
|
dist = {
|
|
|
|
aarch64-darwin = {
|
|
|
|
arch = "arm64";
|
2022-10-21 18:38:19 +00:00
|
|
|
sha256 = "sha256-zvGWkV92qDsiveS1tvkY6jHIr/Xj3ARSOqov+MCRM+o=";
|
2022-04-03 18:54:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
x86_64-darwin = {
|
|
|
|
arch = "64";
|
2022-10-21 18:38:19 +00:00
|
|
|
sha256 = "sha256-LuXC1ucEsrxqx8wAkBkot2wXbUUVp+FIQPx9/2+tfIw=";
|
2022-04-03 18:54:34 +00:00
|
|
|
};
|
|
|
|
}.${stdenvNoCC.hostPlatform.system} or (throw "Unsupported system: ${stdenvNoCC.hostPlatform.system}");
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenvNoCC.mkDerivation {
|
|
|
|
inherit pname version meta;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://dl.pstmn.io/download/version/${version}/osx_${dist.arch}";
|
|
|
|
inherit (dist) sha256;
|
|
|
|
name = "${pname}-${version}.zip";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ unzip ];
|
|
|
|
|
|
|
|
sourceRoot = appName;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/{Applications/${appName},bin}
|
|
|
|
cp -R . $out/Applications/${appName}
|
|
|
|
cat > $out/bin/${pname} << EOF
|
|
|
|
#!${stdenvNoCC.shell}
|
|
|
|
open -na $out/Applications/${appName} --args "$@"
|
|
|
|
EOF
|
|
|
|
chmod +x $out/bin/${pname}
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
}
|