1{ lib
2, stdenv
3, fetchFromGitHub
4, rustPlatform
5}:
6
7rustPlatform.buildRustPackage rec {
8 pname = "wasynth";
9 version = "0.12.0";
10
11 src = fetchFromGitHub {
12 owner = "Rerumu";
13 repo = "Wasynth";
14 rev = "v${version}";
15 sha256 = "sha256-hbY+epUtYSQrvnAbCELsVcqd3UoXGn24FkzWfrM0K14=";
16 };
17
18 # A lock file isn't provided, so it must be added manually.
19 cargoLock.lockFile = ./Cargo.lock;
20 postPatch = ''
21 cp ${./Cargo.lock} Cargo.lock
22 '';
23
24 # Not all of the tests pass.
25 doCheck = false;
26
27 # These binaries are tests and should be removed.
28 postInstall = ''
29 rm $out/bin/{luajit,luau}_translate
30 '';
31
32 meta = with lib; {
33 description = "WebAssembly translation tools for various languages";
34 longDescription = ''
35 Wasynth provides the following WebAssembly translation tools:
36 * wasm2luajit: translate WebAssembly to LuaJIT source code
37 * wasm2luau: translate WebAssembly Luau source code
38 '';
39 homepage = "https://github.com/Rerumu/Wasynth";
40 license = with licenses; [ gpl3Only ];
41 maintainers = with maintainers; [ wackbyte ];
42 };
43}