about summary refs log tree commit diff
path: root/pkgs/development/interpreters
diff options
context:
space:
mode:
authorProglodyte <proglodyte23@gmail.com>2016-07-24 02:01:08 -0400
committerProglodyte <proglodyte23@gmail.com>2016-07-27 01:55:30 -0400
commitcddcda6e96db09c07a4d5b93071b39580e3e4751 (patch)
tree07a8f45ec2ff9b73b5a97f159d3bc38f737fadf2 /pkgs/development/interpreters
parent52d52e7f0c12e529af1b69376058f9e128384564 (diff)
downloadnixlib-cddcda6e96db09c07a4d5b93071b39580e3e4751.tar
nixlib-cddcda6e96db09c07a4d5b93071b39580e3e4751.tar.gz
nixlib-cddcda6e96db09c07a4d5b93071b39580e3e4751.tar.bz2
nixlib-cddcda6e96db09c07a4d5b93071b39580e3e4751.tar.lz
nixlib-cddcda6e96db09c07a4d5b93071b39580e3e4751.tar.xz
nixlib-cddcda6e96db09c07a4d5b93071b39580e3e4751.tar.zst
nixlib-cddcda6e96db09c07a4d5b93071b39580e3e4751.zip
wasm: init at 0.0.1
Run WebAssembly from the command line with v8 backend
Diffstat (limited to 'pkgs/development/interpreters')
-rw-r--r--pkgs/development/interpreters/wasm/default.nix56
1 files changed, 56 insertions, 0 deletions
diff --git a/pkgs/development/interpreters/wasm/default.nix b/pkgs/development/interpreters/wasm/default.nix
new file mode 100644
index 000000000000..56eebbf89a2e
--- /dev/null
+++ b/pkgs/development/interpreters/wasm/default.nix
@@ -0,0 +1,56 @@
+{ stdenv, fetchFromGitHub, cmake, clang, python, v8_static, coreutils }:
+
+let
+  sexpr_wasm_prototype = stdenv.mkDerivation {
+    name = "sexpr_wasm_prototype";
+    src = fetchFromGitHub {
+      owner = "WebAssembly";
+      repo = "sexpr-wasm-prototype";
+      rev = "1347a367c34876bfe92562f244a8c8b770372479";
+      sha256 = "1v1mph5fp1rffhvh8bbx937gpjqjrdgm7yhffdxzdn4pih9d0grn";
+    };
+
+    configurePhase = ''
+      # set this to nonempty string to disable default cmake configure
+    '';
+
+    buildInputs = [ cmake clang python ];
+
+    buildPhase = "make clang-debug-no-tests";
+    installPhase = ''
+      mkdir -p $out/bin
+      cp out/clang/Debug/no-tests/sexpr-wasm $out/bin
+    '';
+  };
+
+in
+
+stdenv.mkDerivation {
+  name = "wasm-0.0.1";
+
+  src = fetchFromGitHub {
+    owner = "proglodyte";
+    repo = "wasm";
+    rev = "650188eecaaf4b64f12b341986b4e89e5fdb3bbe";
+    sha256 = "1f5mdl0l2448lx7h36b4bdr541a4q1wapn1kdwrd4z7s94n7a5gq";
+  };
+
+  configurePhase = ''
+    sed -i -e "s|sudo ||g" Makefile
+  '';
+
+  installPhase = ''
+    export DESTDIR=$out
+    export MKTEMPDIR=${coreutils}/bin
+    export D8DIR=${v8_static}/bin
+    export SWDIR=${sexpr_wasm_prototype}/bin
+    make install
+  '';
+
+  meta = with stdenv.lib; {
+    description = "wasm runs WebAssembly from the command line";
+    maintainers = with maintainers; [ proglodyte ];
+    platforms = platforms.linux;
+    license = licenses.asl20;
+  };
+}