diff --git a/prebuilds/win32-x64/node.abi108.node b/prebuilds/win32-x64/node.abi108.node new file mode 100644 index 00000000..f82e0e34 Binary files /dev/null and b/prebuilds/win32-x64/node.abi108.node differ diff --git a/scripts/build.js b/scripts/build.js index bdd03597..0e5ab34d 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -16,7 +16,7 @@ shell.cd(`${env.sourceFolder}`); if (env.isWindows) { const output = env.isVerbose ? '' : ' > NUL'; - exec(`cmake -DWANT_SYNCAPI=OFF -DCMAKE_GENERATOR_PLATFORM=${process.arch} .${output}`); + exec(`cmake -DWANT_SYNCAPI=OFF -DCMAKE_GENERATOR_PLATFORM=${process.arch} .${output} -DWITH_OPENSSL=OFF -DWITH_CYRUS_SASL=OFF`); exec(`cmake --build .${output}`); } else { const flags = '-w'; diff --git a/scripts/prepublish.js b/scripts/prepublish.js index 2a3272d7..6abded02 100644 --- a/scripts/prepublish.js +++ b/scripts/prepublish.js @@ -11,6 +11,15 @@ function clearPath() { shell.rm('-rf', env.sourceFolder); } +function applyPatches() { + if (env.isWindows) { + const destination = `${env.sourceFolder}/src`; + shell.sed('-i', '#include "zookeeper_log.h"', '#include "zookeeper_log.h"\n#include "winport.h"\n', `${destination}/zk_log.c`); + shell.sed('-i', '#include "zookeeper.h"', '#include "winport.h"\n#include "zookeeper.h"\n', `${destination}/zk_adaptor.h`); + shell.sed('-i', '#include "zk_adaptor.h"', '#include "zk_adaptor.h"\n#include "winport.h"\n', `${destination}/zookeeper.c`); + } +} + if (env.isAlreadyBuilt) { shell.echo('Zookeeper has already been built'); shell.exit(0); @@ -31,6 +40,7 @@ decompress(env.downloadedFileName, './', { ], }).then(() => { shell.echo('Decompressed file'); + applyPatches(); }).catch((e) => { shell.echo(`Error: ${e.message}`); shell.exit(1);