2018-03-20 14:45:19 +00:00
|
|
|
{ stdenv, cmake, fetchFromGitHub, emscriptenRev ? null }:
|
|
|
|
|
|
|
|
let
|
2018-04-01 02:35:15 +01:00
|
|
|
defaultVersion = "45";
|
2018-03-20 14:45:19 +00:00
|
|
|
|
|
|
|
# Map from git revs to SHA256 hashes
|
|
|
|
sha256s = {
|
2018-04-01 02:35:15 +01:00
|
|
|
"version_45" = "1wgzfzjjzkiaz0rf2lnwrcvlcsjvjhyvbyh58jxhqq43vi34zyjc";
|
2018-03-20 14:45:19 +00:00
|
|
|
"1.37.36" = "1wgzfzjjzkiaz0rf2lnwrcvlcsjvjhyvbyh58jxhqq43vi34zyjc";
|
|
|
|
};
|
|
|
|
in
|
2017-06-04 04:49:46 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2018-03-20 14:45:19 +00:00
|
|
|
version = if emscriptenRev == null
|
|
|
|
then defaultVersion
|
|
|
|
else "emscripten-${emscriptenRev}";
|
|
|
|
rev = if emscriptenRev == null
|
|
|
|
then "version_${version}"
|
|
|
|
else emscriptenRev;
|
2017-06-04 04:49:46 +01:00
|
|
|
name = "binaryen-${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "WebAssembly";
|
|
|
|
repo = "binaryen";
|
2018-03-20 14:45:19 +00:00
|
|
|
sha256 =
|
|
|
|
if builtins.hasAttr rev sha256s
|
|
|
|
then builtins.getAttr rev sha256s
|
|
|
|
else null;
|
2017-06-04 04:49:46 +01:00
|
|
|
inherit rev;
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://github.com/WebAssembly/binaryen;
|
|
|
|
description = "Compiler infrastructure and toolchain library for WebAssembly, in C++";
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ asppsa ];
|
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
|
|
|
}
|