rocmPackages.hsa-amd-aqlprofile-bin: 5.7.0 -> 5.7.1

Added update script that actually works

Madoura a593ca39 501b1e35

+62 -13
+11 -13
pkgs/development/rocm-modules/5/hsa-amd-aqlprofile-bin/default.nix
··· 1 1 { lib 2 2 , stdenv 3 3 , fetchurl 4 + , callPackage 4 5 , dpkg 5 6 }: 6 7 7 - let 8 - prefix = "hsa-amd-aqlprofile"; 9 - version = "5.7.0"; 10 - major = lib.versions.major version; 11 - minor = lib.versions.minor version; 12 - patch = lib.versions.patch version; 13 - magic = lib.strings.concatStrings (lib.strings.intersperse "0" (lib.versions.splitVersion version)); 14 - in stdenv.mkDerivation (finalAttrs: { 15 - inherit version; 16 - pname = "${prefix}-bin"; 8 + stdenv.mkDerivation (finalAttrs: { 9 + pname = "hsa-amd-aqlprofile-bin"; 10 + version = "5.7.1"; 17 11 18 12 src = fetchurl { 19 - url = "https://repo.radeon.com/rocm/apt/${major}.${minor}/pool/main/h/${prefix}/${prefix}_1.0.0.${magic}.${magic}-63~22.04_amd64.deb"; 20 - hash = "sha256-FQ25eXkhnvOmcf0sGW3GYu9kZj69bVvZrh0jVx/G/kI="; 13 + url = "https://repo.radeon.com/rocm/apt/5.7.1/pool/main/h/hsa-amd-aqlprofile/hsa-amd-aqlprofile_1.0.0.50701.50701-98~22.04_amd64.deb"; 14 + hash = "sha256-LWAtZ0paJW8lhE+QAMwq2l8wM+96bxk5rNWyQXTc9Vo="; 21 15 }; 22 16 23 17 nativeBuildInputs = [ dpkg ]; ··· 29 23 runHook preInstall 30 24 31 25 mkdir -p $out 32 - cp -a opt/rocm-${version}/* $out 26 + cp -a opt/rocm-${finalAttrs.version}/* $out 27 + chmod +x $out/lib/libhsa-amd-aqlprofile64.so.1.* 28 + chmod +x $out/lib/hsa-amd-aqlprofile/librocprofv2_att.so 33 29 34 30 runHook postInstall 35 31 ''; 32 + 33 + passthru.updateScript = (callPackage ./update.nix { }) { inherit (finalAttrs) version; }; 36 34 37 35 meta = with lib; { 38 36 description = "AQLPROFILE library for AMD HSA runtime API extension support";
+51
pkgs/development/rocm-modules/5/hsa-amd-aqlprofile-bin/update.nix
··· 1 + { lib 2 + , writeScript 3 + }: 4 + 5 + { version }: 6 + 7 + let 8 + prefix = "hsa-amd-aqlprofile"; 9 + extVersion = lib.strings.concatStrings (lib.strings.intersperse "0" (lib.versions.splitVersion version)); 10 + major = lib.versions.major version; 11 + minor = lib.versions.minor version; 12 + patch = lib.versions.patch version; 13 + 14 + updateScript = writeScript "update.sh" '' 15 + #!/usr/bin/env nix-shell 16 + #!nix-shell -i bash -p curl common-updater-scripts 17 + apt="https://repo.radeon.com/rocm/apt" 18 + pool="pool/main/h/${prefix}/" 19 + url="$apt/latest/$pool" 20 + res="$(curl -sL "$url")" 21 + deb="${prefix}$(echo "$res" | grep -o -P "(?<=href=\"${prefix}).*(?=\">)" | tail -1)" 22 + patch="${patch}" 23 + 24 + # Try up to 10 patch versions 25 + for i in {1..10}; do 26 + ((patch++)) 27 + extVersion="$(echo "$deb" | grep -o -P "(?<=\.....).*(?=\..*-)")" 28 + 29 + if (( ''${#extVersion} == 5 )) && (( $extVersion <= ${extVersion} )); then 30 + url="https://repo.radeon.com/rocm/apt/${major}.${minor}.$patch/pool/main/h/${prefix}/" 31 + res="$(curl -sL "$url")" 32 + deb="${prefix}$(echo "$res" | grep -o -P "(?<=href=\"${prefix}).*(?=\">)" | tail -1)" 33 + else 34 + break 35 + fi 36 + done 37 + 38 + extVersion="$(echo $deb | grep -o -P "(?<=\.....).*(?=\..*-)")" 39 + version="$(echo $extVersion | sed "s/0/./1" | sed "s/0/./1")" 40 + 41 + if (( ''${#extVersion} == 5 )); then 42 + repoVersion="$version" 43 + 44 + if (( ''${version:4:1} == 0 )); then 45 + repoVersion=''${version:0:3} 46 + fi 47 + 48 + update-source-version rocmPackages_5.${prefix}-bin "$version" "" "$apt/$repoVersion/$pool$deb" --ignore-same-hash 49 + fi 50 + ''; 51 + in [ updateScript ]