btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / fl / flywheel-cli / package.nix
blob51600d31c51302f5999cf7c631f8a6aeaeff1c17
1 { lib
2 , stdenv
3 , fetchurl
4 , unzip
5 }:
7 let
8   inherit (stdenv.hostPlatform) system;
9   throwSystem = throw "Unsupported system: ${system}";
11   os = {
12     x86_64-darwin = "darwin";
13     x86_64-linux = "linux";
14   }.${system} or throwSystem;
16   sha256 = {
17     x86_64-darwin = "sha256-OIyEu3Hsobui9s5+T9nC10SxMw0MhgmTA4SN9Ridyzo=";
18     x86_64-linux = "sha256-SxBjRd95hoh2zwX6IDnkZnTWVduQafPHvnWw8qTuM78=";
19   }.${system} or throwSystem;
21 stdenv.mkDerivation rec {
22   pname = "flywheel-cli";
23   version = "16.2.0";
25   src = fetchurl {
26     url = "https://storage.googleapis.com/flywheel-dist/cli/${version}/fw-${os}_amd64-${version}.zip";
27     inherit sha256;
28   };
30   nativeBuildInputs = [ unzip ];
32   unpackPhase = ''
33     unzip ${src}
34   '';
36   installPhase = ''
37     runHook preInstall
38     install -Dt $out/bin ./${os}_amd64/fw
39     runHook postInstall
40   '';
42   meta = with lib; {
43     description = "Library and command line interface for interacting with a Flywheel site";
44     mainProgram = "fw";
45     homepage = "https://gitlab.com/flywheel-io/public/python-cli";
46     sourceProvenance = with sourceTypes; [ binaryNativeCode ];
47     license = licenses.mit;
48     maintainers = with maintainers; [ rbreslow ];
49     platforms = [ "x86_64-darwin" "x86_64-linux" ];
50   };