2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv
|
2020-07-10 19:34:25 +01:00
|
|
|
, fetchFromGitHub
|
2021-09-08 18:12:32 +01:00
|
|
|
, writeScript
|
2020-07-10 19:34:25 +01:00
|
|
|
, rocm-comgr
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "rocclr";
|
2021-11-08 10:09:01 +00:00
|
|
|
version = "4.5.2";
|
2020-07-10 19:34:25 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ROCm-Developer-Tools";
|
|
|
|
repo = "ROCclr";
|
2020-08-21 07:38:43 +01:00
|
|
|
rev = "rocm-${version}";
|
2021-11-08 10:09:01 +00:00
|
|
|
hash = "sha256-fsQANBND/oDeC/+wmCH/aLlDTxPIi7Z/oN1HnNHHnm0=";
|
2020-07-10 19:34:25 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace device/comgrctx.cpp \
|
|
|
|
--replace "libamd_comgr.so" "${rocm-comgr}/lib/libamd_comgr.so"
|
|
|
|
'';
|
|
|
|
|
2021-11-08 10:09:01 +00:00
|
|
|
buildPhase = "";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2020-07-10 19:34:25 +01:00
|
|
|
|
2021-11-08 10:09:01 +00:00
|
|
|
mkdir -p $out
|
|
|
|
cp -r * $out/
|
2020-11-03 07:50:47 +00:00
|
|
|
|
2021-11-08 10:09:01 +00:00
|
|
|
runHook postInstall
|
2020-07-10 19:34:25 +01:00
|
|
|
'';
|
|
|
|
|
2021-09-08 18:12:32 +01: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/ROCm-Developer-Tools/ROCclr/tags" | jq '.[].name | split("-") | .[1] | select( . != null )' --raw-output | sort -n | tail -1)"
|
|
|
|
update-source-version rocclr "$version"
|
|
|
|
'';
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2021-11-08 10:09:01 +00:00
|
|
|
description = "Source package of the Radeon Open Compute common language runtime";
|
2020-07-10 19:34:25 +01:00
|
|
|
homepage = "https://github.com/ROCm-Developer-Tools/ROCclr";
|
|
|
|
license = licenses.mit;
|
2021-09-02 21:07:20 +01:00
|
|
|
maintainers = with maintainers; [ lovesegfault ];
|
2020-07-10 19:34:25 +01:00
|
|
|
# rocclr seems to have some AArch64 ifdefs, but does not seem
|
|
|
|
# to be supported yet by the build infrastructure. Recheck in
|
|
|
|
# the future.
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|