|
|
|
@ -1,4 +1,6 @@ |
|
|
|
|
{ lib, stdenv, cmake, python3, fetchFromGitHub, emscripten }: |
|
|
|
|
{ lib, stdenv, cmake, python3, fetchFromGitHub, emscripten, |
|
|
|
|
gtest, lit, nodejs, filecheck |
|
|
|
|
}: |
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec { |
|
|
|
|
pname = "binaryen"; |
|
|
|
@ -8,12 +10,35 @@ stdenv.mkDerivation rec { |
|
|
|
|
owner = "WebAssembly"; |
|
|
|
|
repo = "binaryen"; |
|
|
|
|
rev = "version_${version}"; |
|
|
|
|
sha256 = "sha256-CcGxPBdUiNLfMjjJKFMdDvaIrHvf2M/gCub4JBw4+8c="; |
|
|
|
|
fetchSubmodules = true; |
|
|
|
|
sha256 = "sha256-KGrzAME2Gt4WFIcBJ4L6k4DtE+OtuH4KFbEMPe+f+pA="; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake python3 ]; |
|
|
|
|
|
|
|
|
|
preConfigure = '' |
|
|
|
|
if [ $doCheck -eq 1 ]; then |
|
|
|
|
sed -i '/googletest/d' third_party/CMakeLists.txt |
|
|
|
|
else |
|
|
|
|
cmakeFlagsArray=($cmakeFlagsArray -DBUILD_TESTS=0) |
|
|
|
|
fi |
|
|
|
|
''; |
|
|
|
|
|
|
|
|
|
checkInputs = [ gtest lit nodejs filecheck ]; |
|
|
|
|
checkPhase = '' |
|
|
|
|
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib python3 ../check.py $tests |
|
|
|
|
''; |
|
|
|
|
|
|
|
|
|
tests = [ |
|
|
|
|
"version" "wasm-opt" "wasm-dis" |
|
|
|
|
"crash" "dylink" "ctor-eval" |
|
|
|
|
"wasm-metadce" "wasm-reduce" "spec" |
|
|
|
|
"lld" "wasm2js" "validator" |
|
|
|
|
"example" "unit" |
|
|
|
|
# "binaryenjs" "binaryenjs_wasm" # not building this |
|
|
|
|
"lit" "gtest" |
|
|
|
|
]; |
|
|
|
|
doCheck = stdenv.isLinux; |
|
|
|
|
|
|
|
|
|
meta = with lib; { |
|
|
|
|
homepage = "https://github.com/WebAssembly/binaryen"; |
|
|
|
|
description = "Compiler infrastructure and toolchain library for WebAssembly, in C++"; |
|
|
|
|