2022-08-12 12:06:08 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, llvmPackages
|
|
|
|
, boost
|
|
|
|
, cmake
|
|
|
|
, gtest
|
|
|
|
, spdlog
|
2023-02-09 11:40:11 +00:00
|
|
|
, libxml2
|
|
|
|
, libffi
|
|
|
|
, Foundation
|
2022-08-12 12:06:08 +00:00
|
|
|
}:
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
let
|
|
|
|
stdenv = llvmPackages.stdenv;
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2022-08-12 12:06:08 +00:00
|
|
|
pname = "wasmedge";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "0.12.1";
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "WasmEdge";
|
|
|
|
repo = "WasmEdge";
|
|
|
|
rev = version;
|
2023-05-24 13:37:59 +00:00
|
|
|
sha256 = "sha256-pBaa90jvR4tLgVOBZEJOEUY2+VnBmdSN5kkJMB8wdUA=";
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
llvmPackages.lld
|
|
|
|
];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
buildInputs = [
|
|
|
|
boost
|
|
|
|
spdlog
|
|
|
|
llvmPackages.llvm
|
2023-02-09 11:40:11 +00:00
|
|
|
libxml2
|
|
|
|
libffi
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
Foundation
|
2022-08-12 12:06:08 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_BUILD_TYPE=Release"
|
|
|
|
"-DWASMEDGE_BUILD_TESTS=OFF" # Tests are downloaded using git
|
2023-02-09 11:40:11 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
"-DWASMEDGE_FORCE_DISABLE_LTO=ON"
|
2022-08-12 12:06:08 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
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 ];
|
2023-02-09 11:40:11 +00:00
|
|
|
# error: no member named 'utimensat' in the global namespace
|
|
|
|
broken = stdenv.isDarwin && stdenv.isx86_64;
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
}
|