depot/third_party/nixpkgs/pkgs/development/tools/wasmedge/default.nix
Default email d5f4a57cbf Project import generated by Copybara.
GitOrigin-RevId: ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e
2023-08-10 09:59:29 +02:00

67 lines
1.3 KiB
Nix

{ lib
, fetchFromGitHub
, llvmPackages_12
, boost
, cmake
, spdlog
, libxml2
, libffi
, Foundation
, testers
}:
let
llvmPackages = llvmPackages_12;
stdenv = llvmPackages.stdenv;
in
stdenv.mkDerivation (finalAttrs: {
pname = "wasmedge";
version = "0.13.3";
src = fetchFromGitHub {
owner = "WasmEdge";
repo = "WasmEdge";
rev = finalAttrs.version;
sha256 = "sha256-IZMYeuneKtcuvbEVgkF2C3gbxJe7GlXRNEYwpFxtiKA=";
};
nativeBuildInputs = [
cmake
llvmPackages.lld
];
buildInputs = [
boost
spdlog
llvmPackages.llvm
libxml2
libffi
] ++ lib.optionals stdenv.isDarwin [
Foundation
];
cmakeFlags = [
"-DCMAKE_BUILD_TYPE=Release"
"-DWASMEDGE_BUILD_TESTS=OFF" # Tests are downloaded using git
] ++ lib.optionals stdenv.isDarwin [
"-DWASMEDGE_FORCE_DISABLE_LTO=ON"
];
postPatch = ''
echo -n $version > VERSION
'';
passthru.tests = {
version = testers.testVersion {
package = finalAttrs.finalPackage;
};
};
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 ];
platforms = platforms.all;
};
})