Browse Source

build: packaging support for multiple arch

Add a script that fetches specific lnd binaries for each supported
platform/arch into the resources directory and update package scripts
to build for multiple architectures.
renovate/lint-staged-8.x
Tom Kirkpatrick 7 years ago
parent
commit
a846db8a49
No known key found for this signature in database GPG Key ID: 72203A8EC5967EA8
  1. 16
      internals/scripts/fetch-lnd-for-packaging.js
  2. 17
      package.json

16
internals/scripts/fetch-lnd-for-packaging.js

@ -0,0 +1,16 @@
const lndBinary = require('lnd-binary')
function install(platform, arch, dest) {
process.env.LND_BINARY_PLATFORM = platform
process.env.LND_BINARY_ARCH = arch
process.env.LND_BINARY_DIR = dest
return lndBinary.install()
}
return install('darwin', 'amd64', 'resources/bin/mac/x64')
.then(() => install('darwin', '386', 'resources/bin/mac/ia32'))
.then(() => install('windows', 'amd64', 'resources/bin/win/x64'))
.then(() => install('windows', '386', 'resources/bin/win/ia32'))
.then(() => install('linux', 'amd64', 'resources/bin/linux/x64'))
.then(() => install('linux', '386', 'resources/bin/linux/ia32'))

17
package.json

@ -8,7 +8,10 @@
"build-dll": "webpack --require babel-register --config webpack.config.renderer.dev.dll.js --progress",
"build-main": "webpack --require babel-register --config webpack.config.main.prod.js --progress",
"build-renderer": "webpack --require babel-register --config webpack.config.renderer.prod.js --progress",
"build-grpc": "rimraf app/node_modules/grpc/src/node && build install-app-deps",
"clean": "rimraf node_modules app/node_modules dll app/dist",
"dev": "cross-env START_HOT=1 npm run start-renderer-dev",
"fetch-lnd": "node ./internals/scripts/fetch-lnd-for-packaging.js",
"flow": "flow",
"flow-typed": "rimraf flow-typed/npm && flow-typed install --overwrite || true",
"lint-base": "eslint --cache --format=node_modules/eslint-formatter-pretty",
@ -21,11 +24,12 @@
"lint-styles-fix": "npm run lint-styles-fix-base -- $npm_package_config_style_paths",
"lint-check": "eslint --print-config .eslintrc.js | eslint-config-prettier-check",
"lint-ci": "npm run lint && npm run lint-styles && npm run flow",
"package": "npm run build && build --publish never",
"package-all": "npm run build && build -mwl",
"package-linux": "npm run build && build --linux",
"package-win": "npm run build && build --win",
"postinstall": "concurrently --raw \"npm:flow-typed\" \"npm:build-dll\" \"electron-builder install-app-deps\" \"node node_modules/fbjs-scripts/node/check-dev-engines.js package.json\"",
"package": "npm run build && rimraf app/node_modules/grpc/src/node && npm run fetch-lnd && build --publish never",
"package-mac": "npm run package -- --platform mac --arch all && npm run build-grpc",
"package-win": "npm run package -- --platform win --arch all && npm run build-grpc",
"package-linux": "npm_config_target_libc=glibc npm run package -- --platform linux --arch all && npm run build-grpc",
"package-all": "npm run package-mac && npm run package-win && npm run package-linux",
"postinstall": "concurrently --raw \"npm:flow-typed\" \"npm:build-dll\" \"build install-app-deps\" \"node node_modules/fbjs-scripts/node/check-dev-engines.js package.json\"",
"prestart": "npm run build",
"start": "cross-env NODE_ENV=production electron ./app/",
"start-main-dev": "cross-env HOT=1 NODE_ENV=development electron -r babel-register ./app/main.dev",
@ -84,6 +88,7 @@
]
},
"linux": {
"category": "Utility",
"target": [
"deb",
"AppImage"
@ -97,7 +102,7 @@
"resources/lnd.conf",
"resources/rpc.proto",
{
"from": "resources/bin/${platform}",
"from": "resources/bin/${os}/${arch}",
"to": "bin",
"filter": [
"lnd*"

Loading…
Cancel
Save