1{ lib
2, rustPlatform
3, fetchFromGitHub
4, pkg-config
5, openssl
6, stdenv
7, darwin
8}:
9
10rustPlatform.buildRustPackage rec {
11 pname = "cargo-component";
12 version = "0.4.0";
13
14 src = fetchFromGitHub {
15 owner = "bytecodealliance";
16 repo = "cargo-component";
17 rev = "v${version}";
18 hash = "sha256-XJKychPpBYMzFlW9jUPaBWuNAlcbqUQwxy+cMW2Ivyg=";
19 };
20
21 cargoHash = "sha256-cEmbXitYGztfBS5M9uczgmFPKRktP4skFETx8SJah2A=";
22
23 nativeBuildInputs = [
24 pkg-config
25 ];
26
27 buildInputs = [
28 openssl
29 ] ++ lib.optionals stdenv.isDarwin [
30 darwin.apple_sdk.frameworks.SystemConfiguration
31 ];
32
33 # requires the wasm32-wasi target
34 doCheck = false;
35
36 meta = with lib; {
37 description = "A Cargo subcommand for creating WebAssembly components based on the component model proposal";
38 homepage = "https://github.com/bytecodealliance/cargo-component";
39 changelog = "https://github.com/bytecodealliance/cargo-component/releases/tag/${src.rev}";
40 license = licenses.asl20;
41 maintainers = with maintainers; [ figsoda ];
42 mainProgram = "cargo-component";
43 };
44}