2021-01-11 15:49:15 +03:00
|
|
|
{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild }:
|
2017-08-03 21:40:07 +03:00
|
|
|
|
2021-01-11 15:49:15 +03:00
|
|
|
if !lib.versionAtLeast ocaml.version "4.02"
|
2017-08-03 21:40:07 +03:00
|
|
|
then throw "wasm is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "ocaml${ocaml.version}-wasm-${version}";
|
2020-05-10 12:27:59 +03:00
|
|
|
version = "1.1.1";
|
2017-08-03 21:40:07 +03:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "WebAssembly";
|
|
|
|
repo = "spec";
|
2020-05-10 12:27:59 +03:00
|
|
|
rev = "opam-${version}";
|
|
|
|
sha256 = "1kp72yv4k176i94np0m09g10cviqp2pnpm7jmiq6ik7fmmbknk7c";
|
2017-08-03 21:40:07 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ ocaml findlib ocamlbuild ];
|
|
|
|
|
|
|
|
makeFlags = [ "-C" "interpreter" ];
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
2018-08-13 05:49:00 +03:00
|
|
|
postInstall = ''
|
|
|
|
mkdir $out/bin
|
|
|
|
cp -L interpreter/wasm $out/bin
|
|
|
|
'';
|
|
|
|
|
2017-08-03 21:40:07 +03:00
|
|
|
meta = {
|
2018-08-13 05:49:00 +03:00
|
|
|
description = "An executable and OCaml library to run, read and write Web Assembly (wasm) files and manipulate their AST";
|
2021-01-11 15:49:15 +03:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
maintainers = [ lib.maintainers.vbgl ];
|
2020-04-01 04:11:51 +03:00
|
|
|
homepage = "https://github.com/WebAssembly/spec/tree/master/interpreter";
|
2017-08-03 21:40:07 +03:00
|
|
|
inherit (ocaml.meta) platforms;
|
|
|
|
};
|
|
|
|
}
|