2020-05-07 19:03:48 +02:00
|
|
|
{ stdenv, fetchpatch, fetchFromGitHub, cmake, python3, substituteAll }:
|
2018-08-20 04:53:41 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "wabt";
|
2020-05-20 22:06:03 +02:00
|
|
|
version = "1.0.16";
|
2018-08-20 04:53:41 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-01-17 23:15:16 +01:00
|
|
|
owner = "WebAssembly";
|
|
|
|
repo = "wabt";
|
|
|
|
rev = version;
|
2020-05-20 22:06:03 +02:00
|
|
|
sha256 = "1zzc46d6m7l5lil423417crdda2cqb396p2idcla2ps161hwq3qp";
|
2020-01-17 23:15:16 +01:00
|
|
|
fetchSubmodules = true;
|
2018-08-20 04:53:41 +02:00
|
|
|
};
|
|
|
|
|
2020-05-07 19:03:48 +02:00
|
|
|
# https://github.com/WebAssembly/wabt/pull/1408
|
|
|
|
patches = [ (fetchpatch {
|
2020-05-16 18:56:31 +02:00
|
|
|
url = "https://github.com/WebAssembly/wabt/pull/1408/commits/28505f4db6e4561cf6840af5c304a9aa900c4987.patch";
|
|
|
|
sha256 = "1nh1ddsak6w51np17xf2r7i0czxrjslz1i4impmmp88h5bp2yjba";
|
2020-05-07 19:03:48 +02:00
|
|
|
}) ];
|
|
|
|
|
2018-08-20 04:53:41 +02:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2020-05-05 22:38:19 +02:00
|
|
|
cmakeFlags = [ "-DBUILD_TESTS=OFF" "-DCMAKE_PROJECT_VERSION=${version}" ];
|
2018-08-20 04:53:41 +02:00
|
|
|
buildInputs = [ python3 ];
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "The WebAssembly Binary Toolkit";
|
|
|
|
longDescription = ''
|
2018-10-14 17:42:29 +02:00
|
|
|
WABT (pronounced "wabbit") is a suite of tools for WebAssembly, including:
|
2018-08-20 04:53:41 +02:00
|
|
|
* wat2wasm: translate from WebAssembly text format to the WebAssembly
|
|
|
|
binary format
|
|
|
|
* wasm2wat: the inverse of wat2wasm, translate from the binary format
|
|
|
|
back to the text format (also known as a .wat)
|
|
|
|
* wasm-objdump: print information about a wasm binary. Similiar to
|
|
|
|
objdump.
|
|
|
|
* wasm-interp: decode and run a WebAssembly binary file using a
|
|
|
|
stack-based interpreter
|
|
|
|
* wat-desugar: parse .wat text form as supported by the spec interpreter
|
|
|
|
(s-expressions, flat syntax, or mixed) and print "canonical" flat
|
|
|
|
format
|
|
|
|
* wasm2c: convert a WebAssembly binary file to a C source and header
|
|
|
|
'';
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/WebAssembly/wabt";
|
2018-08-20 04:53:41 +02:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ ekleog ];
|
2018-10-23 00:31:06 +02:00
|
|
|
platforms = platforms.unix;
|
2018-08-20 04:53:41 +02:00
|
|
|
};
|
|
|
|
}
|