2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, autoPatchelfHook, fetchurl, lib }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ccloud-cli";
|
2021-09-18 10:52:07 +00:00
|
|
|
version = "1.39.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# To get the latest version:
|
2021-03-23 19:22:30 +00:00
|
|
|
# curl -L https://cnfl.io/ccloud-cli | sh -s -- -l | grep -v latest | sort -V | tail -n1
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchurl (if stdenv.hostPlatform.isDarwin then {
|
|
|
|
url = "https://s3-us-west-2.amazonaws.com/confluent.cloud/ccloud-cli/archives/${version}/ccloud_v${version}_darwin_amd64.tar.gz";
|
2021-09-18 10:52:07 +00:00
|
|
|
sha256 = "0jqpmnx3izl4gv02zpx03z6ayi3cb5if4rnyl1374yaclx44k1gd";
|
2020-04-24 23:36:52 +00:00
|
|
|
} else {
|
|
|
|
url = "https://s3-us-west-2.amazonaws.com/confluent.cloud/ccloud-cli/archives/${version}/ccloud_v${version}_linux_amd64.tar.gz";
|
2021-09-18 10:52:07 +00:00
|
|
|
sha256 = "0936hipcl37w4mzzsnjlz4q1z4j9094i4irigzqwg14gdbs7p11s";
|
2020-04-24 23:36:52 +00:00
|
|
|
});
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
dontStrip = stdenv.isDarwin;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/{bin,share/doc/ccloud-cli}
|
|
|
|
cp ccloud $out/bin/
|
|
|
|
cp LICENSE $out/share/doc/ccloud-cli/
|
|
|
|
cp -r legal $out/share/doc/ccloud-cli/
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Confluent Cloud CLI";
|
|
|
|
homepage = "https://docs.confluent.io/current/cloud/cli/index.html";
|
2022-06-26 10:26:21 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = with maintainers; [ kalbasit ];
|
2021-03-23 19:22:30 +00:00
|
|
|
|
|
|
|
# TODO: There's support for i686 systems but I do not have any such system
|
|
|
|
# to build it locally on, it's also unfree so I cannot rely on ofborg to
|
|
|
|
# build it. Get the list of supported system by looking at the list of
|
|
|
|
# files in the S3 bucket:
|
|
|
|
#
|
|
|
|
# https://s3-us-west-2.amazonaws.com/confluent.cloud?prefix=ccloud-cli/archives/1.25.0/&delimiter=/%27
|
|
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|