nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv, autoPatchelfHook, fetchurl, lib }:
2
3stdenv.mkDerivation rec {
4 pname = "confluent-cli";
5 version = "2.4.0";
6
7 # To get the latest version:
8 # curl -L https://cnfl.io/cli | sh -s -- -l | grep -v latest | sort -V | tail -n1
9 src = fetchurl (if stdenv.hostPlatform.isDarwin then {
10 url = "https://s3-us-west-2.amazonaws.com/confluent.cloud/confluent-cli/archives/${version}/confluent_v${version}_darwin_amd64.tar.gz";
11 sha256 = "1xkf7p9cn37k8j57cgbzxhqgnmchf86jyiza91bf6ddvm6jsm2gd";
12 } else {
13 url = "https://s3-us-west-2.amazonaws.com/confluent.cloud/confluent-cli/archives/${version}/confluent_v${version}_linux_amd64.tar.gz";
14 sha256 = "1wvy7x56cc7imycf0d83mxcqzdvv56cc0zbp913xgghjn9dl2z7a";
15 });
16
17 nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];
18
19 dontStrip = stdenv.isDarwin;
20
21 installPhase = ''
22 mkdir -p $out/{bin,share/doc/confluent-cli}
23 cp confluent $out/bin/
24 cp LICENSE $out/share/doc/confluent-cli/
25 cp -r legal $out/share/doc/confluent-cli/
26 '';
27
28 meta = with lib; {
29 description = "Confluent CLI";
30 homepage = "https://docs.confluent.io/confluent-cli/current/overview.html";
31 license = licenses.unfree;
32 maintainers = with maintainers; [ rguevara84 ];
33
34 # TODO: There's support for i686 systems but I do not have any such system
35 # to build it locally on, it's also unfree so I cannot rely on ofborg to
36 # build it. Get the list of supported system by looking at the list of
37 # files in the S3 bucket:
38 #
39 # https://s3-us-west-2.amazonaws.com/confluent.cloud?prefix=confluent-cli/archives/1.25.0/&delimiter=/%27
40 platforms = [ "x86_64-linux" "x86_64-darwin" ];
41 };
42}