summaryrefslogtreecommitdiffstats
path: root/pkgs/development/ocaml-modules/wasm/default.nix
blob: 6f0974d6ea3cdf5a1434c83cb74369302f13f49b (plain)
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
{
  lib,
  fetchFromGitHub,
  menhir,
  buildDunePackage,
}:
buildDunePackage (finalAttrs: {
  pname = "wasm";
  version = "2.0.2";

  minimalOCamlVersion = "4.12";

  src = fetchFromGitHub {
    owner = "WebAssembly";
    repo = "spec";
    tag = "opam-${finalAttrs.version}";
    hash = "sha256-RbVGW6laC3trP6IhtA2tLrAYVbx0Oucox9FgoEvs6LQ=";
  };

  postUnpack = ''
    cd "$sourceRoot/interpreter"
    export sourceRoot=$PWD
  '';

  nativeBuildInputs = [
    menhir
  ];

  meta = {
    description = "Library to read and write WebAssembly (Wasm) files and manipulate their AST";
    mainProgram = "wasm";
    license = lib.licenses.asl20;
    maintainers = [ lib.maintainers.vbgl ];
    homepage = "https://github.com/WebAssembly/spec/tree/main/interpreter";
  };
})