Unverified Commit d2ebbeb9 authored by Arne Keller's avatar Arne Keller Committed by GitHub
Browse files

uvwasi: init at 0.0.21 (#406004)

parents 31fcc26e 808d7c9a
Loading
Loading
Loading
Loading
+57 −0
Original line number Diff line number Diff line
{
  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;
  };
})