Docker powered linux building

This commit is contained in:
David Baker
2020-02-17 20:10:58 +00:00
parent 0bfc970619
commit 52032aac14
10 changed files with 86 additions and 53 deletions

View File

@@ -24,7 +24,7 @@ module.exports = async function(hakEnv, moduleInfo) {
if (hakEnv.isWin()) {
await buildOpenSslWin(hakEnv, moduleInfo);
await buildSqlCipherWin(hakEnv, moduleInfo);
} else {
} else if (hakEnv.isMac()) {
await buildSqlCipherUnix(hakEnv, moduleInfo);
}
await buildMatrixSeshat(hakEnv, moduleInfo);
@@ -228,11 +228,15 @@ async function buildSqlCipherUnix(hakEnv, moduleInfo) {
}
async function buildMatrixSeshat(hakEnv, moduleInfo) {
const env = Object.assign({
SQLCIPHER_STATIC: 1,
SQLCIPHER_LIB_DIR: path.join(moduleInfo.depPrefix, 'lib'),
SQLCIPHER_INCLUDE_DIR: path.join(moduleInfo.depPrefix, 'include'),
}, hakEnv.makeGypEnv());
const env = hakEnv.makeGypEnv();
if (!hakEnv.isLinux()) {
Object.assign(env, {
SQLCIPHER_STATIC: 1,
SQLCIPHER_LIB_DIR: path.join(moduleInfo.depPrefix, 'lib'),
SQLCIPHER_INCLUDE_DIR: path.join(moduleInfo.depPrefix, 'include'),
});
}
if (hakEnv.isWin()) {
env.RUSTFLAGS = '-Ctarget-feature=+crt-static -Clink-args=libcrypto.lib';

View File

@@ -18,19 +18,21 @@ const childProcess = require('child_process');
module.exports = async function(hakEnv, moduleInfo) {
// of course tcl doesn't have a --version
await new Promise((resolve, reject) => {
const proc = childProcess.spawn('tclsh', [], {
stdio: ['pipe', 'ignore', 'ignore'],
if (!hakEnv.isLinux()) {
await new Promise((resolve, reject) => {
const proc = childProcess.spawn('tclsh', [], {
stdio: ['pipe', 'ignore', 'ignore'],
});
proc.on('exit', (code) => {
if (code !== 0) {
reject("Can't find tclsh - have you installed TCL?");
} else {
resolve();
}
});
proc.stdin.end();
});
proc.on('exit', (code) => {
if (code !== 0) {
reject("Can't find tclsh - have you installed TCL?");
} else {
resolve();
}
});
proc.stdin.end();
});
}
const tools = [];
if (hakEnv.isWin()) {

View File

@@ -23,7 +23,9 @@ const needle = require('needle');
const tar = require('tar');
module.exports = async function(hakEnv, moduleInfo) {
await getSqlCipher(hakEnv, moduleInfo);
if (!hakEnv.isLinux()) {
await getSqlCipher(hakEnv, moduleInfo);
}
if (hakEnv.isWin()) {
getOpenSsl(hakEnv, moduleInfo);