nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, stdenv
3, fetchFromGitHub
4, rocmUpdateScript
5, pkg-config
6, cmake
7, rocm-cmake
8, libdrm
9, numactl
10, valgrind
11, gcc
12}:
13
14stdenv.mkDerivation (finalAttrs: {
15 pname = "rocm-thunk";
16 version = "5.4.4";
17
18 src = fetchFromGitHub {
19 owner = "RadeonOpenCompute";
20 repo = "ROCT-Thunk-Interface";
21 rev = "rocm-${finalAttrs.version}";
22 hash = "sha256-EU5toaKzVeZpdm/YhaQ0bXq0eoYwYQ5qGLUJzxgZVjE=";
23 };
24
25 nativeBuildInputs = [
26 pkg-config
27 cmake
28 rocm-cmake
29 ];
30
31 buildInputs = [
32 libdrm
33 numactl
34 valgrind
35 gcc.cc.libgcc or null # TODO: unhack this?
36 ];
37
38 cmakeFlags = [
39 # Manually define CMAKE_INSTALL_<DIR>
40 # See: https://github.com/NixOS/nixpkgs/pull/197838
41 "-DCMAKE_INSTALL_BINDIR=bin"
42 "-DCMAKE_INSTALL_LIBDIR=lib"
43 "-DCMAKE_INSTALL_INCLUDEDIR=include"
44 ];
45
46 passthru.updateScript = rocmUpdateScript {
47 name = finalAttrs.pname;
48 owner = finalAttrs.src.owner;
49 repo = finalAttrs.src.repo;
50 };
51
52 meta = with lib; {
53 description = "Radeon open compute thunk interface";
54 homepage = "https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface";
55 license = with licenses; [ bsd2 mit ];
56 maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members;
57 platforms = platforms.linux;
58 broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version;
59 };
60})