2022-08-12 12:06:08 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
2023-07-15 17:15:38 +00:00
|
|
|
, llvmPackages_12
|
2022-08-12 12:06:08 +00:00
|
|
|
, boost
|
|
|
|
, cmake
|
|
|
|
, spdlog
|
2023-02-09 11:40:11 +00:00
|
|
|
, libxml2
|
|
|
|
, libffi
|
|
|
|
, Foundation
|
2023-07-15 17:15:38 +00:00
|
|
|
, testers
|
2022-08-12 12:06:08 +00:00
|
|
|
}:
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
let
|
2023-07-15 17:15:38 +00:00
|
|
|
llvmPackages = llvmPackages_12;
|
2023-02-09 11:40:11 +00:00
|
|
|
stdenv = llvmPackages.stdenv;
|
|
|
|
in
|
2023-07-15 17:15:38 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-08-12 12:06:08 +00:00
|
|
|
pname = "wasmedge";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "0.13.4";
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "WasmEdge";
|
|
|
|
repo = "WasmEdge";
|
2023-07-15 17:15:38 +00:00
|
|
|
rev = finalAttrs.version;
|
2023-10-09 19:29:22 +00:00
|
|
|
sha256 = "sha256-2EKUnRvd1w1TxO7OFKYpTzSXC3fdIU7Jk0MIPPTY96U=";
|
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 = [
|
|
|
|
"-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
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
postPatch = ''
|
|
|
|
echo -n $version > VERSION
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests = {
|
|
|
|
version = testers.testVersion {
|
|
|
|
package = finalAttrs.finalPackage;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
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-07-15 17:15:38 +00:00
|
|
|
platforms = platforms.all;
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
})
|