2022-09-09 14:08:57 +00:00
|
|
|
{ lib, rustPlatform, fetchFromGitHub, makeWrapper, zig }:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "cargo-zigbuild";
|
2022-09-22 12:36:57 +00:00
|
|
|
version = "0.12.3";
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "messense";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-09-22 12:36:57 +00:00
|
|
|
sha256 = "sha256-qwOlYy9pNAKEJDgt3ML4dxDwlkyPIVO+X/q/YijEHo0=";
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
|
2022-09-22 12:36:57 +00:00
|
|
|
cargoSha256 = "sha256-8x2B8WBN9u17HS58bAwMNPEoSabNX6KzyPBLEvaGOBk=";
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/cargo-zigbuild \
|
|
|
|
--prefix PATH : ${zig}/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A tool to compile Cargo projects with zig as the linker";
|
|
|
|
homepage = "https://github.com/messense/cargo-zigbuild";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ figsoda ];
|
|
|
|
};
|
|
|
|
}
|