diff --git a/pkgs/development/interpreters/wasm-gc/default.nix b/pkgs/development/interpreters/wasm-gc/default.nix new file mode 100644 index 00000000000..cf0fad18d1c --- /dev/null +++ b/pkgs/development/interpreters/wasm-gc/default.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchFromGitHub, rustPlatform }: + +rustPlatform.buildRustPackage rec { + name = "wasm-gc-${version}"; + version = "0.1.6"; + + src = fetchFromGitHub { + owner = "alexcrichton"; + repo = "wasm-gc"; + rev = version; + sha256 = "1lc30xxqp3vv1r269xzznh2lf2dzdq89bi5f1vmqjw4yc3xmawm7"; + }; + + cargoPatches = [ ./fix-build.patch ]; # Cargo.lock is not up-to-date + + cargoSha256 = "1jvk9n324p3x3j6q6x0p5diig3b5c683k74cfflff25i7gsmmvc7"; + + meta = with stdenv.lib; { + description = "gc-sections for wasm"; + homepage = "https://github.com/alexcrichton/wasm-gc"; + maintainers = with maintainers; [ ekleog ]; + platforms = platforms.all; + license = with licenses; [ mit asl20 ]; + }; +} diff --git a/pkgs/development/interpreters/wasm-gc/fix-build.patch b/pkgs/development/interpreters/wasm-gc/fix-build.patch new file mode 100644 index 00000000000..3144dd89837 --- /dev/null +++ b/pkgs/development/interpreters/wasm-gc/fix-build.patch @@ -0,0 +1,34 @@ +diff --git a/Cargo.lock b/Cargo.lock +index 923ed91..71f17c8 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -212,16 +212,16 @@ dependencies = [ + + [[package]] + name = "wasm-gc" +-version = "0.1.1" ++version = "0.1.6" + dependencies = [ + "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", + "getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", +- "wasm-gc-api 0.1.5", ++ "wasm-gc-api 0.1.6", + ] + + [[package]] + name = "wasm-gc-api" +-version = "0.1.5" ++version = "0.1.6" + dependencies = [ + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-wasm 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -234,7 +234,7 @@ version = "0.1.0" + dependencies = [ + "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", +- "wasm-gc-api 0.1.5", ++ "wasm-gc-api 0.1.6", + ] + + [[package]] + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ae19c6d650d..3ecd69cc0aa 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7809,6 +7809,8 @@ with pkgs; wasm = callPackage ../development/interpreters/wasm { }; + wasm-gc = callPackage ../development/interpreters/wasm-gc { }; + ### DEVELOPMENT / MISC