mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-20 04:33:57 +00:00
36 lines
719 B
Nix
36 lines
719 B
Nix
|
{ 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";
|
||
|
};
|
||
|
}
|