uvwasi: add support for static-only builds (#538196)
This commit is contained in:
@@ -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"
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user