Commit ed966d033bbfee4d7929d01b8f6de313cfb18a7a
pkg build: enable cross-compiling
cel committed on 12/31/2019, 12:59:20 AMParent: 11e92841319cb69efcd6a01851a197cffa0a5d63
Files changed
build.js | changed |
build.js | ||
---|---|---|
@@ -4,14 +4,16 @@ | ||
4 | 4 … | var fs = require('fs') |
5 | 5 … | var mkdirp = require('mkdirp') |
6 | 6 … | var pkgJson = require('./package') |
7 | 7 … | |
8 | -var arch = os.arch() | |
9 | -var platform = os.platform() | |
10 | -var abi = process.versions.modules | |
11 | -var armv = process.env.ARM_VERSION || process.config.variables.arm_version || '' | |
8 … | +var platform = process.argv[2] || os.platform() | |
9 … | +var arch = process.argv[3] || os.arch() | |
10 … | +var abi = process.argv[4] || process.versions.modules | |
11 … | +var nodeVersion = process.argv[5] || pkgJson.nodeVersion | |
12 … | +var armv = process.argv[6] || (arch === 'arm' && process.config.variables.arm_version) || '' | |
12 | 13 … | if (armv) armv = 'v' + armv |
13 | - | |
14 … | +console.log('platform:', platform, 'arch:', arch, 'abi:', abi, 'armv:', armv, | |
15 … | + 'node:', nodeVersion) | |
14 | 16 … | process.chdir(__dirname) |
15 | 17 … | mkdirp.sync('dist') |
16 | 18 … | |
17 | 19 … | function cp(src, dest) { |
@@ -31,9 +33,9 @@ | ||
31 | 33 … | var pkg = proc.spawnSync('pkg', [ |
32 | 34 … | 'bin/git-ssb', |
33 | 35 … | '-c', 'package.json', |
34 | 36 … | '--public', |
35 | - '-t', 'node' + pkgJson.nodeVersion + '-' + platform + '-' + arch + armv, | |
37 … | + '-t', 'node' + nodeVersion + '-' + platform + '-' + arch + armv, | |
36 | 38 … | '-o', 'dist/git-ssb' |
37 | 39 … | ], {stdio: 'inherit'}) |
38 | 40 … | if (pkg.status) process.exit(1) |
39 | 41 … |
Built with git-ssb-web