1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 menhir,
6 odoc,
7 buildDunePackage,
8}:
9buildDunePackage rec {
10 pname = "wasm";
11 version = "2.0.2";
12
13 minimalOCamlVersion = "4.12";
14
15 src = fetchFromGitHub {
16 owner = "WebAssembly";
17 repo = "spec";
18 tag = "opam-${version}";
19 hash = "sha256-RbVGW6laC3trP6IhtA2tLrAYVbx0Oucox9FgoEvs6LQ=";
20 };
21
22 postUnpack = ''
23 cd "$sourceRoot/interpreter"
24 export sourceRoot=$PWD
25 '';
26
27 # x86_64-unknown-linux-musl-ld: -r and -pie may not be used together
28 hardeningDisable = lib.optional stdenv.hostPlatform.isStatic "pie";
29
30 nativeBuildInputs = [
31 menhir
32 odoc
33 ];
34
35 meta = {
36 description = "Library to read and write WebAssembly (Wasm) files and manipulate their AST";
37 mainProgram = "wasm";
38 license = lib.licenses.asl20;
39 maintainers = [ lib.maintainers.vbgl ];
40 homepage = "https://github.com/WebAssembly/spec/tree/main/interpreter";
41 };
42}