lol
1{ lib, stdenv
2, fetchFromGitHub
3, writeScript
4, cmake
5, clang
6, clang-unwrapped
7, lld
8, llvm
9}:
10
11stdenv.mkDerivation rec {
12 pname = "rocm-device-libs";
13 version = "4.3.1";
14
15 src = fetchFromGitHub {
16 owner = "RadeonOpenCompute";
17 repo = "ROCm-Device-Libs";
18 rev = "rocm-${version}";
19 hash = "sha256-fPD9vevO2UDaFaclSI0CC/lRfM5WemWmxP1K5ajXHbk=";
20 };
21
22 nativeBuildInputs = [ cmake ];
23
24 buildInputs = [ clang lld llvm ];
25
26 cmakeBuildType = "Release";
27
28 cmakeFlags = [
29 "-DCMAKE_PREFIX_PATH=${llvm}/lib/cmake/llvm;${clang-unwrapped}/lib/cmake/clang"
30 "-DLLVM_TARGETS_TO_BUILD='AMDGPU;X86'"
31 "-DCLANG=${clang}/bin/clang"
32 ];
33
34 passthru.updateScript = writeScript "update.sh" ''
35 #!/usr/bin/env nix-shell
36 #!nix-shell -i bash -p curl jq common-updater-scripts
37 version="$(curl -sL "https://api.github.com/repos/RadeonOpenCompute/ROCm-Device-Libs/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
38 update-source-version rocm-device-libs "$version"
39 '';
40
41 meta = with lib; {
42 description = "Set of AMD-specific device-side language runtime libraries";
43 homepage = "https://github.com/RadeonOpenCompute/ROCm-Device-Libs";
44 license = licenses.ncsa;
45 maintainers = with maintainers; [ lovesegfault ];
46 platforms = platforms.linux;
47 };
48}