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
|
2024-09-26 11:04:55 +00:00
|
|
|
, withLLVM ? !stdenv.hostPlatform.isDarwin
|
|
|
|
, withSinglepass ? !(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64)
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "wasmer";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "4.3.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wasmerio";
|
|
|
|
repo = pname;
|
2023-02-02 18:25:31 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-hEhU3o/SLHWV9zmgCtW+7K/2ev+oGAnrZmlyNtoeSV4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
cargoHash = "sha256-xyR5pnwMGE5K4o7X0Q2JEervSgR5LK1vqpOa3Mm6xkU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +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
|
2024-09-26 11:04:55 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2022-11-27 09:42:12 +00:00
|
|
|
CoreFoundation
|
|
|
|
SystemConfiguration
|
|
|
|
Security
|
2021-04-05 15:23:46 +00:00
|
|
|
];
|
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
# check references to `compiler_features` in Makefile on update
|
2023-07-15 17:15:38 +00:00
|
|
|
buildFeatures = [
|
2022-11-27 09:42:12 +00:00
|
|
|
"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
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
env.LLVM_SYS_150_PREFIX = lib.optionalString withLLVM llvmPackages.llvm.dev;
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
# Tests are failing due to `Cannot allocate memory` and other reasons
|
|
|
|
doCheck = false;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Universal WebAssembly Runtime";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "wasmer";
|
2020-04-24 23:36:52 +00:00
|
|
|
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;
|
2024-01-02 11:29:13 +00:00
|
|
|
maintainers = with maintainers; [ Br1ght0ne shamilton nickcao ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|