From a8c48bb68b955e3552b8d7515f20f08e224c1509 Mon Sep 17 00:00:00 2001 From: Alastair Pharo Date: Sun, 4 Jun 2017 13:49:46 +1000 Subject: [PATCH 1/2] binaryen: add package --- .../compilers/binaryen/default.nix | 24 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/development/compilers/binaryen/default.nix diff --git a/pkgs/development/compilers/binaryen/default.nix b/pkgs/development/compilers/binaryen/default.nix new file mode 100644 index 000000000000..31f5845cc86c --- /dev/null +++ b/pkgs/development/compilers/binaryen/default.nix @@ -0,0 +1,24 @@ +{ stdenv, cmake, fetchFromGitHub }: + +stdenv.mkDerivation rec { + version = "32"; + rev = "version_${version}"; + name = "binaryen-${version}"; + + src = fetchFromGitHub { + owner = "WebAssembly"; + repo = "binaryen"; + sha256 = "0zclw6pa2pkzrnp8ib9qwbjvq38r2h5ynfg8fjl99b5lcyz5m590"; + 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; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8bca3cee8905..bd71c17b352d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5014,6 +5014,8 @@ with pkgs; stdenv = overrideCC stdenv gcc49; }; + binaryen = callPackage ../development/compilers/binaryen { }; + boo = callPackage ../development/compilers/boo { inherit (gnome2) gtksourceview; }; From 8f33800061eff8a8b1ef7a89f66893247a93ab8b Mon Sep 17 00:00:00 2001 From: Alastair Pharo Date: Sun, 4 Jun 2017 13:50:51 +1000 Subject: [PATCH 2/2] emscripten: add binaryen dep for compiling to WASM --- pkgs/development/compilers/emscripten/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/emscripten/default.nix b/pkgs/development/compilers/emscripten/default.nix index ad1cd437ffab..f118a11e4193 100644 --- a/pkgs/development/compilers/emscripten/default.nix +++ b/pkgs/development/compilers/emscripten/default.nix @@ -1,4 +1,6 @@ -{ stdenv, fetchFromGitHub, emscriptenfastcomp, python, nodejs, closurecompiler, jre }: +{ stdenv, fetchFromGitHub, emscriptenfastcomp, python, nodejs, closurecompiler +, jre, binaryen, enableWasm ? true +}: let rev = "1.37.10"; @@ -36,6 +38,9 @@ stdenv.mkDerivation { echo "COMPILER_ENGINE = NODE_JS" >> $out/${appdir}/config echo "CLOSURE_COMPILER = '${closurecompiler}/share/java/closure-compiler-v${closurecompiler.version}.jar'" >> $out/${appdir}/config echo "JAVA = '${jre}/bin/java'" >> $out/${appdir}/config + '' + + stdenv.lib.optionalString enableWasm '' + echo "BINARYEN_ROOT = '${binaryen}'" >> $out/share/emscripten/config ''; meta = with stdenv.lib; {