2022-06-16 17:23:12 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, llvmPackages
|
|
|
|
, pkg-config
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "wasmer";
|
2021-12-30 13:39:12 +00:00
|
|
|
version = "2.1.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wasmerio";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-12-30 13:39:12 +00:00
|
|
|
sha256 = "sha256-uD+JH42AxXxLMLqBurNDfYc7tLlBlEmaLB5rbip+/D4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2021-12-30 13:39:12 +00:00
|
|
|
cargoSha256 = "sha256-eiX5p2qWUZgoHzoHYXDsp9N6foiX3JovKO6MpoJOXFo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
# cranelift+jit works everywhere, see:
|
|
|
|
# https://github.com/wasmerio/wasmer/blob/master/Makefile#L22
|
|
|
|
buildFeatures = [ "cranelift" "jit" ];
|
2021-04-05 15:23:46 +00:00
|
|
|
cargoBuildFlags = [
|
|
|
|
# must target manifest and desired output bin, otherwise output is empty
|
|
|
|
"--manifest-path" "lib/cli/Cargo.toml"
|
|
|
|
"--bin" "wasmer"
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
# Can't use test-jit:
|
2021-12-30 13:39:12 +00:00
|
|
|
# error: Package `wasmer-workspace v2.1.1 (/build/source)` does not have the feature `test-jit`
|
2021-12-06 16:07:01 +00:00
|
|
|
checkFeatures = [ "test-cranelift" ];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2022-06-16 17:23:12 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "The Universal WebAssembly Runtime";
|
|
|
|
longDescription = ''
|
|
|
|
Wasmer is a standalone WebAssembly runtime for running WebAssembly outside
|
|
|
|
of the browser, supporting WASI and Emscripten. Wasmer can be used
|
|
|
|
standalone (via the CLI) and embedded in different languages, running in
|
|
|
|
x86 and ARM devices.
|
|
|
|
'';
|
|
|
|
homepage = "https://wasmer.io/";
|
|
|
|
license = licenses.mit;
|
2021-06-28 23:13:55 +00:00
|
|
|
maintainers = with maintainers; [ Br1ght0ne shamilton ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|