Files
2026-07-15 14:04:39 -04:00

67 lines
1.3 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
rocmUpdateScript,
cmake,
llvm,
zlib,
zstd,
perl,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "hipify";
version = "7.2.3";
src = fetchFromGitHub {
owner = "ROCm";
repo = "HIPIFY";
rev = "rocm-${finalAttrs.version}";
hash = "sha256-LC0lnYetV7RPVw92zew6za6bDH4zmnERXUM4MVaRVtc=";
};
strictDeps = true;
nativeBuildInputs = [
cmake
perl
llvm.rocm-toolchain
];
buildInputs = [
llvm.llvm
llvm.clang-unwrapped
perl
zlib
zstd
];
env.CXXFLAGS = "-I${lib.getInclude llvm.llvm}/include -I${lib.getInclude llvm.clang-unwrapped}/include";
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace-fail "\''${LLVM_TOOLS_BINARY_DIR}/clang" "${llvm.rocm-toolchain}/bin/clang"
chmod +x bin/*
'';
passthru.updateScript = rocmUpdateScript { inherit finalAttrs; };
postInstall = ''
rm $out/bin/hipify-perl
chmod +x $out/bin/*
chmod +x $out/libexec/*
patchShebangs $out/bin/
patchShebangs $out/libexec/
ln -s $out/{libexec/hipify,bin}/hipify-perl
'';
meta = {
description = "Convert CUDA to Portable C++ Code";
homepage = "https://github.com/ROCm/HIPIFY";
license = lib.licenses.mit;
teams = [ lib.teams.rocm ];
platforms = lib.platforms.linux;
};
})