2020-03-14 02:00:27 +01:00
|
|
|
{ stdenv, cmake, python3, fetchFromGitHub, emscriptenRev ? null, substituteAll }:
|
2018-03-20 15:45:19 +01:00
|
|
|
|
|
|
|
let
|
2020-05-02 04:50:12 +02:00
|
|
|
defaultVersion = "93";
|
2018-03-20 15:45:19 +01:00
|
|
|
|
|
|
|
# Map from git revs to SHA256 hashes
|
|
|
|
sha256s = {
|
2020-05-02 04:50:12 +02:00
|
|
|
version_93 = "15y3703ha6mxcq168br0wlydas5rq66msrcsd650zrjz0ndxwsfx";
|
2020-03-14 02:00:27 +01:00
|
|
|
"1.39.1" = "0ygm9m5322h4vfpf3j63q32qxk2l26yk62hh7dkb49j51zwl1y3y";
|
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;
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "binaryen";
|
2017-06-04 05:49:46 +02:00
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2020-03-14 02:00:27 +01:00
|
|
|
patches = stdenv.lib.optional (emscriptenRev != null) (substituteAll {
|
|
|
|
src = ./0001-Get-rid-of-git-dependency.patch;
|
|
|
|
emscriptenv = "1.39.1";
|
|
|
|
});
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake python3 ];
|
2017-06-04 05:49:46 +02:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/WebAssembly/binaryen";
|
2017-06-04 05:49:46 +02:00
|
|
|
description = "Compiler infrastructure and toolchain library for WebAssembly, in C++";
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ asppsa ];
|
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
|
|
|
}
|