about summary refs log tree commit diff
path: root/pkgs/development/tools/wasmedge/default.nix
blob: edcdf0d8c1e1de641ca51a16619ea23fe7043d72 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{ lib
, fetchFromGitHub
, llvmPackages
, boost
, cmake
, gtest
, spdlog
, Foundation
, libxml2
, libffi
}:

llvmPackages.stdenv.mkDerivation rec {
  pname = "wasmedge";
  version = "0.11.2";

  src = fetchFromGitHub {
    owner = "WasmEdge";
    repo = "WasmEdge";
    rev = version;
    sha256 = "sha256-P2Y2WK6G8aEK1Q4hjrS9X+2WbOfy4brclB/+SWP5LTM=";
  };

  nativeBuildInputs = [
    cmake
    llvmPackages.lld
  ] ++ lib.optionals llvmPackages.stdenv.isDarwin [ Foundation ];

  buildInputs = [
    boost
    spdlog
    llvmPackages.llvm
  ];

  nativeBuildInputs = [ cmake llvmPackages.lld ];

  nativeCheckInputs = [ gtest ];

  cmakeFlags = [
    "-DCMAKE_BUILD_TYPE=Release"
    "-DWASMEDGE_BUILD_TESTS=OFF" # Tests are downloaded using git
  ] ++ lib.optional llvmPackages.stdenv.isDarwin "-DWASMEDGE_FORCE_DISABLE_LTO=ON";

  meta = with lib; {
    homepage = "https://wasmedge.org/";
    license = with licenses; [ asl20 ];
    description = "A lightweight, high-performance, and extensible WebAssembly runtime for cloud native, edge, and decentralized applications";
    maintainers = with maintainers; [ dit7ya ];
  };
}