1{ lib, rustPlatform, fetchFromGitHub, makeWrapper, zig }:
2
3rustPlatform.buildRustPackage rec {
4 pname = "cargo-zigbuild";
5 version = "0.18.4";
6
7 src = fetchFromGitHub {
8 owner = "messense";
9 repo = pname;
10 rev = "v${version}";
11 hash = "sha256-J9R/cT58wjvDcS5AKhGtbxbFYiNGFBmrLtIF2CfTIaE=";
12 };
13
14 cargoHash = "sha256-F9QOlYpKAQx7xF6yyGa/tOkziEyXCg5LW6gH0X6uXRc=";
15
16 nativeBuildInputs = [ makeWrapper ];
17
18 postInstall = ''
19 wrapProgram $out/bin/cargo-zigbuild \
20 --prefix PATH : ${zig}/bin
21 '';
22
23 meta = with lib; {
24 description = "A tool to compile Cargo projects with zig as the linker";
25 mainProgram = "cargo-zigbuild";
26 homepage = "https://github.com/messense/cargo-zigbuild";
27 changelog = "https://github.com/messense/cargo-zigbuild/releases/tag/v${version}";
28 license = licenses.mit;
29 maintainers = with maintainers; [ figsoda ];
30 };
31}