nixpkgs/pkgs/development/libraries/rocm-thunk/default.nix
Madoura 6bb3a9baee
rocm-related: use finalAttrs
hip: use finalAttrs

rocm-llvm: use finalAttrs

clang-ocl: use finalAttrs

composable_kernel: use finalAttrs

hipcub: use finalAttrs

hipsparse: use finalAttrs

miopengemm: use finalAttrs

rccl: use finalAttrs

rocblas: use finalAttrs

rocclr: use finalAttrs

rocfft: use finalAttrs

rocm-comgr: use finalAttrs

rocm-device-libs: use finalAttrs

rocm-opencl-runtime: use finalAttrs

rocm-runtime: use finalAttrs

rocm-thunk: use finalAttrs

rocmlir: use finalAttrs

rocprim: use finalAttrs

rocsparse: use finalAttrs

rocthrust: use finalAttrs

rocm-cmake: use finalAttrs

rocminfo: use finalAttrs

rocm-smi: use finalAttrs
2022-11-24 01:23:03 -06:00

54 lines
1.5 KiB
Nix

{ lib, stdenv
, fetchFromGitHub
, writeScript
, cmake
, pkg-config
, libdrm
, numactl
}:
stdenv.mkDerivation (finalAttrs: {
pname = "rocm-thunk";
version = "5.3.3";
src = fetchFromGitHub {
owner = "RadeonOpenCompute";
repo = "ROCT-Thunk-Interface";
rev = "rocm-${finalAttrs.version}";
hash = "sha256-cM78Bx6uYsxhvdqSVNgmqOUYQnUJVCA7mNpRNNSFv6k=";
};
preConfigure = ''
export cmakeFlags="$cmakeFlags "
'';
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ libdrm numactl ];
# https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/issues/75
postPatch = ''
substituteInPlace libhsakmt.pc.in \
--replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \
--replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@
'';
postInstall = ''
cp -r $src/include $out
'';
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" --ignore-same-hash
'';
meta = with lib; {
description = "Radeon open compute thunk interface";
homepage = "https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface";
license = with licenses; [ bsd2 mit ];
maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members;
};
})