forked from WasmEdge/WasmEdge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
51 lines (47 loc) · 1.42 KB
/
flake.nix
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
51
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
llvmPackages = pkgs.llvmPackages_18;
wasmedge_buildInputs = with pkgs; [
cmake
llvmPackages.clang-unwrapped
llvmPackages.lld
llvmPackages.llvm
openssl
pkg-config
libxml2
spdlog
] ++ pkgs.lib.optionals (system == "x86_64-darwin" || system == "aarch64-darwin") [
pkgs.darwin.apple_sdk.frameworks.Foundation
];
wasmedge = pkgs.stdenv.mkDerivation {
name = "wasmedge";
version = "0.14.0";
src = ./.;
buildInputs = wasmedge_buildInputs;
cmakeFlags = [
"-DCMAKE_BUILD_TYPE=Debug"
"-DWASMEDGE_BUILD_PLUGINS=OFF"
"-DWASMEDGE_BUILD_TESTS=OFF"
"-DWASMEDGE_USE_LLVM=ON"
];
};
in with pkgs; rec {
packages = { wasmedge = wasmedge; };
packages.default = packages.wasmedge;
devShells.default = mkShell {
buildInputs = [
wasmedge
ninja
gcovr
] ++ wasmedge_buildInputs;
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
};
});
}