depot/third_party/nixpkgs/pkgs/development/ocaml-modules/wasm/default.nix
Default email 66604c92c1 Project import generated by Copybara.
GitOrigin-RevId: 32b8ed738096bafb4cdb7f70347a0f63f9f40151
2020-05-15 23:57:56 +02:00

36 lines
1,001 B
Nix

{ stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild }:
if !stdenv.lib.versionAtLeast ocaml.version "4.02"
then throw "wasm is not available for OCaml ${ocaml.version}"
else
stdenv.mkDerivation rec {
name = "ocaml${ocaml.version}-wasm-${version}";
version = "1.1.1";
src = fetchFromGitHub {
owner = "WebAssembly";
repo = "spec";
rev = "opam-${version}";
sha256 = "1kp72yv4k176i94np0m09g10cviqp2pnpm7jmiq6ik7fmmbknk7c";
};
buildInputs = [ ocaml findlib ocamlbuild ];
makeFlags = [ "-C" "interpreter" ];
createFindlibDestdir = true;
postInstall = ''
mkdir $out/bin
cp -L interpreter/wasm $out/bin
'';
meta = {
description = "An executable and OCaml library to run, read and write Web Assembly (wasm) files and manipulate their AST";
license = stdenv.lib.licenses.asl20;
maintainers = [ stdenv.lib.maintainers.vbgl ];
homepage = "https://github.com/WebAssembly/spec/tree/master/interpreter";
inherit (ocaml.meta) platforms;
};
}