add support for freebsd

This commit is contained in:
Igor Klopov 2016-10-01 19:55:13 +00:00
parent 3b20fa0bdf
commit 058f1f26b1
3 changed files with 6 additions and 2 deletions

View File

@ -54,7 +54,8 @@ async function compileOnUnix (nodeVersion, targetArch) {
armv6: 'arm', armv7: 'arm' }[targetArch];
args.push('--dest-cpu', cpu);
await spawn('./configure', args, { cwd: nodePath });
const promise = spawn('make', [], { cwd: nodePath });
const make = process.platform === 'freebsd' ? 'gmake' : 'make';
const promise = spawn(make, [], { cwd: nodePath });
progress(promise, thresholds('make', nodeVersion));
await promise;
return path.join(nodePath, 'out/Release/node');

View File

@ -25,7 +25,7 @@ function getHostPlatform () {
}
function getKnownPlatforms () {
return [ 'linux', 'macos', 'win' ];
return [ 'freebsd', 'linux', 'macos', 'win' ];
}
export function toFancyArch (arch) {

View File

@ -18,6 +18,9 @@ function dontBuild (nodeVersion, targetArch) {
// official node 0.12 does not compile on arm
if (/^v?0/.test(nodeVersion) &&
/^arm/.test(targetArch)) return true;
// some obstacles on freebsd
if (/^v?0/.test(nodeVersion) &&
hostPlatform === 'freebsd') return true;
return false;
}