nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 pkg-config,
6 openssl,
7 versionCheckHook,
8 nix-update-script,
9}:
10
11rustPlatform.buildRustPackage (finalAttrs: {
12 pname = "cargo-component";
13 version = "0.21.1";
14
15 src = fetchFromGitHub {
16 owner = "bytecodealliance";
17 repo = "cargo-component";
18 tag = "v${finalAttrs.version}";
19 hash = "sha256-Tlx14q/2k/0jZZ1nECX7zF/xNTeMCZg/fN+fhRM4uhc=";
20 };
21
22 cargoHash = "sha256-ZwxVhoqAzkaIgcH9GMR+IGkJ6IOQVtmt0qcDjdix6cU=";
23
24 nativeBuildInputs = [
25 pkg-config
26 ];
27
28 buildInputs = [
29 openssl
30 ];
31
32 # requires the wasm32-wasi target
33 doCheck = false;
34
35 doInstallCheck = true;
36 nativeInstallCheckInputs = [ versionCheckHook ];
37 versionCheckProgramArg = "--version";
38
39 passthru.updateScript = nix-update-script { };
40
41 meta = {
42 description = "Cargo subcommand for creating WebAssembly components based on the component model proposal";
43 homepage = "https://github.com/bytecodealliance/cargo-component";
44 changelog = "https://github.com/bytecodealliance/cargo-component/releases/tag/v${finalAttrs.version}";
45 license = lib.licenses.asl20;
46 maintainers = [ lib.maintainers.progrm_jarvis ];
47 mainProgram = "cargo-component";
48 };
49})