2022-05-29 00:56:40 +02:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2020-01-09 11:59:51 +01:00
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, llvmPackages
|
|
|
|
, pkg-config
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "wasmer";
|
2022-07-31 07:56:06 +02:00
|
|
|
version = "2.3.0";
|
2020-01-09 11:59:51 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wasmerio";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-07-31 07:56:06 +02:00
|
|
|
sha256 = "sha256-25wWgMNybbsEf/1xmm+8BPcjx8CSW9ZBzxGKT/DbBXw=";
|
2020-01-09 11:59:51 +01:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2022-07-31 07:56:06 +02:00
|
|
|
cargoSha256 = "sha256-tswsbijNN5UcSZovVmy66yehcEOpQDGMdRgR/1mkuE8=";
|
2020-01-09 11:59:51 +01:00
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
|
|
|
|
2021-11-16 01:36:07 +01:00
|
|
|
# cranelift+jit works everywhere, see:
|
|
|
|
# https://github.com/wasmerio/wasmer/blob/master/Makefile#L22
|
|
|
|
buildFeatures = [ "cranelift" "jit" ];
|
2021-04-01 10:14:40 +02:00
|
|
|
cargoBuildFlags = [
|
|
|
|
# must target manifest and desired output bin, otherwise output is empty
|
|
|
|
"--manifest-path" "lib/cli/Cargo.toml"
|
|
|
|
"--bin" "wasmer"
|
|
|
|
];
|
|
|
|
|
2021-11-16 01:36:07 +01:00
|
|
|
# Can't use test-jit:
|
2022-07-31 07:56:06 +02:00
|
|
|
# error: Package `wasmer-workspace v2.3.0 (/build/source)` does not have the feature `test-jit`
|
2021-11-16 01:36:07 +01:00
|
|
|
checkFeatures = [ "test-cranelift" ];
|
2020-09-09 10:16:52 +02:00
|
|
|
|
llvmPackages: Multuple outputs for everythting
Also begin to start work on cross compilation, though that will have to
be finished later.
The patches are based on the first version of
https://reviews.llvm.org/D99484. It's very annoying to do the
back-porting but the review has uncovered nothing super major so I'm
fine sticking with what I've got.
Beyond making the outputs work, I also strove to re-sync the packages,
as they have been drifting pointlessly apart for some time.
----
Other misc notes, highly incomplete
- lvm-config-native and llvm-config are put in `dev` because they are
tools just for build time.
- Clang no longer has an lld dep. That was introduced in
db29857eb391ed002046090851a44c452b80bdbd, but if clang needs help
finding lld when it is used we should just pass it flags / put in the
resource dir. Providing it at build time increases critical path
length for no good reason.
----
A note on `nativeCC`:
`stdenv` takes tools from the previous stage, so:
1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.stdenv.cc`: `(?0, ?1, x)`
while:
1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.targetPackages`: `(x, x, ?2)`
3. `pkgsBuildBuild.targetPackages.stdenv.cc`: `(?1, x, x)`
2020-10-15 10:23:57 +02:00
|
|
|
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
|
2020-01-09 11:59:51 +01:00
|
|
|
|
|
|
|
meta = with lib; {
|
2022-05-29 00:56:40 +02:00
|
|
|
broken = stdenv.isDarwin;
|
2020-01-09 11:59:51 +01: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-21 14:07:53 +02:00
|
|
|
maintainers = with maintainers; [ Br1ght0ne shamilton ];
|
2020-01-09 11:59:51 +01:00
|
|
|
};
|
|
|
|
}
|