nixpkgs/pkgs/development/ocaml-modules/wasm/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

41 lines
1.1 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild }:
2022-06-02 07:33:44 +00:00
if lib.versionOlder ocaml.version "4.08"
then throw "wasm is not available for OCaml ${ocaml.version}"
else
stdenv.mkDerivation rec {
2022-02-06 22:35:27 +00:00
pname = "ocaml${ocaml.version}-wasm";
2022-06-02 07:33:44 +00:00
version = "2.0.0";
src = fetchFromGitHub {
owner = "WebAssembly";
repo = "spec";
rev = "opam-${version}";
2022-06-02 07:33:44 +00:00
sha256 = "sha256:09s0v79x0ymzcp2114zkm3phxavdfnkkq67qz1ndnknbkziwqf3v";
};
2021-08-14 12:00:00 +00:00
nativeBuildInputs = [ ocaml findlib ocamlbuild ];
strictDeps = true;
# x86_64-unknown-linux-musl-ld: -r and -pie may not be used together
hardeningDisable = lib.optional stdenv.hostPlatform.isStatic "pie";
makeFlags = [ "-C" "interpreter" ];
createFindlibDestdir = true;
2018-08-13 02:49:00 +00:00
postInstall = ''
mkdir $out/bin
cp -L interpreter/wasm $out/bin
'';
meta = {
2018-08-13 02:49:00 +00:00
description = "An executable and OCaml library to run, read and write Web Assembly (wasm) files and manipulate their AST";
license = lib.licenses.asl20;
maintainers = [ lib.maintainers.vbgl ];
homepage = "https://github.com/WebAssembly/spec/tree/master/interpreter";
inherit (ocaml.meta) platforms;
};
}