2022-06-16 17:23:12 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, llvmPackages
|
2022-11-27 09:42:12 +00:00
|
|
|
, libffi
|
|
|
|
, libxml2
|
|
|
|
, CoreFoundation
|
|
|
|
, SystemConfiguration
|
|
|
|
, Security
|
|
|
|
, withLLVM ? !stdenv.isDarwin
|
|
|
|
, withSinglepass ? !(stdenv.isDarwin && stdenv.isx86_64)
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "wasmer";
|
2022-12-17 10:02:37 +00:00
|
|
|
version = "3.1.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wasmerio";
|
|
|
|
repo = pname;
|
2022-11-27 09:42:12 +00:00
|
|
|
rev = "v${version}";
|
2022-12-17 10:02:37 +00:00
|
|
|
sha256 = "sha256-t/ObsvUSNGFvHkVH2nl8vLFI+5GUQx6niCgeH4ykk/0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
cargoSha256 = "sha256-75/0D0lrV50wH51Ll7M1Lvqj2kRSaJXiQWElxCaF9mE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
nativeBuildInputs = [ rustPlatform.bindgenHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
buildInputs = lib.optionals withLLVM [
|
|
|
|
llvmPackages.llvm
|
|
|
|
libffi
|
|
|
|
libxml2
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
CoreFoundation
|
|
|
|
SystemConfiguration
|
|
|
|
Security
|
2021-04-05 15:23:46 +00:00
|
|
|
];
|
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
LLVM_SYS_120_PREFIX = lib.optionalString withLLVM llvmPackages.llvm.dev;
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
# check references to `compiler_features` in Makefile on update
|
|
|
|
buildFeatures = checkFeatures ++ [
|
|
|
|
"webc_runner"
|
|
|
|
];
|
|
|
|
|
|
|
|
checkFeatures = [
|
|
|
|
"cranelift"
|
|
|
|
"wasmer-artifact-create"
|
|
|
|
"static-artifact-create"
|
|
|
|
"wasmer-artifact-load"
|
|
|
|
"static-artifact-load"
|
|
|
|
]
|
|
|
|
++ lib.optional withLLVM "llvm"
|
|
|
|
++ lib.optional withSinglepass "singlepass";
|
|
|
|
|
|
|
|
cargoBuildFlags = [ "--manifest-path" "lib/cli/Cargo.toml" "--bin" "wasmer" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|