signal-desktop-from-src: simplify build:release step
This commit is contained in:
@@ -270,9 +270,6 @@ buildNpmPackage rec {
|
|||||||
export npm_config_arch=${buildNpmArch}
|
export npm_config_arch=${buildNpmArch}
|
||||||
export npm_config_target_arch=${hostNpmArch}
|
export npm_config_target_arch=${hostNpmArch}
|
||||||
|
|
||||||
# npm config set electronDist ${electron'}/libexec/electron
|
|
||||||
# npm config set electronVersion ${electron'.version}
|
|
||||||
|
|
||||||
# redo parts of npmConfigHook, but with `npm_config_nodedir` properly set:
|
# redo parts of npmConfigHook, but with `npm_config_nodedir` properly set:
|
||||||
# prefetchNpmDeps --map-cache
|
# prefetchNpmDeps --map-cache
|
||||||
# prefetchNpmDeps --fixup-lockfile "$PWD/package-lock.json"
|
# prefetchNpmDeps --fixup-lockfile "$PWD/package-lock.json"
|
||||||
@@ -316,21 +313,23 @@ buildNpmPackage rec {
|
|||||||
|
|
||||||
# excerpts from package.json:
|
# excerpts from package.json:
|
||||||
# - "build": "run-s --print-label generate build:esbuild:prod build:release"
|
# - "build": "run-s --print-label generate build:esbuild:prod build:release"
|
||||||
# - "generate": "npm-run-all build-protobuf build:esbuild sass get-expire-time copy-components"
|
# - "generate": "npm-run-all build-protobuf build:esbuild build:dns-fallback build:icu-types build:compact-locales sass get-expire-time copy-components",
|
||||||
# - "build-protobuf": "yarn build-module-protobuf"
|
# - "build-protobuf": "npm run build-module-protobuf",
|
||||||
# - "build-module-protobuf": "pbjs --target static-module --force-long --no-typeurl --no-verify --no-create --wrap commonjs --out ts/protobuf/compiled.js protos/*.proto && pbts --out ts/protobuf/compiled.d.ts ts/protobuf/compiled.js"
|
# - "build-module-protobuf": "pbjs --target static-module --force-long --no-typeurl --no-verify --no-create --no-convert --wrap commonjs --out ts/protobuf/compiled.js protos/*.proto && pbts --no-comments --out ts/protobuf/compiled.d.ts ts/protobuf/compiled.js",
|
||||||
# - "build:esbuild": "node scripts/esbuild.js"
|
# - "build:esbuild": "node scripts/esbuild.js",
|
||||||
# - "sass": "sass stylesheets/manifest.scss:stylesheets/manifest.css stylesheets/manifest_bridge.scss:stylesheets/manifest_bridge.css"`
|
# - "build:dns-fallback": "node ts/scripts/generate-dns-fallback.js",
|
||||||
# - "get-expire-time": "node ts/scripts/get-expire-time.js"
|
# - "build:icu-types": "node ts/scripts/generate-icu-types.js",
|
||||||
# - "copy-components": "node ts/scripts/copy.js"
|
# - "build:compact-locales": "node ts/scripts/generate-compact-locales.js",
|
||||||
# - "build:esbuild:prod": "node scripts/esbuild.js --prod"
|
# - "sass": "sass stylesheets/manifest.scss:stylesheets/manifest.css stylesheets/manifest_bridge.scss:stylesheets/manifest_bridge.css",
|
||||||
# - "build:release": "cross-env SIGNAL_ENV=production yarn build:electron -- --config.directories.output=release"
|
# - "get-expire-time": "node ts/scripts/get-expire-time.js",
|
||||||
# - "build:electron": "electron-builder --config.extraMetadata.environment=$SIGNAL_ENV"
|
# - "copy-components": "node ts/scripts/copy.js",
|
||||||
|
# - "build:esbuild:prod": "node scripts/esbuild.js --prod",
|
||||||
|
# - "build:release": "cross-env SIGNAL_ENV=production npm run build:electron -- --config.directories.output=release",
|
||||||
|
# - "build:electron": "electron-builder --config.extraMetadata.environment=$SIGNAL_ENV",
|
||||||
#
|
#
|
||||||
# - "build:dev": "run-s --print-label generate build:esbuild:prod"
|
# i can't call toplevel `build` because some steps fail (e.g. dns-fallback) and can be skipped instead,
|
||||||
#
|
# while other steps fail (electron-builder) and need patching, but npm doesn't plumb the necessary flags through.
|
||||||
# i can't call toplevel `yarn build` because it doesn't properly forward the `--offline` flags where they need to go.
|
# so instead i call each step individually.
|
||||||
# instead i call each step individually.
|
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
runHook preBuild
|
runHook preBuild
|
||||||
@@ -352,7 +351,7 @@ buildNpmPackage rec {
|
|||||||
npm run build:esbuild:prod --offline --frozen-lockfile
|
npm run build:esbuild:prod --offline --frozen-lockfile
|
||||||
|
|
||||||
cp -r ${electron'}/libexec/electron electron-dist
|
cp -r ${electron'}/libexec/electron electron-dist
|
||||||
npm exec electron-builder -- \
|
npm run build:release -- \
|
||||||
--linux --${hostNpmArch} \
|
--linux --${hostNpmArch} \
|
||||||
-c.electronDist=electron-dist \
|
-c.electronDist=electron-dist \
|
||||||
-c.electronVersion=${electron'.version} \
|
-c.electronVersion=${electron'.version} \
|
||||||
@@ -366,9 +365,9 @@ buildNpmPackage rec {
|
|||||||
|
|
||||||
# directory structure follows the original `signal-desktop` nix package
|
# directory structure follows the original `signal-desktop` nix package
|
||||||
mkdir -p $out/lib
|
mkdir -p $out/lib
|
||||||
cp -R dist/linux${crossNpmArchExt}-unpacked $out/lib/Signal
|
cp -R release/linux${crossNpmArchExt}-unpacked $out/lib/Signal
|
||||||
# cp -R dist/linux-unpacked/resources $out/lib/Signal/resources
|
# cp -R release/linux-unpacked/resources $out/lib/Signal/resources
|
||||||
# cp -R dist/linux-unpacked/locales $out/lib/Signal/locales
|
# cp -R release/linux-unpacked/locales $out/lib/Signal/locales
|
||||||
|
|
||||||
mkdir $out/bin
|
mkdir $out/bin
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user