From e125145c49aa9b057999d3184f7cbadc5cea6185 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Mon, 11 Feb 2019 16:23:39 +0700 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D1=81=D0=BA=D0=B0=D1=87=D0=B8=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=BC=D0=BE=D0=B4=D1=83=D0=BB=D1=8F=20node=5Fsqlite3.node=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/linux.js | 22 ++++++++++++++++++++++ build/win.js | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/build/linux.js b/build/linux.js index aa121874..8e0e3b1d 100644 --- a/build/linux.js +++ b/build/linux.js @@ -22,6 +22,28 @@ async function main() { await fs.ensureDir(tempDownloadDir); + //sqlite3 + const sqliteRemoteUrl = 'https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.0.4/node-v64-linux-x64.tar.gz'; + const sqliteDecompressedFilename = `${tempDownloadDir}/node-v64-linux-x64/node_sqlite3.node`; + + if (!await fs.pathExists(sqliteDecompressedFilename)) { + // Скачиваем node_sqlite3.node для винды, т.к. pkg не включает его в сборку + await pipeline(got.stream(sqliteRemoteUrl), fs.createWriteStream(`${tempDownloadDir}/sqlite.tar.gz`)); + console.log(`done downloading ${sqliteRemoteUrl}`); + + //распаковываем + await decompress(`${tempDownloadDir}/sqlite.tar.gz`, `${tempDownloadDir}`, { + plugins: [ + decompressTargz() + ] + }); + console.log('files decompressed'); + } + // копируем в дистрибутив + await fs.copy(sqliteDecompressedFilename, `${outDir}/node_sqlite3.node`); + console.log(`copied ${sqliteDecompressedFilename} to ${outDir}/node_sqlite3.node`); + + //ipfs const ipfsDecompressedFilename = `${tempDownloadDir}/go-ipfs/ipfs`; if (!await fs.pathExists(ipfsDecompressedFilename)) { // Скачиваем ipfs diff --git a/build/win.js b/build/win.js index 4808d115..d47dfc8c 100644 --- a/build/win.js +++ b/build/win.js @@ -22,7 +22,7 @@ async function main() { await fs.ensureDir(tempDownloadDir); - + //sqlite3 const sqliteRemoteUrl = 'https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.0.4/node-v64-win32-x64.tar.gz'; const sqliteDecompressedFilename = `${tempDownloadDir}/node-v64-win32-x64/node_sqlite3.node`; @@ -43,6 +43,7 @@ async function main() { await fs.copy(sqliteDecompressedFilename, `${outDir}/node_sqlite3.node`); console.log(`copied ${sqliteDecompressedFilename} to ${outDir}/node_sqlite3.node`); + //ipfs const ipfsDecompressedFilename = `${tempDownloadDir}/go-ipfs/ipfs.exe`; if (!await fs.pathExists(ipfsDecompressedFilename)) { // Скачиваем ipfs