1{ lib
2, stdenv
3, rustPlatform
4, fetchFromGitHub
5, testers
6, wizer
7}:
8
9rustPlatform.buildRustPackage rec {
10 pname = "wizer";
11 version = "1.6.0";
12
13 # the crate does not contain files which are necessary for the tests
14 # see https://github.com/bytecodealliance/wizer/commit/3a95e27ce42f1fdaef07b52988e4699eaa221e04
15 src = fetchFromGitHub {
16 owner = "bytecodealliance";
17 repo = "wizer";
18 # see https://github.com/bytecodealliance/wizer/pull/62
19 rev = "e74c6e59562c4b7edcda506674db8aead878a893";
20 sha256 = "sha256-bVxjcb231Ygz+z+8D1U2YQqEdIKsostxISgYt2KecXc=";
21 };
22
23 cargoSha256 = "sha256-S9h47aGG5UhwNoOnUHFrtEyByg8iCMC88Cspb/6tb8c=";
24
25 cargoBuildFlags = [ "--bin" pname ];
26
27 buildFeatures = [ "env_logger" "structopt" ];
28
29 # Setting $HOME to a temporary directory is necessary to prevent checks from failing, as
30 # the test suite creates a cache directory at $HOME/Library/Caches/BytecodeAlliance.wasmtime.
31 preCheck = ''
32 export HOME=$(mktemp -d)
33 '';
34
35 passthru.tests = {
36 version = testers.testVersion { package = wizer; };
37 };
38
39 meta = with lib; {
40 description = "The WebAssembly pre-initializer";
41 homepage = "https://github.com/bytecodealliance/wizer";
42 license = licenses.asl20;
43 maintainers = with maintainers; [ lucperkins amesgen ];
44 };
45}