1 { stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild }:
3 if lib.versionOlder ocaml.version "4.08"
4 then throw "wasm is not available for OCaml ${ocaml.version}"
7 stdenv.mkDerivation rec {
8 pname = "ocaml${ocaml.version}-wasm";
11 src = fetchFromGitHub {
12 owner = "WebAssembly";
14 rev = "opam-${version}";
15 hash = "sha256-5eo8MIui2GxRS5X9az0NlLGZfxi5KGsTI/EaP6m/zts=";
18 nativeBuildInputs = [ ocaml findlib ocamlbuild ];
21 # x86_64-unknown-linux-musl-ld: -r and -pie may not be used together
22 hardeningDisable = lib.optional stdenv.hostPlatform.isStatic "pie";
24 makeFlags = [ "-C" "interpreter" ];
26 createFindlibDestdir = true;
30 cp -L interpreter/wasm $out/bin
34 description = "An executable and OCaml library to run, read and write Web Assembly (wasm) files and manipulate their AST";
35 license = lib.licenses.asl20;
36 maintainers = [ lib.maintainers.vbgl ];
37 homepage = "https://github.com/WebAssembly/spec/tree/master/interpreter";
38 inherit (ocaml.meta) platforms;