jetbrains-toolbox: 2.6.2.41321 -> 2.6.3.43718 (#417617)

authored by

Pol Dellaiera and committed by
GitHub
1a6b0ac8 9f856ea6

+85 -88
+71 -66
pkgs/by-name/je/jetbrains-toolbox/package.nix
··· 1 { 2 lib, 3 - stdenv, 4 - appimageTools, 5 fetchzip, 6 fetchurl, 7 - makeWrapper, 8 - icu, 9 - libappindicator-gtk3, 10 undmg, 11 }: 12 13 let 14 pname = "jetbrains-toolbox"; 15 - version = "2.6.2.41321"; 16 17 updateScript = ./update.sh; 18 ··· 20 description = "Jetbrains Toolbox"; 21 homepage = "https://jetbrains.com/"; 22 license = lib.licenses.unfree; 23 - maintainers = with lib.maintainers; [ AnatolyPopov ]; 24 platforms = [ 25 "aarch64-linux" 26 "aarch64-darwin" ··· 31 }; 32 33 selectSystem = 34 - attrs: 35 - attrs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); 36 37 - linux = appimageTools.wrapAppImage rec { 38 - inherit pname version meta; 39 40 - source = 41 - let 42 - arch = selectSystem { 43 - x86_64-linux = ""; 44 - aarch64-linux = "-arm64"; 45 - }; 46 - in 47 - fetchzip { 48 - url = "https://download.jetbrains.com/toolbox/jetbrains-toolbox-${version}${arch}.tar.gz"; 49 - hash = selectSystem { 50 - x86_64-linux = "sha256-nIvlO313GZhIpgyCUhp2FUzllD3tk0oRrxFzxtHSIQA="; 51 - aarch64-linux = "sha256-iggrnpjqLEqiteXnmA+eynTB7cs9YeOnNW4DWGP6mk0="; 52 - }; 53 }; 54 - 55 - src = appimageTools.extractType2 { 56 - inherit pname version; 57 - src = source + "/jetbrains-toolbox"; 58 }; 59 - 60 - nativeBuildInputs = [ makeWrapper ]; 61 - 62 - extraInstallCommands = '' 63 - install -Dm644 ${src}/jetbrains-toolbox.desktop $out/share/applications/jetbrains-toolbox.desktop 64 - install -Dm644 ${src}/.DirIcon $out/share/icons/hicolor/scalable/apps/jetbrains-toolbox.svg 65 - wrapProgram $out/bin/jetbrains-toolbox \ 66 - --prefix LD_LIBRARY_PATH : ${ 67 - lib.makeLibraryPath [ 68 - icu 69 - libappindicator-gtk3 70 - ] 71 - } \ 72 - --append-flags "--update-failed" 73 - ''; 74 - 75 - passthru = { 76 - src = source; 77 - inherit updateScript; 78 }; 79 - }; 80 81 - darwin = stdenv.mkDerivation (finalAttrs: { 82 - inherit pname version meta; 83 84 - src = 85 - let 86 - arch = selectSystem { 87 - x86_64-darwin = ""; 88 - aarch64-darwin = "-arm64"; 89 - }; 90 - in 91 - fetchurl { 92 - url = "https://download.jetbrains.com/toolbox/jetbrains-toolbox-${finalAttrs.version}${arch}.dmg"; 93 - hash = selectSystem { 94 - x86_64-darwin = "sha256-518Ew3yhj6wrTfPklNTC6La0EOb/XmrFcNmoeNbod8k="; 95 - aarch64-darwin = "sha256-Enyn4iJn8qLUdrvin44bGLv0dzl5VOL6KPi4AODhtPE="; 96 - }; 97 - }; 98 99 nativeBuildInputs = [ undmg ]; 100 ··· 114 inherit updateScript; 115 }; 116 }); 117 - in 118 - if stdenv.hostPlatform.isDarwin then darwin else linux
··· 1 { 2 lib, 3 + stdenvNoCC, 4 + buildFHSEnv, 5 fetchzip, 6 fetchurl, 7 + appimageTools, 8 undmg, 9 }: 10 11 let 12 pname = "jetbrains-toolbox"; 13 + version = "2.6.3.43718"; 14 15 updateScript = ./update.sh; 16 ··· 18 description = "Jetbrains Toolbox"; 19 homepage = "https://jetbrains.com/"; 20 license = lib.licenses.unfree; 21 + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; 22 + maintainers = with lib.maintainers; [ ners ]; 23 platforms = [ 24 "aarch64-linux" 25 "aarch64-darwin" ··· 30 }; 31 32 selectSystem = 33 + let 34 + inherit (stdenvNoCC.hostPlatform) system; 35 + in 36 + attrs: attrs.${system} or (throw "Unsupported system: ${system}"); 37 + 38 + selectKernel = 39 + let 40 + inherit (stdenvNoCC.hostPlatform.parsed) kernel; 41 + in 42 + attrs: attrs.${kernel.name} or (throw "Unsupported kernel: ${kernel.name}"); 43 44 + selectCpu = 45 + let 46 + inherit (stdenvNoCC.hostPlatform.parsed) cpu; 47 + in 48 + attrs: attrs.${cpu.name} or (throw "Unsupported CPU: ${cpu.name}"); 49 50 + sourceForVersion = 51 + version: 52 + let 53 + archSuffix = selectCpu { 54 + x86_64 = ""; 55 + aarch64 = "-arm64"; 56 }; 57 + hash = selectSystem { 58 + x86_64-linux = "sha256-qsj2Jsf4P03LeekaAcUQLVloKpY1pjnT0ffdo0LSD3M="; 59 + aarch64-linux = "sha256-QkavbPl1EnucbHWwqUcResuOFybMZLGlhZzv+YGqzeY="; 60 + x86_64-darwin = "sha256-3CzUKAp+Y/sCnGgI7UkMun4XnNEUSIg9dWFile1MLk4="; 61 + aarch64-darwin = "sha256-A4smWImeHwgQa9oaRpt/WPRxG+DWCdQ7ZrjNNKwV06I="; 62 + }; 63 + in 64 + selectKernel { 65 + linux = fetchzip { 66 + url = "https://download-cdn.jetbrains.com/toolbox/jetbrains-toolbox-${version}${archSuffix}.tar.gz"; 67 + inherit hash; 68 + }; 69 + darwin = fetchurl { 70 + url = "https://download-cdn.jetbrains.com/toolbox/jetbrains-toolbox-${version}${archSuffix}.dmg"; 71 + inherit hash; 72 + }; 73 }; 74 + in 75 + selectKernel { 76 + linux = 77 + let 78 + src = sourceForVersion version; 79 + in 80 + buildFHSEnv { 81 + inherit pname version meta; 82 + passthru = { 83 + inherit src updateScript; 84 + }; 85 + multiPkgs = 86 + pkgs: 87 + with pkgs; 88 + [ 89 + icu 90 + libappindicator-gtk3 91 + ] 92 + ++ appimageTools.defaultFhsEnvArgs.multiPkgs pkgs; 93 + runScript = "${src}/bin/jetbrains-toolbox --update-failed"; 94 }; 95 96 + darwin = stdenvNoCC.mkDerivation (finalAttrs: { 97 + inherit 98 + pname 99 + version 100 + meta 101 + ; 102 103 + src = sourceForVersion finalAttrs.version; 104 105 nativeBuildInputs = [ undmg ]; 106 ··· 120 inherit updateScript; 121 }; 122 }); 123 + }
+14 -22
pkgs/by-name/je/jetbrains-toolbox/update.sh
··· 4 set -eou pipefail 5 6 latestVersion=$(curl -Ls 'https://data.services.jetbrains.com/products?code=TBA&release.type=release' | jq -r '.[0].releases | flatten | .[0].build') 7 - currentVersion=$(nix-instantiate --eval -E "with import ./. {}; jetbrains-toolbox.version or (lib.getVersion jetbrains-toolbox)" | tr -d '"') 8 9 echo "latest version: $latestVersion" 10 echo "current version: $currentVersion" ··· 14 exit 0 15 fi 16 17 - linux_systems=( 18 - "x86_64-linux:" 19 - "aarch64-linux:-arm64" 20 - ) 21 - 22 - for entry in "${linux_systems[@]}"; do 23 - arch="${entry%%:*}" 24 - suffix="${entry#*:}" 25 - prefetch=$(nix-prefetch-url --unpack "https://download.jetbrains.com/toolbox/jetbrains-toolbox-$latestVersion$suffix.tar.gz") 26 - hash=$(nix hash convert --hash-algo sha256 --to sri $prefetch) 27 - update-source-version jetbrains-toolbox $latestVersion $hash --system=$arch --ignore-same-version 28 - done 29 30 - darwin_systems=( 31 - "x86_64-darwin:" 32 - "aarch64-darwin:-arm64" 33 - ) 34 35 - for entry in "${darwin_systems[@]}"; do 36 - arch="${entry%%:*}" 37 - suffix="${entry#*:}" 38 - prefetch=$(nix-prefetch-url "https://download.jetbrains.com/toolbox/jetbrains-toolbox-$latestVersion$suffix.dmg") 39 hash=$(nix hash convert --hash-algo sha256 --to sri $prefetch) 40 - update-source-version jetbrains-toolbox $latestVersion $hash --system=$arch --ignore-same-version 41 done
··· 4 set -eou pipefail 5 6 latestVersion=$(curl -Ls 'https://data.services.jetbrains.com/products?code=TBA&release.type=release' | jq -r '.[0].releases | flatten | .[0].build') 7 + currentVersion=$(nix-instantiate --eval -E "with import ./. {}; jetbrains-toolbox.version" | tr -d '"') 8 9 echo "latest version: $latestVersion" 10 echo "current version: $currentVersion" ··· 14 exit 0 15 fi 16 17 + update-source-version jetbrains-toolbox $latestVersion 18 19 + systems=$(nix-instantiate --eval --json -E 'with import ./. {}; jetbrains-toolbox.meta.platforms' | jq -r '.[]') 20 21 + for system in $systems; do 22 + arch="${system%%:*}" 23 + suffix="${system#*:}" 24 + url=$(nix-instantiate --eval --json -E "with import ./. { system = \"$system\"; }; jetbrains-toolbox.src.url" | jq -r) 25 + if [[ $url == *.tar.gz ]]; then 26 + unpack="--unpack" 27 + else 28 + unpack="" 29 + fi 30 + prefetch=$(nix-prefetch-url $unpack "$url") 31 hash=$(nix hash convert --hash-algo sha256 --to sri $prefetch) 32 + update-source-version jetbrains-toolbox $latestVersion $hash --system=$system --ignore-same-version 33 done