Merge pull request #113379 from 06kellyjac/octant_ver_bump

authored by Sandro and committed by GitHub 25420cd7 ed002061

+71 -19
+33 -19
pkgs/applications/networking/cluster/octant/default.nix
··· 1 - { lib, stdenv, fetchurl }: 1 + { lib, stdenv, fetchzip }: 2 + 2 3 let 3 - version = "0.16.3"; 4 - 5 - system = stdenv.hostPlatform.system; 4 + inherit (stdenv.hostPlatform) system; 6 5 suffix = { 7 6 x86_64-linux = "Linux-64bit"; 8 7 aarch64-linux = "Linux-arm64"; 9 8 x86_64-darwin = "macOS-64bit"; 10 9 }."${system}" or (throw "Unsupported system: ${system}"); 11 - 12 10 baseurl = "https://github.com/vmware-tanzu/octant/releases/download"; 13 - fetchsrc = sha256: fetchurl { 14 - url = "${baseurl}/v${version}/octant_${version}_${suffix}.tar.gz"; 15 - sha256 = sha256."${system}"; 16 - }; 11 + fetchsrc = version: sha256: fetchzip { 12 + url = "${baseurl}/v${version}/octant_${version}_${suffix}.tar.gz"; 13 + sha256 = sha256."${system}"; 14 + }; 17 15 in 18 16 stdenv.mkDerivation rec { 19 17 pname = "octant"; 20 - inherit version; 18 + version = "0.17.0"; 21 19 22 - src = fetchsrc { 23 - x86_64-linux = "1c6v7d8i494k32b0zrjn4fn1idza95r6h99c33c5za4hi7gqvy0x"; 24 - aarch64-linux = "153jd4wsq8qc598w7y4d30dy20ljyhrl68cc3pig1p712l5258zs"; 25 - x86_64-darwin = "0y2qjdlyvhrzwg0fmxsr3jl39kd13276a7wg0ndhdjfwxvdwpxkz"; 20 + src = fetchsrc version { 21 + x86_64-linux = "sha256-kYS8o97HBjNgwmrG4fjsqFWxZy6ATFOhxt6j3KMZbEc="; 22 + aarch64-linux = "sha256-/Tpna2Y8+PQt+SeOJ9NDweRWGiQXU/sN+Wh/vLYQPwM="; 23 + x86_64-darwin = "sha256-aOUmnD+l/Cc5qTiHxFLBjCatszmPdUc4YYZ6Oy5DT3U="; 26 24 }; 27 25 28 - doCheck = false; 26 + dontConfigure = true; 27 + dontBuild = true; 29 28 30 29 installPhase = '' 31 - mkdir -p "$out/bin" 32 - mv octant $out/bin 30 + runHook preInstall 31 + install -D octant $out/bin/octant 32 + runHook postInstall 33 33 ''; 34 34 35 + doInstallCheck = true; 36 + installCheckPhase = '' 37 + runHook preInstallCheck 38 + $out/bin/octant --help 39 + $out/bin/octant version | grep "${version}" 40 + runHook postInstallCheck 41 + ''; 42 + 43 + dontPatchELF = true; 44 + dontPatchShebangs = true; 45 + 46 + passthru.updateScript = ./update.sh; 47 + 35 48 meta = with lib; { 49 + homepage = "https://octant.dev/"; 50 + changelog = "https://github.com/vmware-tanzu/octant/blob/v${version}/CHANGELOG.md"; 36 51 description = "Highly extensible platform for developers to better understand the complexity of Kubernetes clusters."; 37 52 longDescription = '' 38 53 Octant is a tool for developers to understand how applications run on a Kubernetes cluster. ··· 40 55 Octant offers a combination of introspective tooling, cluster navigation, and object management along with a 41 56 plugin system to further extend its capabilities. 42 57 ''; 43 - homepage = "https://octant.dev/"; 44 58 license = licenses.asl20; 59 + maintainers = with maintainers; [ jk ]; 45 60 platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ]; 46 - maintainers = with maintainers; [ jk ]; 47 61 }; 48 62 }
+38
pkgs/applications/networking/cluster/octant/update.sh
··· 1 + #!/usr/bin/env nix-shell 2 + #!nix-shell -i bash -p curl gnused gawk nix-prefetch 3 + 4 + set -euo pipefail 5 + 6 + ROOT="$(dirname "$(readlink -f "$0")")" 7 + NIX_DRV="$ROOT/default.nix" 8 + if [ ! -f "$NIX_DRV" ]; then 9 + echo "ERROR: cannot find default.nix in $ROOT" 10 + exit 1 11 + fi 12 + 13 + fetch_arch() { 14 + VER="$1"; ARCH="$2" 15 + URL="https://github.com/vmware-tanzu/octant/releases/download/v${VER}/octant_${VER}_${ARCH}.tar.gz" 16 + nix-prefetch "{ stdenv, fetchzip }: 17 + stdenv.mkDerivation rec { 18 + pname = \"octant\"; version = \"${VER}\"; 19 + src = fetchzip { url = \"$URL\"; }; 20 + } 21 + " 22 + } 23 + 24 + replace_sha() { 25 + sed -i "s#$1 = \"sha256-.\{44\}\"#$1 = \"$2\"#" "$NIX_DRV" 26 + } 27 + 28 + OCTANT_VER=$(curl -Ls -w "%{url_effective}" -o /dev/null https://github.com/vmware-tanzu/octant/releases/latest | awk -F'/' '{print $NF}' | sed 's/v//') 29 + 30 + OCTANT_LINUX_X64_SHA256=$(fetch_arch "$OCTANT_VER" "Linux-64bit") 31 + OCTANT_DARWIN_X64_SHA256=$(fetch_arch "$OCTANT_VER" "Linux-arm64") 32 + OCTANT_LINUX_AARCH64_SHA256=$(fetch_arch "$OCTANT_VER" "macOS-64bit") 33 + 34 + sed -i "s/version = \".*\"/version = \"$OCTANT_VER\"/" "$NIX_DRV" 35 + 36 + replace_sha "x86_64-linux" "$OCTANT_LINUX_X64_SHA256" 37 + replace_sha "x86_64-darwin" "$OCTANT_LINUX_AARCH64_SHA256" 38 + replace_sha "aarch64-linux" "$OCTANT_DARWIN_X64_SHA256"