mirror of
https://github.com/chatmail/core.git
synced 2026-04-18 05:56:31 +03:00
blindly copying deltachat-node to core repository
This commit is contained in:
27
node/scripts/install.js
Normal file
27
node/scripts/install.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const {execSync} = require('child_process')
|
||||
const {existsSync} = require('fs')
|
||||
const {join} = require('path')
|
||||
|
||||
const run = (cmd) => {
|
||||
console.log('[i] running `' + cmd + '`')
|
||||
execSync(cmd, {stdio: 'inherit'})
|
||||
}
|
||||
|
||||
if (!existsSync(join(__dirname, '..', 'deltachat-core-rust'))) {
|
||||
console.log('[i] deltachat-node/deltachat-core-rust doesn\'t exist, fetching submodule. If this fails, make sure git is installed')
|
||||
run('npm run submodule')
|
||||
}
|
||||
|
||||
// Build bindings
|
||||
if (process.env.USE_SYSTEM_LIBDELTACHAT === 'true') {
|
||||
console.log('[i] USE_SYSTEM_LIBDELTACHAT is true, rebuilding c bindings and using pkg-config to retrieve lib paths and cflags of libdeltachat')
|
||||
run('npm run build:bindings:c:c')
|
||||
} else {
|
||||
console.log('[i] Building rust core & c bindings, if possible use prebuilds')
|
||||
run('npm run install:prebuilds')
|
||||
}
|
||||
|
||||
if (!existsSync(join(__dirname, '..', 'dist'))) {
|
||||
console.log('[i] Didn\'t find already built typescript bindings. Trying to transpile them. If this fail, make sure typescript is installed ;)')
|
||||
run('npm run build:bindings:ts')
|
||||
}
|
||||
Reference in New Issue
Block a user