From c1398063d3ed22ebe3aebd7f653d5980846709a8 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sun, 11 May 2025 00:58:45 +0200 Subject: [PATCH] uvwasi: init at 0.0.21 (cherry picked from commit 808d7c9a2f1e6dc0d6f7d9cb9cacf65e4763e748) --- pkgs/by-name/uv/uvwasi/package.nix | 57 ++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 pkgs/by-name/uv/uvwasi/package.nix diff --git a/pkgs/by-name/uv/uvwasi/package.nix b/pkgs/by-name/uv/uvwasi/package.nix new file mode 100644 index 000000000000..a01f7f21c4cc --- /dev/null +++ b/pkgs/by-name/uv/uvwasi/package.nix @@ -0,0 +1,57 @@ +{ + lib, + cmake, + fetchFromGitHub, + fetchpatch2, + libuv, + nix-update-script, + stdenv, + testers, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "uvwasi"; + version = "0.0.21"; + + src = fetchFromGitHub { + owner = "nodejs"; + repo = "uvwasi"; + tag = "v${finalAttrs.version}"; + hash = "sha256-po2Pwqf97JXGKY8WysvyR1vSkqQ4XIF0VQG+83yV9nM="; + }; + + # Patch was sent upstream: https://github.com/nodejs/uvwasi/pull/302. + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail 'DESTINATION ''${CMAKE_INSTALL_INCLUDEDIR}/uvwasi' 'DESTINATION ''${CMAKE_INSTALL_INCLUDEDIR}' + ''; + + outputs = [ + "out" + ]; + + nativeBuildInputs = [ + cmake + ]; + buildInputs = [ + libuv + ]; + + passthru = { + updateScript = nix-update-script { }; + + tests.pkg-config = testers.hasPkgConfigModules { + package = finalAttrs.finalPackage; + moduleNames = [ "uvwasi" ]; + }; + }; + + meta = { + description = "WASI syscall API built atop libuv"; + homepage = "https://github.com/nodejs/uvwasi"; + changelog = "https://github.com/nodejs/uvwasi/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ aduh95 ]; + platforms = lib.platforms.all; + }; +})