24fdeddc0a
GitOrigin-RevId: 2768c7d042a37de65bb1b5b3268fc987e534c49d
76 lines
2 KiB
Nix
76 lines
2 KiB
Nix
{ stdenv
|
|
, lib
|
|
, rustPlatform
|
|
, fetchFromGitHub
|
|
, llvmPackages
|
|
, libffi
|
|
, libxml2
|
|
, CoreFoundation
|
|
, SystemConfiguration
|
|
, Security
|
|
, withLLVM ? false
|
|
, withSinglepass ? !(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64)
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "wasmer";
|
|
version = "4.4.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "wasmerio";
|
|
repo = pname;
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-zKo7d7LAfdGb7hC8RK7YH4lhk7RbivS+hNZDyQyHYM8=";
|
|
};
|
|
|
|
cargoHash = "sha256-tajvVMRfBHefU0kVro830HeJSdgJEKPmEQm7X0+4+Kc=";
|
|
|
|
nativeBuildInputs = [
|
|
rustPlatform.bindgenHook
|
|
];
|
|
|
|
buildInputs = lib.optionals withLLVM [
|
|
llvmPackages.llvm
|
|
libffi
|
|
libxml2
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
CoreFoundation
|
|
SystemConfiguration
|
|
Security
|
|
];
|
|
|
|
# check references to `compiler_features` in Makefile on update
|
|
buildFeatures = [
|
|
"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" ];
|
|
|
|
env.LLVM_SYS_150_PREFIX = lib.optionalString withLLVM llvmPackages.llvm.dev;
|
|
|
|
# Tests are failing due to `Cannot allocate memory` and other reasons
|
|
doCheck = false;
|
|
|
|
meta = with lib; {
|
|
description = "Universal WebAssembly Runtime";
|
|
mainProgram = "wasmer";
|
|
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;
|
|
maintainers = with maintainers; [ Br1ght0ne shamilton nickcao ];
|
|
# error: multiple fields are never read
|
|
# --> lib/compiler-llvm/src/translator/intrinsics.rs:141:9
|
|
broken = withLLVM;
|
|
};
|
|
}
|