rocm-opencl-runtime: add update script

This commit is contained in:
Sebastian Neubauer 2021-09-08 16:14:59 +02:00
parent 315631dfe3
commit c3aa2d2e27

View File

@ -1,6 +1,7 @@
{ stdenv
, lib
, fetchFromGitHub
, writeScript
, addOpenGLRunpath
, cmake
, rocm-cmake
@ -74,6 +75,13 @@ stdenv.mkDerivation rec {
echo 'add_dependencies(amdocl64 OpenCL)' >> amdocl/CMakeLists.txt
'';
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/ROCm-OpenCL-Runtime/tags" | jq '.[].name | split("-") | .[1] | select( . != null )' --raw-output | sort -n | tail -1)"
update-source-version rocm-opencl-runtime "$version"
'';
meta = with lib; {
description = "OpenCL runtime for AMD GPUs, part of the ROCm stack";
homepage = "https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime";