ibmcloud-cli: 2.30.0 -> 2.34.0 (#403222)

authored by Pol Dellaiera and committed by GitHub 0696592b 06e9a4c8

+51 -17
+22 -17
pkgs/tools/admin/ibmcloud-cli/default.nix
··· 3 stdenv, 4 fetchurl, 5 installShellFiles, 6 }: 7 let 8 arch = ··· 29 in 30 stdenv.mkDerivation (finalAttrs: { 31 pname = "ibmcloud-cli"; 32 - version = "2.30.0"; 33 34 src = fetchurl { 35 url = "https://download.clis.cloud.ibm.com/ibm-cloud-cli/${finalAttrs.version}/binaries/IBM_Cloud_CLI_${finalAttrs.version}_${platform}.tgz"; 36 - sha256 = 37 { 38 - "x86_64-darwin" = "5d4d16f35c034aa336e28b5685684146ec5773a6d7f456ed0d0e5d686adf4b25"; 39 - "aarch64-darwin" = "d563b8a4214da4360756bd18283b68c118139b5d3dd1b1d31c7ab7e61349e126"; 40 - "x86_64-linux" = "e6c874702851f16a3c21570020da85122a0ec0ca7e9dd75091684df1030d7295"; 41 - "aarch64-linux" = "6904c9de54845adcd08eb9906567493b68ad3f4cbba9d1121f63d9df2dd47185"; 42 - "i686-linux" = "bc6be9a65a6942e158ab202a2d1c89c4294b5cebf60841f4ac1d21064052e7e7"; 43 - "powerpc64le-linux" = "271a0aa9c0a1dc2c84772fba33c9c6b97588d35eccf6757de6974c433b6e7874"; 44 - "s390x-linux" = "e8ec8adaaae2eab091500c257c7b18acf5e9556b4910df8290600bd7f723fdc1"; 45 } 46 .${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); 47 }; 48 49 - nativeBuildInputs = [ installShellFiles ]; 50 51 installPhase = '' 52 runHook preInstall 53 54 - install -D ibmcloud $out/bin/ibmcloud 55 mkdir -p $out/share/ibmcloud 56 cp LICENSE NOTICE $out/share/ibmcloud 57 - export HOME=$(mktemp -d) 58 installShellCompletion --cmd ibmcloud --bash <($out/bin/ibmcloud --generate-bash-completion) 59 60 runHook postInstall 61 ''; 62 63 - meta = with lib; { 64 description = "Command line client for IBM Cloud"; 65 homepage = "https://cloud.ibm.com/docs/cli"; 66 - license = licenses.asl20; 67 - maintainers = with maintainers; [ emilytrau ]; 68 platforms = [ 69 "x86_64-linux" 70 "aarch64-linux" 71 "i686-linux" 72 "powerpc64le-linux" 73 "s390x-linux" 74 - ] ++ platforms.darwin; 75 - sourceProvenance = with sourceTypes; [ binaryNativeCode ]; 76 mainProgram = "ibmcloud"; 77 }; 78 })
··· 3 stdenv, 4 fetchurl, 5 installShellFiles, 6 + writableTmpDirAsHomeHook, 7 }: 8 let 9 arch = ··· 30 in 31 stdenv.mkDerivation (finalAttrs: { 32 pname = "ibmcloud-cli"; 33 + version = "2.34.0"; 34 35 src = fetchurl { 36 url = "https://download.clis.cloud.ibm.com/ibm-cloud-cli/${finalAttrs.version}/binaries/IBM_Cloud_CLI_${finalAttrs.version}_${platform}.tgz"; 37 + hash = 38 { 39 + "x86_64-darwin" = "sha256-6E+yUqpX8kp/T4jxAWwkBUsCQh31vwJGw3wnqkUs3Js="; 40 + "aarch64-darwin" = "sha256-CK0fUIYDVx25EzXGdhexaChVxkifSn6BKtZTQB5wl1o="; 41 + "x86_64-linux" = "sha256-xYuVEkgbVQNdR/v9C0Do9wMeOYlfntRJaen/XaHMJvQ="; 42 + "aarch64-linux" = "sha256-MXr6NpO3XhrCbcss3Y+GzkbgQ07iOzmp99lAtfZ8YMk="; 43 + "i686-linux" = "sha256-1oL+jn3KTfIE+2oW4i8+RUr/c9/Ew/H7PToe/l19C5s="; 44 + "powerpc64le-linux" = "sha256-hZADXpi9zxRB+wy4V4owQqmE3BYRSenNjlUfjWqBnow="; 45 + "s390x-linux" = "sha256-ayQZD4+6U6WLfIhbVy/HCATjhZYybk3/83ak7BruWQ8="; 46 } 47 .${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); 48 }; 49 50 + nativeBuildInputs = [ 51 + installShellFiles 52 + writableTmpDirAsHomeHook 53 + ]; 54 55 installPhase = '' 56 runHook preInstall 57 58 + install -Dm755 ibmcloud $out/bin/ibmcloud 59 mkdir -p $out/share/ibmcloud 60 cp LICENSE NOTICE $out/share/ibmcloud 61 installShellCompletion --cmd ibmcloud --bash <($out/bin/ibmcloud --generate-bash-completion) 62 63 runHook postInstall 64 ''; 65 66 + passthru.updateScript = ./update.sh; 67 + 68 + meta = { 69 description = "Command line client for IBM Cloud"; 70 homepage = "https://cloud.ibm.com/docs/cli"; 71 + license = lib.licenses.asl20; 72 + maintainers = with lib.maintainers; [ emilytrau ]; 73 platforms = [ 74 "x86_64-linux" 75 "aarch64-linux" 76 "i686-linux" 77 "powerpc64le-linux" 78 "s390x-linux" 79 + ] ++ lib.platforms.darwin; 80 + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; 81 mainProgram = "ibmcloud"; 82 }; 83 })
+29
pkgs/tools/admin/ibmcloud-cli/update.sh
···
··· 1 + #!/usr/bin/env nix-shell 2 + #!nix-shell -i bash -p bash nix-update common-updater-scripts nix jq 3 + 4 + set -euo pipefail 5 + 6 + currentVersion=$(nix-instantiate --eval -E "with import ./. {}; ibmcloud-cli.version or (lib.getVersion ibmcloud-cli)" | tr -d '"') 7 + latestVersion=$(curl ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} -sL https://api.github.com/repos/IBM-Cloud/ibm-cloud-cli-release/releases/latest | jq --raw-output .tag_name | sed 's/^v//') 8 + 9 + if [[ "$currentVersion" == "$latestVersion" ]]; then 10 + echo "package is up-to-date: $currentVersion" 11 + exit 0 12 + fi 13 + 14 + update-source-version ibmcloud-cli $latestVersion || true 15 + 16 + for system in \ 17 + x86_64-linux \ 18 + aarch64-linux \ 19 + i686-linux \ 20 + powerpc64le-linux \ 21 + s390x-linux \ 22 + x86_64-darwin \ 23 + aarch64-darwin; do 24 + tmp=$(mktemp -d) 25 + curl -fsSL -o $tmp/ibmcloud-cli $(nix-instantiate --eval -E "with import ./. {}; ibmcloud-cli.src.url" --system "$system" | tr -d '"') 26 + hash=$(nix hash file $tmp/ibmcloud-cli) 27 + update-source-version ibmcloud-cli $latestVersion $hash --system=$system --ignore-same-version 28 + rm -rf $tmp 29 + done