From 21e6718fee665c9b5b50e3be629126f526a77431 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 17 Apr 2025 11:07:01 +0200 Subject: [PATCH 1/2] wasmtime: move to by-name --- .../wasmtime/default.nix => by-name/wa/wasmtime/package.nix} | 2 -- pkgs/top-level/all-packages.nix | 4 ---- 2 files changed, 6 deletions(-) rename pkgs/{development/interpreters/wasmtime/default.nix => by-name/wa/wasmtime/package.nix} (96%) diff --git a/pkgs/development/interpreters/wasmtime/default.nix b/pkgs/by-name/wa/wasmtime/package.nix similarity index 96% rename from pkgs/development/interpreters/wasmtime/default.nix rename to pkgs/by-name/wa/wasmtime/package.nix index a8d438430d62..13229df9d819 100644 --- a/pkgs/development/interpreters/wasmtime/default.nix +++ b/pkgs/by-name/wa/wasmtime/package.nix @@ -3,7 +3,6 @@ rustPlatform, cmake, fetchFromGitHub, - Security, stdenv, }: let @@ -37,7 +36,6 @@ rustPlatform.buildRustPackage (finalAttrs: { "dev" ]; - buildInputs = lib.optional stdenv.hostPlatform.isDarwin Security; nativeBuildInputs = [ cmake ]; doCheck = diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 786bf3f50164..b03d00299fbd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19449,10 +19449,6 @@ with pkgs; nanoizeNewlib = true; }; - wasmtime = callPackage ../development/interpreters/wasmtime { - inherit (darwin.apple_sdk.frameworks) Security; - }; - wfuzz = with python3Packages; toPythonApplication wfuzz; kodelife = callPackage ../applications/graphics/kodelife { From 271061c86353be15b6bc5d380f36a3fd5dc602c4 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 17 Apr 2025 11:08:59 +0200 Subject: [PATCH 2/2] wasmtime: cleanup --- pkgs/by-name/wa/wasmtime/package.nix | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/wa/wasmtime/package.nix b/pkgs/by-name/wa/wasmtime/package.nix index 13229df9d819..d8a2e04ab4a1 100644 --- a/pkgs/by-name/wa/wasmtime/package.nix +++ b/pkgs/by-name/wa/wasmtime/package.nix @@ -1,13 +1,12 @@ { lib, - rustPlatform, - cmake, - fetchFromGitHub, stdenv, + rustPlatform, + fetchFromGitHub, + cmake, + versionCheckHook, + nix-update-script, }: -let - inherit (stdenv.targetPlatform.rust) cargoShortTarget; -in rustPlatform.buildRustPackage (finalAttrs: { pname = "wasmtime"; version = "31.0.0"; @@ -50,6 +49,9 @@ rustPlatform.buildRustPackage (finalAttrs: { !isAarch64; postInstall = + let + inherit (stdenv.targetPlatform.rust) cargoShortTarget; + in '' # move libs from out to dev install -d -m 0755 $dev/lib @@ -72,6 +74,16 @@ rustPlatform.buildRustPackage (finalAttrs: { $dev/lib/libwasmtime.dylib ''; + nativeInstallCheckInputs = [ + versionCheckHook + ]; + versionCheckProgramArg = "--version"; + doInstallCheck = true; + + passthru = { + updateScript = nix-update-script { }; + }; + meta = { description = "Standalone JIT-style runtime for WebAssembly, using Cranelift"; homepage = "https://wasmtime.dev/";