2021-01-21 18:00:13 +01:00
|
|
|
{ lib, stdenv
|
2020-07-10 17:01:24 +02:00
|
|
|
, fetchFromGitHub
|
2021-09-08 16:14:29 +02:00
|
|
|
, writeScript
|
2020-07-10 17:01:24 +02:00
|
|
|
, cmake
|
|
|
|
, pkg-config
|
2021-11-08 11:08:20 +01:00
|
|
|
, libdrm
|
2020-07-10 17:01:24 +02:00
|
|
|
, numactl
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "rocm-thunk";
|
2022-03-13 17:14:23 +01:00
|
|
|
version = "5.0.2";
|
2020-07-10 17:01:24 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "RadeonOpenCompute";
|
|
|
|
repo = "ROCT-Thunk-Interface";
|
|
|
|
rev = "rocm-${version}";
|
2022-03-13 17:14:23 +01:00
|
|
|
hash = "sha256-hhDLy92jS/akp1Ozun45OEjVbVcjufkRIfC8bqqFjp4=";
|
2020-07-10 17:01:24 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
export cmakeFlags="$cmakeFlags "
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
|
|
|
|
2021-11-08 11:08:20 +01:00
|
|
|
buildInputs = [ libdrm numactl ];
|
2020-07-10 17:01:24 +02:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
cp -r $src/include $out
|
|
|
|
'';
|
|
|
|
|
2021-09-08 16:14:29 +02:00
|
|
|
passthru.updateScript = writeScript "update.sh" ''
|
|
|
|
#!/usr/bin/env nix-shell
|
|
|
|
#!nix-shell -i bash -p curl jq common-updater-scripts
|
|
|
|
version="$(curl -sL "https://api.github.com/repos/RadeonOpenCompute/ROCT-Thunk-Interface/tags" | jq '.[].name | split("-") | .[1] | select( . != null )' --raw-output | sort -n | tail -1)"
|
|
|
|
update-source-version rocm-thunk "$version"
|
|
|
|
'';
|
|
|
|
|
2021-01-21 18:00:13 +01:00
|
|
|
meta = with lib; {
|
2020-07-10 17:01:24 +02:00
|
|
|
description = "Radeon open compute thunk interface";
|
|
|
|
homepage = "https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface";
|
|
|
|
license = with licenses; [ bsd2 mit ];
|
2021-09-02 21:54:58 +02:00
|
|
|
maintainers = with maintainers; [ lovesegfault ];
|
2020-07-10 17:01:24 +02:00
|
|
|
};
|
|
|
|
}
|