2019-10-18 09:58:25 +02:00
|
|
|
{ rustPlatform, fetchFromGitHub, lib, python, cmake, llvmPackages, clang, stdenv, darwin }:
|
2019-04-16 04:22:16 +02:00
|
|
|
|
2020-01-07 17:36:29 +01:00
|
|
|
rustPlatform.buildRustPackage rec {
|
2019-06-09 11:48:14 +02:00
|
|
|
pname = "wasmtime";
|
2020-11-10 20:30:51 +01:00
|
|
|
version = "0.21.0";
|
2019-04-16 04:22:16 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2019-11-25 12:04:40 +01:00
|
|
|
owner = "bytecodealliance";
|
2020-11-01 23:39:49 +01:00
|
|
|
repo = pname;
|
2020-04-14 19:49:12 +02:00
|
|
|
rev = "v${version}";
|
2020-11-10 20:30:51 +01:00
|
|
|
sha256 = "0q7wsnq5zdskxwzsxwm98jfnv2frnwca1dkhwndcn9yyz2gyw57m";
|
2019-04-16 04:22:16 +02:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2021-05-07 13:00:49 +02:00
|
|
|
cargoSha256 = "1wlig9gls7s1k1swxwhl82vfga30bady8286livxc4y2zp0vb18w";
|
2019-04-16 04:22:16 +02:00
|
|
|
|
|
|
|
nativeBuildInputs = [ python cmake clang ];
|
2019-10-18 09:58:25 +02:00
|
|
|
buildInputs = [ llvmPackages.libclang ] ++
|
|
|
|
lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ];
|
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";
|
2019-04-16 04:22:16 +02:00
|
|
|
|
2020-05-16 04:56:26 +02:00
|
|
|
doCheck = true;
|
2020-02-29 12:58:22 +01:00
|
|
|
|
2019-04-16 04:22:16 +02:00
|
|
|
meta = with lib; {
|
2020-01-07 17:36:29 +01:00
|
|
|
description = "Standalone JIT-style runtime for WebAssembly, using Cranelift";
|
2020-10-07 12:56:06 +02:00
|
|
|
homepage = "https://github.com/bytecodealliance/wasmtime";
|
2019-04-16 04:22:16 +02:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ maintainers.matthewbauer ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|