diff --git a/pkgs/by-name/uv/uvwasi/package.nix b/pkgs/by-name/uv/uvwasi/package.nix index 8d48132e945e..5194fdc7ab07 100644 --- a/pkgs/by-name/uv/uvwasi/package.nix +++ b/pkgs/by-name/uv/uvwasi/package.nix @@ -8,6 +8,7 @@ stdenv, testers, validatePkgConfig, + static ? stdenv.hostPlatform.isStatic, # generates static libraries *only* }: stdenv.mkDerivation (finalAttrs: { @@ -21,6 +22,20 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-+vz/qTMRRDHV1VE4nny9vYYtarZHk1xoM4EZiah3jnY="; }; + patches = [ + # FIXME: remove when included in a release + (fetchpatch2 { + url = "https://github.com/nodejs/uvwasi/commit/0820128569533c855d60c0f6382acbb14aa62ad2.patch?full_index=1"; + hash = "sha256-psjivoarqisOuCdVJAWuFH0aITzwb/obmal3ewVXvG4="; + }) + ]; + postPatch = lib.optionalString static '' + substituteInPlace CMakeLists.txt --replace-fail 'TARGETS uvwasi_a uvwasi' 'TARGETS uvwasi_a' + ''; + cmakeFlags = [ + (lib.cmakeBool "UVWASI_BUILD_SHARED" (!static)) + ]; + outputs = [ "out" ];