nixpkgs/pkgs/applications/networking/instant-messengers/caprine-bin/build-from-dmg.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
719 B
Nix
Raw Normal View History

2021-01-04 15:47:16 +00:00
{ stdenvNoCC
, lib
, fetchurl
, undmg
, pname
, version
, sha256
, metaCommon ? { }
}:
stdenvNoCC.mkDerivation {
inherit pname version;
src = fetchurl {
url = "https://github.com/sindresorhus/caprine/releases/download/v${version}/Caprine-${version}.dmg";
name = "Caprine-${version}.dmg";
inherit sha256;
};
sourceRoot = "Caprine.app";
nativeBuildInputs = [ undmg ];
installPhase = ''
mkdir -p "$out/Applications/Caprine.app"
cp -R . "$out/Applications/Caprine.app"
mkdir "$out/bin"
ln -s "$out/Applications/Caprine.app/Contents/MacOS/Caprine" "$out/bin/caprine"
'';
meta = metaCommon // {
platforms = with lib.platforms; darwin;
mainProgram = "caprine";
};
}