mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-29 16:24:10 +00:00
rocmPackages.hsa-amd-aqlprofile-bin: 5.7.0 -> 5.7.1
Added update script that actually works
This commit is contained in:
parent
501b1e3506
commit
a593ca3973
@ -1,23 +1,17 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, callPackage
|
||||
, dpkg
|
||||
}:
|
||||
|
||||
let
|
||||
prefix = "hsa-amd-aqlprofile";
|
||||
version = "5.7.0";
|
||||
major = lib.versions.major version;
|
||||
minor = lib.versions.minor version;
|
||||
patch = lib.versions.patch version;
|
||||
magic = lib.strings.concatStrings (lib.strings.intersperse "0" (lib.versions.splitVersion version));
|
||||
in stdenv.mkDerivation (finalAttrs: {
|
||||
inherit version;
|
||||
pname = "${prefix}-bin";
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "hsa-amd-aqlprofile-bin";
|
||||
version = "5.7.1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://repo.radeon.com/rocm/apt/${major}.${minor}/pool/main/h/${prefix}/${prefix}_1.0.0.${magic}.${magic}-63~22.04_amd64.deb";
|
||||
hash = "sha256-FQ25eXkhnvOmcf0sGW3GYu9kZj69bVvZrh0jVx/G/kI=";
|
||||
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";
|
||||
hash = "sha256-LWAtZ0paJW8lhE+QAMwq2l8wM+96bxk5rNWyQXTc9Vo=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ dpkg ];
|
||||
@ -29,11 +23,15 @@ in stdenv.mkDerivation (finalAttrs: {
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out
|
||||
cp -a opt/rocm-${version}/* $out
|
||||
cp -a opt/rocm-${finalAttrs.version}/* $out
|
||||
chmod +x $out/lib/libhsa-amd-aqlprofile64.so.1.*
|
||||
chmod +x $out/lib/hsa-amd-aqlprofile/librocprofv2_att.so
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru.updateScript = (callPackage ./update.nix { }) { inherit (finalAttrs) version; };
|
||||
|
||||
meta = with lib; {
|
||||
description = "AQLPROFILE library for AMD HSA runtime API extension support";
|
||||
homepage = "https://rocm.docs.amd.com/en/latest/";
|
||||
|
@ -0,0 +1,51 @@
|
||||
{ lib
|
||||
, writeScript
|
||||
}:
|
||||
|
||||
{ version }:
|
||||
|
||||
let
|
||||
prefix = "hsa-amd-aqlprofile";
|
||||
extVersion = lib.strings.concatStrings (lib.strings.intersperse "0" (lib.versions.splitVersion version));
|
||||
major = lib.versions.major version;
|
||||
minor = lib.versions.minor version;
|
||||
patch = lib.versions.patch version;
|
||||
|
||||
updateScript = writeScript "update.sh" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl common-updater-scripts
|
||||
apt="https://repo.radeon.com/rocm/apt"
|
||||
pool="pool/main/h/${prefix}/"
|
||||
url="$apt/latest/$pool"
|
||||
res="$(curl -sL "$url")"
|
||||
deb="${prefix}$(echo "$res" | grep -o -P "(?<=href=\"${prefix}).*(?=\">)" | tail -1)"
|
||||
patch="${patch}"
|
||||
|
||||
# Try up to 10 patch versions
|
||||
for i in {1..10}; do
|
||||
((patch++))
|
||||
extVersion="$(echo "$deb" | grep -o -P "(?<=\.....).*(?=\..*-)")"
|
||||
|
||||
if (( ''${#extVersion} == 5 )) && (( $extVersion <= ${extVersion} )); then
|
||||
url="https://repo.radeon.com/rocm/apt/${major}.${minor}.$patch/pool/main/h/${prefix}/"
|
||||
res="$(curl -sL "$url")"
|
||||
deb="${prefix}$(echo "$res" | grep -o -P "(?<=href=\"${prefix}).*(?=\">)" | tail -1)"
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
extVersion="$(echo $deb | grep -o -P "(?<=\.....).*(?=\..*-)")"
|
||||
version="$(echo $extVersion | sed "s/0/./1" | sed "s/0/./1")"
|
||||
|
||||
if (( ''${#extVersion} == 5 )); then
|
||||
repoVersion="$version"
|
||||
|
||||
if (( ''${version:4:1} == 0 )); then
|
||||
repoVersion=''${version:0:3}
|
||||
fi
|
||||
|
||||
update-source-version rocmPackages_5.${prefix}-bin "$version" "" "$apt/$repoVersion/$pool$deb" --ignore-same-hash
|
||||
fi
|
||||
'';
|
||||
in [ updateScript ]
|
Loading…
Reference in New Issue
Block a user