Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, stdenv
3, fetchFromGitHub
4, rocmUpdateScript
5, cmake
6, libxml2
7}:
8
9stdenv.mkDerivation (finalAttrs: {
10 pname = "hipify";
11 version = "5.4.2";
12
13 src = fetchFromGitHub {
14 owner = "ROCm-Developer-Tools";
15 repo = "HIPIFY";
16 rev = "rocm-${finalAttrs.version}";
17 hash = "sha256-EaHtI1ywjEHioWptuHvCllJ3dENtSClVoE6NpWTOa9I=";
18 };
19
20 nativeBuildInputs = [ cmake ];
21 buildInputs = [ libxml2 ];
22
23 postPatch = ''
24 substituteInPlace CMakeLists.txt \
25 --replace "\''${LLVM_TOOLS_BINARY_DIR}/clang" "${stdenv.cc}/bin/clang"
26 '';
27
28 passthru.updateScript = rocmUpdateScript {
29 name = finalAttrs.pname;
30 owner = finalAttrs.src.owner;
31 repo = finalAttrs.src.repo;
32 };
33
34 # Fixup weird install paths
35 postInstall = ''
36 mkdir -p $out/bin
37 mv $out/{*.sh,hipify-*} $out/bin
38 cp -afs $out/bin $out/hip
39 '';
40
41 meta = with lib; {
42 description = "Convert CUDA to Portable C++ Code";
43 homepage = "https://github.com/ROCm-Developer-Tools/HIPIFY";
44 license = with licenses; [ mit ];
45 maintainers = teams.rocm.members;
46 platforms = platforms.linux;
47 broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version;
48 };
49})