about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/rocm-modules/5/hsa-amd-aqlprofile-bin/default.nix
blob: d13092fd3eef0e6a357b24008420fd1827fcc406 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{ lib
, stdenv
, fetchurl
, 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";

  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=";
  };

  nativeBuildInputs = [ dpkg ];
  dontPatch = true;
  dontConfigure = true;
  dontBuild = true;

  installPhase = ''
    runHook preInstall

    mkdir -p $out
    cp -a opt/rocm-${version}/* $out

    runHook postInstall
  '';

  meta = with lib; {
    description = "AQLPROFILE library for AMD HSA runtime API extension support";
    homepage = "https://rocm.docs.amd.com/en/latest/";
    license = with licenses; [ unfree ];
    maintainers = teams.rocm.members;
    platforms = platforms.linux;
    broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version;
  };
})