2022-08-12 12:06:08 +00:00
|
|
|
{ lib
|
2024-04-21 15:54:59 +00:00
|
|
|
, stdenv
|
2022-08-12 12:06:08 +00:00
|
|
|
, fetchFromGitHub
|
2024-04-21 15:54:59 +00:00
|
|
|
, llvmPackages
|
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-07-15 17:15:38 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-08-12 12:06:08 +00:00
|
|
|
pname = "wasmedge";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "0.14.0";
|
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;
|
2024-06-05 15:53:02 +00:00
|
|
|
sha256 = "sha256-JPuJIM5OU1qCvFZEQ3gDNBZsIiJijtWLAVGp54z7lt0=";
|
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 ];
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Lightweight, high-performance, and extensible WebAssembly runtime for cloud native, edge, and decentralized applications";
|
2022-08-12 12:06:08 +00:00
|
|
|
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
|
|
|
})
|