nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 56 lines 1.4 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 rocmUpdateScript, 6 cmake, 7 wrapPython, 8}: 9 10stdenv.mkDerivation (finalAttrs: { 11 pname = "rocm-smi"; 12 version = "6.3.3"; 13 14 src = fetchFromGitHub { 15 owner = "ROCm"; 16 repo = "rocm_smi_lib"; 17 rev = "rocm-${finalAttrs.version}"; 18 hash = "sha256-j9pkyUt+p6IkhawIhiTymqDBydxXZunxmdyCyRN0RxE="; 19 }; 20 21 patches = [ ./cmake.patch ]; 22 23 nativeBuildInputs = [ 24 cmake 25 wrapPython 26 ]; 27 28 cmakeFlags = [ 29 # Manually define CMAKE_INSTALL_<DIR> 30 # See: https://github.com/NixOS/nixpkgs/pull/197838 31 "-DCMAKE_INSTALL_BINDIR=bin" 32 "-DCMAKE_INSTALL_LIBDIR=lib" 33 "-DCMAKE_INSTALL_INCLUDEDIR=include" 34 ]; 35 36 postInstall = '' 37 wrapPythonProgramsIn $out 38 mv $out/libexec/rocm_smi/.rsmiBindingsInit.py-wrapped $out/libexec/rocm_smi/rsmiBindingsInit.py 39 mv $out/libexec/rocm_smi/.rsmiBindings.py-wrapped $out/libexec/rocm_smi/rsmiBindings.py 40 ''; 41 42 passthru.updateScript = rocmUpdateScript { 43 name = finalAttrs.pname; 44 inherit (finalAttrs.src) owner; 45 inherit (finalAttrs.src) repo; 46 }; 47 48 meta = with lib; { 49 description = "System management interface for AMD GPUs supported by ROCm"; 50 homepage = "https://github.com/ROCm/rocm_smi_lib"; 51 license = with licenses; [ mit ]; 52 maintainers = with maintainers; [ lovesegfault ]; 53 teams = [ teams.rocm ]; 54 platforms = [ "x86_64-linux" ]; 55 }; 56})