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

41 lines
1.1 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild }:
if !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";
};
2021-08-14 13:00:00 +01: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 03:49:00 +01:00
postInstall = ''
mkdir $out/bin
cp -L interpreter/wasm $out/bin
'';
meta = {
2018-08-13 03:49:00 +01: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;
};
}