2021-01-21 18:00:13 +01:00
|
|
|
{ lib, stdenv
|
2020-07-10 20:34:25 +02:00
|
|
|
, fetchFromGitHub
|
2021-09-08 19:12:32 +02:00
|
|
|
, writeScript
|
2020-07-10 20:34:25 +02:00
|
|
|
, rocm-comgr
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "rocclr";
|
2022-03-13 17:01:08 +01:00
|
|
|
version = "5.0.2";
|
2020-07-10 20:34:25 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ROCm-Developer-Tools";
|
|
|
|
repo = "ROCclr";
|
2020-08-21 08:38:43 +02:00
|
|
|
rev = "rocm-${version}";
|
2022-03-13 17:01:08 +01:00
|
|
|
hash = "sha256-x6XwYxgiCoy6Q7gIevSTEWgUQ0aEjPFhKSqMqQahHig=";
|
2020-07-10 20:34:25 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace device/comgrctx.cpp \
|
|
|
|
--replace "libamd_comgr.so" "${rocm-comgr}/lib/libamd_comgr.so"
|
|
|
|
'';
|
|
|
|
|
2021-11-08 11:09:01 +01:00
|
|
|
buildPhase = "";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2020-07-10 20:34:25 +02:00
|
|
|
|
2021-11-08 11:09:01 +01:00
|
|
|
mkdir -p $out
|
|
|
|
cp -r * $out/
|
2020-11-03 08:50:47 +01:00
|
|
|
|
2021-11-08 11:09:01 +01:00
|
|
|
runHook postInstall
|
2020-07-10 20:34:25 +02:00
|
|
|
'';
|
|
|
|
|
2021-09-08 19:12:32 +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/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 18:00:13 +01:00
|
|
|
meta = with lib; {
|
2021-11-08 11:09:01 +01:00
|
|
|
description = "Source package of the Radeon Open Compute common language runtime";
|
2020-07-10 20:34:25 +02:00
|
|
|
homepage = "https://github.com/ROCm-Developer-Tools/ROCclr";
|
|
|
|
license = licenses.mit;
|
2021-09-02 22:07:20 +02:00
|
|
|
maintainers = with maintainers; [ lovesegfault ];
|
2020-07-10 20:34:25 +02: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" ];
|
|
|
|
};
|
|
|
|
}
|