2023-02-07 21:08:11 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, testers
|
|
|
|
, wizer
|
|
|
|
}:
|
2022-08-01 16:20:52 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "wizer";
|
2024-01-04 05:16:50 +00:00
|
|
|
version = "4.0.0";
|
2023-02-07 20:35:33 +00:00
|
|
|
|
|
|
|
# the crate does not contain files which are necessary for the tests
|
|
|
|
# see https://github.com/bytecodealliance/wizer/commit/3a95e27ce42f1fdaef07b52988e4699eaa221e04
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bytecodealliance";
|
|
|
|
repo = "wizer";
|
2023-05-30 18:05:19 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-04 05:16:50 +00:00
|
|
|
hash = "sha256-KFMfNgoKZWVLXNUYHWpAP8CCnVQLv/cDmQgzz29lKxQ=";
|
2022-08-01 16:20:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-04 05:16:50 +00:00
|
|
|
cargoHash = "sha256-kKN2JwzuFe7q8VZcKOjc5PkN3isHzzQcTJAvapGBdAE=";
|
2022-08-01 16:20:52 +00:00
|
|
|
|
|
|
|
cargoBuildFlags = [ "--bin" pname ];
|
|
|
|
|
|
|
|
buildFeatures = [ "env_logger" "structopt" ];
|
|
|
|
|
|
|
|
# Setting $HOME to a temporary directory is necessary to prevent checks from failing, as
|
|
|
|
# the test suite creates a cache directory at $HOME/Library/Caches/BytecodeAlliance.wasmtime.
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
2023-02-07 21:08:11 +00:00
|
|
|
passthru.tests = {
|
|
|
|
version = testers.testVersion { package = wizer; };
|
|
|
|
};
|
|
|
|
|
2022-08-01 16:20:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "The WebAssembly pre-initializer";
|
|
|
|
homepage = "https://github.com/bytecodealliance/wizer";
|
|
|
|
license = licenses.asl20;
|
2023-02-07 20:14:48 +00:00
|
|
|
maintainers = with maintainers; [ lucperkins amesgen ];
|
2022-08-01 16:20:52 +00:00
|
|
|
};
|
|
|
|
}
|