2019-02-25 13:13:55 +01:00
|
|
|
{ stdenv, cmake, python, fetchFromGitHub, emscriptenRev ? null }:
|
2018-03-20 15:45:19 +01:00
|
|
|
|
|
|
|
let
|
2019-08-04 00:48:34 +02:00
|
|
|
defaultVersion = "88";
|
2018-03-20 15:45:19 +01:00
|
|
|
|
|
|
|
# Map from git revs to SHA256 hashes
|
|
|
|
sha256s = {
|
2019-08-04 00:48:34 +02:00
|
|
|
"version_88" = "14vm2hksn696klk97yz562mm5sqd67qbbzmlw4kvy22ldyc6sgmi";
|
2019-02-25 13:13:55 +01:00
|
|
|
"1.38.28" = "172s7y5f38736ic8ri3mnbdqcrkadd40a26cxcfwbscc53phl11v";
|
2018-03-20 15:45:19 +01:00
|
|
|
};
|
|
|
|
in
|
2017-06-04 05:49:46 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2018-03-20 15:45:19 +01:00
|
|
|
version = if emscriptenRev == null
|
|
|
|
then defaultVersion
|
|
|
|
else "emscripten-${emscriptenRev}";
|
|
|
|
rev = if emscriptenRev == null
|
|
|
|
then "version_${version}"
|
|
|
|
else emscriptenRev;
|
2017-06-04 05:49:46 +02:00
|
|
|
name = "binaryen-${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "WebAssembly";
|
|
|
|
repo = "binaryen";
|
2018-03-20 15:45:19 +01:00
|
|
|
sha256 =
|
|
|
|
if builtins.hasAttr rev sha256s
|
|
|
|
then builtins.getAttr rev sha256s
|
|
|
|
else null;
|
2017-06-04 05:49:46 +02:00
|
|
|
inherit rev;
|
|
|
|
};
|
|
|
|
|
2019-02-25 13:13:55 +01:00
|
|
|
nativeBuildInputs = [ cmake python ];
|
2017-06-04 05:49:46 +02:00
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|